简体   繁体   English

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

[英]How do I get Sphinx to ignore the GPL notice in my docstring?

I'm using Sphinx to document my Python package. 我正在使用Sphinx来记录我的Python包。 When I use the automodule directive on my module: 当我在我的模块上使用automodule指令时:

.. automodule:: mymodule
:members:

It prints everything including the GPL notice in the docstring. 它会打印包括文档字符串中的GPL通知在内的所有内容。 Is there any way to tell Sphinx to ignore the docstring/GPL or should I leave it included in the documentation? 有没有办法告诉Sphinx忽略docstring / GPL还是应该把它留在文档中?

I ran into the same problem just now and fixed it by moving the license notice out of the docstring and into a regular comment block at the top of the file. 我刚刚遇到了同样的问题并通过将许可证通知移出文档字符串并进入文件顶部的常规注释块来修复它。

For example: 例如:

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

""" This is the module docstring.

Description of the module here.

Etc, etc.

"""

import ....
...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM