Commits

Matt Williams committed 2bc2793

Add function documentation to the Sphinx docs.

Perhaps this should be put on a separate page?

  • Participants
  • Parent commits 96e845d

Comments (0)

Files changed (3)

doxylink/doc/conf.py

 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
+sys.path.insert(0, os.path.abspath('../'))
 
 # -- General configuration -----------------------------------------------------
 
 
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.todo']
+extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.autodoc']
 
 # Add any paths that contain templates here, relative to this directory.
 #templates_path = ['_templates']
 # Example configuration for intersphinx: refer to the Python standard library.
 intersphinx_mapping = {'http://docs.python.org/': None}
 
+autodoc_default_flags = ['members']
+
 def setup(app):
 	app.add_description_unit('confval', 'confval', 'pair: %s; configuration value')

doxylink/doc/index.rst

 	:polyvox:`tidyUpMemeory(int) <tidyUpMemory>`
 	:polyvox:`PolyVox::Array::operator[]`
 
+Function reference
+------------------
+
+.. automodule:: sphinxcontrib.doxylink
+
 :requires: Python 2.5
 
 .. todo::

doxylink/sphinxcontrib/doxylink.py

 # -*- coding: utf-8 -*-
-"""
-See doc/index.rst for usage
-"""
 
 from docutils import nodes, utils
 
 	"""
 	Match the requested symbol reverse piecewise (split on '::') against the tag names to ensure they match exactly (modulo ambiguity)
 	So, if in the mapping there is "PolyVox::Volume::FloatVolume" and "PolyVox::Volume" they would be split into:
+	
+	.. code-block:: python
+	
 		['PolyVox', 'Volume', 'FloatVolume'] and ['PolyVox', 'Volume']
+	
 	and reversed:
+	
+	.. code-block:: python
+	
 		['FloatVolume', 'Volume', 'PolyVox'] and ['Volume', 'PolyVox']
+	
 	and truncated to the shorter of the two:
+	
+	.. code-block:: python
+	
 		['FloatVolume', 'Volume'] and ['Volume', 'PolyVox']
+	
 	If we're searching for the "PolyVox::Volume" symbol we would compare:
+		
+	.. code-block:: python
+	
 		['Volume', 'PolyVox'] to ['FloatVolume', 'Volume', 'PolyVox']. That doesn't match so we look at the next in the mapping:
 		['Volume', 'PolyVox'] to ['Volume', 'PolyVox']. Good, so we add it to the list
+	
 	"""
 	piecewise_list = {}
 	for item, data in mapping.items():