Hi Andrew, Il giorno Fri, 10 Dec 2010 08:18:10 -0800 (PST) Andrew <redmu...@gmail.com> ha scritto:
> Hello all, > > Currently, I have my documentation on a per-module basis, using a > centralized documentation directory, i.e. `index.rst', `module1.rst', > etc., using the autodoc extension to parse out docstrings in each > module. > > However, I would like to be able to store the ReST pages for each > module in the __init__.py files as docstrings themselves, in order to > keep the documentation uniform throughout the project. Is there > anyway to do this, either with vanilla Sphinx or with extensions, or > would this be something I'd have to write myself? in my projects I write an index of packages and modules to be documented: http://sourceforge.net/apps/trac/gsdview/browser/trunk/doc/source/reference.txt and this is the only think I have to do manually. I just enable the 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', extensions and set the following options in the conf.py autoclass_content = 'both' autodoc_default_flags = ['members', 'undoc-members', 'show-inheritance'] autosummary_generate = ['reference'] see http://sourceforge.net/apps/trac/gsdview/browser/trunk/doc/source/conf.py In this way sphinx automatically generates doc sources for each module and generates code documentation using docstings. > Example: > module1/__init__.py: > """ > :mod:`module1` > > Models models models > ================= > > .. automodule:: module1 > :members: > """ In my opinion it is not a good idea to use auto* directives in a docstring. ciao -- Antonio Valentino -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-...@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.