我正在使用 Sphinx 来记录我的 Python 包。当我在我的模块上使用 automodule 指令时:
.. automodule:: mymodule
:members:
它打印所有内容,包括文档字符串中的 GPL 声明。有什么方法可以告诉 Sphinx 忽略 docstring/GPL 还是我应该将其保留在文档中?
最佳答案
我刚才遇到了同样的问题,并通过将许可声明从文档字符串中移到文件顶部的常规注释 block 中来解决它。
例如:
# Copyright 2013 Example, inc. All rights reserved.
#
# License ...
# ...
# ...
""" This is the module docstring.
Description of the module here.
Etc, etc.
"""
import ....
...
关于python - 如何让 Sphinx 忽略我的文档字符串中的 GPL 通知?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17209712/