如何让Sphinx忽略我的文档字符串中的GPL通知?

时间:2013-06-20 09:11:30

标签: python python-sphinx docstring

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

.. automodule:: mymodule
:members:

它打印包括文档字符串中的GPL通知在内的所有内容。有没有办法告诉Sphinx忽略docstring / GPL还是应该把它留在文档中?

1 个答案:

答案 0 :(得分:11)

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

例如:

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

""" This is the module docstring.

Description of the module here.

Etc, etc.

"""

import ....
...
相关问题