标签: python-sphinx

Sphinx 主题对 readthedocs 的 Docutils 依赖

我曾经在 readthedocs.io 服务器上保存一个项目文档。这是CoFEA Initiative 的链接

自 4 月 3 日以来,由于发布了新版本的 docutils 库,它看起来有点破损(例如,主徽标向左对齐,而它应该居中)。docutils 的最新版本是 0.17,这个特定的 Sphinx 主题在 0.16 版本之前工作得很好。

日志文件显示了它不工作的原因。首先,readthedocs服务器安装最新版本的docutils

Collecting docutils>=0.11
  Downloading docutils-0.17-py2.py3-none-any.whl (575 kB)
Run Code Online (Sandbox Code Playgroud)

然后 Sphinx 主题尝试根据中定义的内容下载并安装特定版本的 docutilssetup.py

Installed /home/docs/checkouts/readthedocs.org/user_builds/cofea/envs/latest/lib/python3.7/site-packages/ipygany-0.5.0-py3.7.egg
Searching for docutils==0.16
Reading https://pypi.org/simple/docutils/
Downloading https://files.pythonhosted.org/packages/81/44/8a15e45ffa96e6cf82956dd8d7af9e666357e16b0d93b253903475ee947f/docutils-0.16-py2.py3-none-any.whl#sha256=0c5b78adfbf7762415433f5515cd5c9e762339e23369dbe8000d84a4bf4ab3af
Best match: docutils 0.16
Processing docutils-0.16-py2.py3-none-any.whl
Installing docutils-0.16-py2.py3-none-any.whl to /home/docs/checkouts/readthedocs.org/user_builds/cofea/envs/latest/lib/python3.7/site-packages
Run Code Online (Sandbox Code Playgroud)

我认为发生的情况是,当调用 Sphinx 命令时,它使用的是版本 0.17 而不是 0.16。

有没有办法强制为 Sphinx 使用 docutils 0.16 版本?

setup.py docutils python-sphinx read-the-docs

1
推荐指数
1
解决办法
1985
查看次数

如何更改html页面路径sphinx

我使用 Sphinx 编写文档。

现在页面路径是“folder/html/”。我想用“folder/”替换它。我尝试更改 BUILDDIR,但没有帮助。

怎么做?我用的是窗户

python-sphinx

1
推荐指数
1
解决办法
810
查看次数

Sphinx 干净安装从一开始就被破坏

我安装了Sphinx

   brew install sphinx
Run Code Online (Sandbox Code Playgroud)

但是当我打电话时sphinx-quickstart,会发生这样的事情:

cls ~/workspace/SphinxTest $ sphinx-quickstart 
-bash: /usr/local/share/python3/sphinx-quickstart: /usr/local/Cellar/python3/3.2.3/Frameworks/Python.framework/Versions/3.2/Resou: bad interpreter: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我当前的版本python3是 Python 3.3.0,位于/usr/local/Cellar/python3/3.3.0. 我之前还安装了 Python 3.2.3,但在自制软件清理过程中被卸载了。为什么 homebrew 仍然尝试使用已卸载的 Python 3 版本?我怎样才能得到一个可用的狮身人面像?

homebrew python-3.x python-sphinx

0
推荐指数
1
解决办法
548
查看次数

Sphinx 装饰类未记录

我正在用 Sphinx 记录我的图书馆。我有装饰器logic_object

class logic_object:
    """Decorator for logic object class.
    """
    def __init__(self, cls):
        self.cls = cls
        self.__doc__ = self.cls.__doc__
Run Code Online (Sandbox Code Playgroud)

我有gravity一个由以下人员装饰的课程logic_object

@logic_object
class gravity:
    """Basic gravity object logic class.

    :param float g: pixels of acceleration
    :param float jf: jump force
    """
#There is more not important code.
Run Code Online (Sandbox Code Playgroud)

我的狮身人面像.rst文件是:

Mind.Existence
========================
Classes, methods and functions marked with * aren't for usual cases, they are made to help to the rest of the library. …
Run Code Online (Sandbox Code Playgroud)

python python-sphinx autodoc python-decorators

0
推荐指数
1
解决办法
928
查看次数

狮身人面像 - toctree和内容之间有什么不同?

我可以用两种方式创建目录:

.. contents::
   :local:
   depth: 1
Run Code Online (Sandbox Code Playgroud)

或者作为

.. toctree::
    :maxdepth: 1

    index
Run Code Online (Sandbox Code Playgroud)

有什么区别?我应该在哪里使用toctree和内容?

python python-sphinx

0
推荐指数
1
解决办法
335
查看次数

在 Sphinx HTML 输出中排除 reStructuredText 注释

我想在 reStructuredText 文档中添加一些注释,这些注释在我构建文档时不会显示。例如,我想将以下内容放入文件中:

This is the source of my .rst file. I would like the following block to be excluded when the docs are built.
..
    This should not show up in the HTML.
    This should not either.

This text would show up in the HTML, as we're past the comment block.
Run Code Online (Sandbox Code Playgroud)

根据Sphinx 文档,“根据输出格式化程序,注释可能会从处理后的输出中删除。” 但是,我在HTML 输出配置文档中没有看到任何选项。

我正在使用 Sphinx ( sphinx-build) 来构建我的文档。我使用sphinx-quickstart进行设置,从而通过make html.

提前致谢!

python restructuredtext python-3.x python-sphinx

0
推荐指数
1
解决办法
1268
查看次数