sphinx not to include source code during build

I am trying to document my python packages using Sphinx 1.2.1.

My definition of the rst file contains some description about each modules, usage and adding the autodoc syntax for restructured text as below.

module
------

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

The above setup makes a clear html build for me without any problem. It derives the docs from all the class, its associated members etc., but it includes the source code in the html. How can I indicate sphinx not to link the source code of each module?


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

html_show_sourcelink = False

In the conf.py where make all modifications with regards to specific documentation remove the sphinx.ext.viewcode extension.

# 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'
]

The above was modified to

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

上一篇: 我如何让Sphinx在HTML构建中显示继承图?

下一篇: 构建过程中,sphinx不包括源代码