8

我正在使用 Sphinx 来记录我的 Python 包。当我在我的模块上使用 automodule 指令时:

.. automodule:: mymodule
:members:

它打印所有内容,包括文档字符串中的 GPL 通知。有什么方法可以告诉 Sphinx 忽略文档字符串/GPL,还是应该将其包含在文档中?

4

1 回答 1

13

我刚才遇到了同样的问题,并通过将许可证通知从文档字符串中移出并放入文件顶部的常规注释块中来解决它。

例如:

# Copyright 2013 Example, inc.  All rights reserved.
#
# License ...
# ...
# ...

""" This is the module docstring.

Description of the module here.

Etc, etc.

"""

import ....
...
于 2013-08-08T10:09:11.933 回答