ahsphinx
To use sphinx to document a package:
1) in the top level package directory (next to package.xml) add a file conf.py
An example is in /home/acorn/l/ros2/src/moveit_pr2/pr2_moveit_tutorials/conf.py
Here (indented 4 spaces) it is::
import sys, os
sys.path += [ os.path.abspath( 'doc' )]
extensions = [ 'sphinx.ext.extlinks',
'tutorialformatter' ]
# The master toctree document.
master_doc = 'index'
# The suffix of source filenames.
source_suffix = '.rst'
project = u'pr2_moveit_tutorials'
copyright = u'2013, SRI International'
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
show_authors = True
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
extlinks = {'codedir': ('https://github.com/ros-planning/moveit_pr2/blob/hydro-devel/pr2_moveit_tutorials/%s', ''),
'moveit_core': ('http://docs.ros.org/api/moveit_core/html/classmoveit_1_1core_1_1%s.html', ''),
'planning_scene': ('http://docs.ros.org/api/moveit_core/html/classplanning__scene_1_1%s.html', ''),
'planning_scene_monitor': ('http://docs.ros.org/api/moveit_ros_planning/html/classplanning__scene__monitor_1_1%s.html', ''),
'collision_detection_struct': ('http://docs.ros.org/api/moveit_core/html/structcollision__detection_1_1%s.html', ''),
'collision_detection_class': ('http://docs.ros.org/api/moveit_core/html/classcollision__detection_1_1%s.html', ''),
'kinematic_constraints': ('http://docs.ros.org/api/moveit_core/html/classkinematic__constraints_1_1%s.html', ''),
'moveit_core_files': ('http://docs.ros.org/api/moveit_core/html/%s.html', '')}
2) That file refers to index.rst so create (same dir) a file index.rst
An example is in /home/acorn/l/ros2/src/moveit_pr2/pr2_moveit_tutorials/index.rst
Here (indented 4 spaces) it is::
Moveit Tutorials for the PR2
============================
- :doc:`Kinematics</kinematics/src/doc/index>` shows the basics of using the C++ API for kinematics.
This is the layout of the root document.
3) Sphinx also finds any other index.rst file in the tree and uses that.
===================
To build sphinx docs
rosdoc_lite -o /tmp/outputdir /path/to/package
or
cd /path/to/package
rosdoc_lite -o /tmp/outputdir .