使用 doxygen 记录 Python 包

发布于 2024-11-15 10:55:13 字数 1014 浏览 2 评论 0原文

http://www.doxygen.nl/manual/docblocks 中的“Python 中的特殊文档块”。 html 给出了 doxygen 在 Python 中的使用示例。

在 doxygen 生成的相应 HTML 文档中(Web 中的示例输出),如果单击包名称,则会显示与该包相关的所有描述、类和函数。

如果我从 doxygen 文档中获取相同的示例脚本,使用“doxygen -g config”创建配置文件并使用“doxygen config”生成 html,则输出会有所不同。如果我单击包名称,则仅显示包描述,而不显示类和函数。

我需要在配置文件或某些 xml 方案中更改什么,才能在包文档下包含类和函数。

编辑1:上面网页的示例:

## @package pyexample
#  Documentation for this module.
#
#  More details.

## Documentation for a function.
#
#  More details.
def func():
   pass

## Documentation for a class.
#
#  More details.
class PyClass:

    ## The constructor.
    def __init__(self):
        self._memVar = 0;

    ## Documentation for a method.
    #  @param self The object pointer.
    def PyMethod(self):
        pass

    ## A class variable.
    classVar = 0;

    ## @var _memVar
    #  a member variable

编辑2: 使用 Win XP 和 doxygen-1.7.4-setup.exe

"Special documentation blocks in Python" in http://www.doxygen.nl/manual/docblocks.html gives an example of doxygen usage with Python.

In the corresponding HTML documentation that is generated by doxygen (example output in the web), if one clicks on a package name, then all the descriptions, classes and functions connected with the package are shown.

If I take the same example script from doxygen documentation, create config file with "doxygen -g config" and generate html with "doxygen config", then the output is different. If I click on the package name, then only the package description is shown, but not the classes and functions.

What do I need to change in the config file or some xml scheme, in order to have classes and functions under package documentation.

Edit 1: The example from the webpage above:

## @package pyexample
#  Documentation for this module.
#
#  More details.

## Documentation for a function.
#
#  More details.
def func():
   pass

## Documentation for a class.
#
#  More details.
class PyClass:

    ## The constructor.
    def __init__(self):
        self._memVar = 0;

    ## Documentation for a method.
    #  @param self The object pointer.
    def PyMethod(self):
        pass

    ## A class variable.
    classVar = 0;

    ## @var _memVar
    #  a member variable

Edit 2:
using Win XP and doxygen-1.7.4-setup.exe

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

悍妇囚夫 2024-11-22 10:55:13

doxygen 文档中的示例是使用以下配置设置生成的:

PROJECT_NAME      = "Python"
OUTPUT_DIRECTORY  = pyexample
GENERATE_LATEX    = NO
GENERATE_MAN      = NO
GENERATE_RTF      = NO
OPTIMIZE_OUTPUT_JAVA = YES
INPUT             = pyexample.py
QUIET             = YES
JAVADOC_AUTOBRIEF = YES
SEARCHENGINE      = NO

请参阅 doxygen 源包的示例目录。

The example in the doxygen documentation was generated with the following config settings:

PROJECT_NAME      = "Python"
OUTPUT_DIRECTORY  = pyexample
GENERATE_LATEX    = NO
GENERATE_MAN      = NO
GENERATE_RTF      = NO
OPTIMIZE_OUTPUT_JAVA = YES
INPUT             = pyexample.py
QUIET             = YES
JAVADOC_AUTOBRIEF = YES
SEARCHENGINE      = NO

See the examples directory of the doxygen source package.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文