Hi,
I am pretty new to this too, so take my advice with a grain of salt.
On 18/02/2011 14:00, Burhan wrote:
Hello:
I am new to Sphinx, and am going to use it for a python project to
generate HTML documentation. My problem is rather basic, I'm not sure
how to format my docstrings so that Sphinx can extract the
information.
I understand about using autodoc extension, and making sure that my
modules are available to python so that sphinx can find my code - my
problem is a bit basic, how do I actually comment the code?
Do I have to enter *verbatim* examples are written in the
documentation? So for example, is it like this:
def my_funct(param=None,param2=None):
"""
.. py:func:: my_funct(param=None,param2=None)
This function does something with two parameters,
which are default to :py:`None`
"""
Or do I have to document it separately in another file? A simple
python code example would really help me out.
In your code you would do this:
def my_funct(param=None,param2=None):
"""
This function does something with two parameters,
which are default to :py:`None`
"""
and in the .rst file you could do:
.. autoclass::
:members:
for other ways/options see http://sphinx.pocoo.org/domains.html
to generate the .rst files (if you don't want to do them by hand or at
least to get a start) you might want to look at
https://bitbucket.org/etienned/sphinx-autopackage-script
Werner
--
You received this message because you are subscribed to the Google Groups
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@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.