Hi folks,

This is a continuation of a topic raised at

https://groups.google.com/group/sage-devel/browse_thread/thread/b019501fe1abab8c/

on having one page per method/function in the reference manual.


On Sun, Dec 12, 2010 at 8:56 AM, Nathann Cohen <nathann.co...@gmail.com> wrote:
> Hello everybody !!!
>
> My question on sphinx-dev was finally answered : it sounds possible to
> have one page per method ! :-)

It's possible, but still there is no way I can think of to get Sphinx
to automatically generate a list of all public methods in a class, and
put them in a RST index file. The autodoc and autosummary directives
can be used to generate one page per method or function. The general
syntax to use in a RST index file is:

.. currentmodule:: sage.path.to.module.name.class.name
.. autoclass:: sage.path.to.module.name.class.name
.. autosummary::
   :toctree: ../sage/path/to/module/name

   my_method_a
   my_method_b
   my_method_c

The above should generate one documentation page for each listed
method. But the problem now is how to get a list of all public methods
of a class. After hours of reading through the Sphinx documentation
for autodoc and autosummary, I still couldn't figure out a way. So I
wrote my own script to parse a given module and write a RST index file
of that module containing: (1) audodoc and autosummary directives; (2)
a list of all functions of the module, if there are any; (3) a list of
all classes and their corresponding public methods. The script is up
at

http://bitbucket.org/mvngu/oppmof

Using that script, I have converted the documentation for graph theory
modules to use one page per method/function. Experimental results are
up at

http://mvngu.googlecode.com/hg/onepage/graphs/index.html

The script can be used to help you put the documentation of a module
in the reference manual. If you find it useful, a patch could be
produced to merge an updated version of the script into the Sage
script library. In the meantime, please look through the new generated
reference documentation for the graph theory modules. Suggestions are
welcome to help iron out any issues with the new generated
documentation. Once we are happy with how the new reference manual
would look with each page per method/function, I could produce
patch(es) to convert the whole reference manual to use one page per
method/function; i.e. only for those modules that are already in the
manual.

-- 
Regards
Minh Van Nguyen

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to