In previous versions, epydoc extracted information about each module by importing it, and using introspection to examine its contents. Epydoc 3.0 still supports introspection, but is also capable of extracting information about python modules by parsing their source code. Furthermore, the new version of epydoc can combine these two sources of information (introspection & parsing). This is important because each source has its own advantages and disadvantages with respect to the other. See the FAQ for more information about the relative benefits of introspection and parsing, and why it's good to merge information from both sources.
Epydoc now supports variable docstrings. If a variable assignment statement is immediately followed by a bare string literal, then that assignment is treated as a docstring for that variable. In classes, variable assignments at the class definition level are considered class variables; and assignments to instance variables in the constructor (__init__) are considered instance variables:
>>>
class
A:...
x = 22...
"""Docstring for class variable A.x"""
...
...
def
__init__
(self, a):...
self.y = a...
"""Docstring for instance variable A.y
Variables may also be documented using comment docstrings.
If a variable assignment is immediately preceeded by a comment whose
lines begin with the special marker "#:
", or is
followed on the same line by such a comment, then it is treated as a
docstring for that variable:
>>>
#: docstring for x
...
x = 22>>>
x = 22#: docstring for x
Epydoc can automatically generate a variety of graphs, including class tress, package trees, uml class graphs, and import graphs. These graphs may be included in the generated output in one of two ways:
--graph
option causes epydoc to
automatically generate a given type of graph for all applicable
modules, classes, or functions. For example, using
--graph classtree
will replace the text-based
class tree with a graphical class tree on all module pages. See
the command line interface
documentation for more information.G
" colorization marker (i.e.,
"G{graphname}
", or "G{graphname
options...}
" for graphs with options). In
reStructuredText, graphs are created using custom directives.
For more information, see the epytext manual or the notes on using reStructuredText
with epydoc. . Epydoc can also generate function call graphs, showing the callers
and the callees for each function. To generate call graphs, Epydoc uses
data produced by a Python
profiler such Profile
or hotshot
.
For some examples of automatically generated graphs, see the API Documentation for epydoc (including the page
for the epydoc.docwriter.dotgraph
module).
Graph generation requires the Graphviz package [download].
The HTML output now includes source code listings with syntax higlighting, including links from identifiers back into the documentation. For examples of source code pages, see the API Documentation for epydoc (follow the show source link from any documented module, class, or function).
<Foo instance at 0x...>
). Syntax highlighting
is used for introspected values, including colorization for regular
expressions. epydoc.docwriter.xlink
, can be used to determine
the correct URL for any object name; and a new redirect page named
named "redirect.html"
uses javascript to automatically
redirect the user to the correct URL for any given object name. See
the FAQ for more information.
__version__
are recognized as modules fields.__all__
attribute is used to decide whether objects
are public or private. If an object is listed in an __all__
list, it will appear defined in that module even if imported from elsewhere,
keeping the API safe from implementation changes.See the Release Notes on SourceForge.
Home | Installing Epydoc | Using Epydoc | Epytext |