Generates Python documentation in Markdown using Python docstrings.
This module is an early experimentation to see how feasible it is to only use docstrings and class/function definitions as the source for documentation. Since the idea of Python is self-documenting, this should suffice for most small projects.
Markdown is chosen becuase the author likes it. Thanks, John Gruber.
This module was created quickly, so many features are missing. If you would like to see something implemented, please create an issue.
Get the module from Github (cheeseshop package coming soon):
$ git clone git://github.com/Spaxe/docdoc.git
Add the module's path to ypur $PYTHONPATH.
>>> from docdoc import docdoc
>>> print docodc(<filepath>)
$ ./docdoc.py <filepath>
Extracts docstrings from a Python AST node.
This class should be used like an ast.NodeVisitor; see main for an
example. Once the parsing is done, the caller can use format_doc() to
retrieve the final markdown for further use.
Constructor.
Records a documentation item.
Return the final markdown string with the documentation items.
Automatically called when visiting a Module.
Automatically called when visiting a ClassDef.
Extracts documentation from a ClassDef.
Extracts documentation from a FunctionDef.
Extracts Python literals from a value/expression node.
Parses the Python source file. Returns documentation in markdown.