构建过程中,sphinx不包括源代码

我正在尝试使用Sphinx 1.2.1来记录我的Python包。

我对第一个文件的定义包含一些关于每个模块的描述,用法以及为重新构造的文本添加autodoc语法,如下所示。

module
------

.. automodule:: RAT.REPORTER.bemrstcreator
    :members:
    :undoc-members:
    :show-inheritance:

上面的设置为我创建了一个清晰的html版本,没有任何问题。 它从所有类,它的相关成员等中派生出文档,但是它包含了html中的源代码。 我如何指示狮身人面像不链接每个模块的源代码?


您可以在config.py文件中找到下一个配置值,并将其设置为false:

html_show_sourcelink = False

在关于特定文档的所有修改的conf.py中,删除sphinx.ext.viewcode扩展。

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.viewcode',
    'rst2pdf.pdfbuilder'
]

以上修改为

extensions = [
    'sphinx.ext.autodoc',
    'rst2pdf.pdfbuilder'
]
链接地址: http://www.djcxy.com/p/75493.html

上一篇: sphinx not to include source code during build

下一篇: reference a function generated by autodoc in Sphinx?