http://epydoc.sourceforge.net/
Epydoc is a tool for
generating API documentation for Python modules, based on their
docstrings.
A lightweight markup language called [url=http://epydoc.sourceforge.net/epytextintro.html]epytext[/url]
can be used to format docstrings, and
to add information about specific fields, such as parameters and
instance variables. Epydoc also understands docstrings written in
[url=http://docutils.sourceforge.net/rst.html]reStructuredText[/url]
,
Javadoc, and plaintext.
example:
# epydoc x_intercept.py
Epydoc is a tool for
generating API documentation for Python modules, based on their
docstrings.
A lightweight markup language called [url=http://epydoc.sourceforge.net/epytextintro.html]epytext[/url]
can be used to format docstrings, and
to add information about specific fields, such as parameters and
instance variables. Epydoc also understands docstrings written in
[url=http://docutils.sourceforge.net/rst.html]reStructuredText[/url]
,
Javadoc, and plaintext.
example:
def x_intercept(m, b):
"""
Return the x intercept of the line M{y=m*x+b}. The X{x intercept}
of a line is the point at which it crosses the x axis (M{y=0}).
This function can be used in conjuction with L{z_transform} to
find an arbitrary function's zeros.
@type m: number
@param m: The slope of the line.
@type b: number
@param b: The y intercept of the line. The X{y intercept} of a
line is the point at which it crosses the y axis (M{x=0}).
@rtype: number
@return: the x intercept of the line M{y=m*x+b}.
"""
return -b/m
# epydoc x_intercept.py
Epydoc教程
本文介绍了一个用于生成Python模块API文档的工具Epydoc。通过解析模块的docstrings,Epydoc能够创建详细的文档,并支持使用epytext、reStructuredText、Javadoc及纯文本格式进行标记。文中提供了一个示例函数x_intercept的docstring,展示了如何使用Epydoc的标记语言来描述参数类型、函数返回值等。
5781

被折叠的 条评论
为什么被折叠?



