【问题标题】:Add copyright information to Sphinx documentation将版权信息添加到 Sphinx 文档
【发布时间】:2016-07-30 01:07:16
【问题描述】:

我正在使用 Sphinx 来记录 Python 模块。

我有一个定义了作者版权的模块。

__author__ = "John Doe <johndoe@example.com>"
__copyright__ = "Copyright 2015-2016 Dummy Corp All Rights Reserved."

我尝试将 :special-members: 标签添加到 automodule 指令中。

.. automodule:: PyFabric
   :special-members: 

这记录了作者,但没有获得版权。有没有办法让 Sphinx 承认并添加版权?

【问题讨论】:

    标签: python python-sphinx copyright-display


    【解决方案1】:

    在您的conf.py 中,设置copyright = "© 2042 The Ravenous Bugblatter Beast of Traal"

    sphinx-doc documentation

    至少对于我使用的html_theme = "sphinx_rtd_theme",这将在每个 HTML 页面的页脚中添加版权声明。

    不会将版权声明添加到 Latex(和 PDF)生成的文档中;在撰写本文时有一个open feature request。尽管如此,我已经询问过如何做到这一点,请参阅 How to add copyright notice to sphinx-generated latex documentation?

    【讨论】:

      【解决方案2】:

      Sphinx 不使用这些,是吗? https://pythonhosted.org/an_example_pypi_project/sphinx.html

      moduleauthor:: John Doe <johndoe@example.com>
      

      无论如何,就我所见,狮身人面像没有那个。

      更多python格式化示例:What is the common header format of Python files?

      【讨论】:

        猜你喜欢
        • 2012-06-27
        • 1970-01-01
        • 1970-01-01
        • 2019-02-11
        • 2019-06-06
        • 1970-01-01
        • 2018-07-12
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多