标签: read-the-docs

在 sphinx 侧边栏中启用版本阅读文档主题

我想将 versions.html 包含在侧边栏中,但无法成功。

我尝试在 ** 中为侧边栏添加 versions.html,但这没有效果:

html_sidebars = {
    '**': ['versions.html']
}
Run Code Online (Sandbox Code Playgroud)

还有如何在conf.py.

我看过sphinxcontrib-versioning但它并不完全是我正在寻找的。

python-sphinx read-the-docs

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

如何在 Markdown 文件中为 Sphinx 使用 automodule 或 autoclass?

我知道 Sphinx 支持 markdown 或 .md 文件(可选),这对我的补充文档非常有用。我想做的是在 Markdown 文件中使用autoclass或标签。automodule

通常,在一个.rst文件中,如果我这样做

.. autoclass:: my.module.SomeClass
    :members:
Run Code Online (Sandbox Code Playgroud)

它将自动提取所有文档字符串并创建文档。可以在.md文件中使用它吗?目前,当我尝试这样做时,生成的文档仅包含.. autoclass:...预期的内容。

我的conf.py

.. autoclass:: my.module.SomeClass
    :members:
Run Code Online (Sandbox Code Playgroud)

由于阅读文档的兼容性,我确实考虑了 mkdocs,但它不提供类似 autodoc 的功能。为了实现这一目标,我对任何其他库都非常开放(不必与 RTD 兼容)。

python python-sphinx autodoc read-the-docs

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

如何添加 bitbucket 文档以阅读文档

我有一个私人 bitbucket 存储库,其中包含:

/docs
/docs/source
/docs/Makefile
/docs/make.bat/
/docs/source/conf.py
/docs/source/index.rst
Run Code Online (Sandbox Code Playgroud)

我想将此文档添加到 readthedocs(我已在 bitbucket 中设置了挂钩),但是当它尝试构建时它说

Failed to get code from 'https://bitbucket.org/autokada/autokada.git' (git clone): 128
Run Code Online (Sandbox Code Playgroud)

有什么问题以及如何正确执行此操作?

此外,这一切都是手动完成的,将存储库添加到 redthedocs,尽管我已在 readthedocs 中将 bitbucket 添加到我的社交帐户,但当我尝试从 bitbucket 导入时,它说没有任何内容,当我尝试同步时,就会发生这种情况:

           .
     ":"
   ___:____     |"\/"|
 ,'        `.    \  /
 |  O        \___/  |
~^~^~^~^~^~^~^~^~^~^~^~^~

Fail.  Check back in a bit!
Run Code Online (Sandbox Code Playgroud)

bitbucket read-the-docs

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

readthedocs和setuptools scm版本错误

我有一个刚刚更新为使用 setuptools_scm 的包,发现 readthedocs 中的版本号是错误的。

http://sshuttle.readthedocs.org/en/v0.77/显示:

Version: 0.78.dev0+ng083293e.d20160304
Run Code Online (Sandbox Code Playgroud)

然而,由于版本 083293e 具有 0.77 标签,因此版本字符串应该只是 0.77

看起来 readthedocs 可能会在构建之前对我的源代码进行更改。

我查看了 readthedocs 构建日志,似乎在某个阶段具有正确的版本(0.77),但这是在构建文档之前。

Processing dependencies for sshuttle==0.77
Finished processing dependencies for sshuttle==0.77
Run Code Online (Sandbox Code Playgroud)

构建文档时构建日志不会提及版本。

有可能解决这个问题吗?

谢谢

setuptools read-the-docs setuptools-scm

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

readthedocs 中自动生成的索引文件

我无法将我为项目准备的文档上传到readthedocs,并且我正在尝试了解问题所在。该文档在本地构建得很好,make html但我无法上传它。

GitHub 项目是ASCIIGenome,文档位于docs/目录中(现在可能有更多的 readme.rst 和 index.rst 文件)。

因此,我登录阅读文档并按照他们的指示进行操作:

仪表板 ->导入项目->选择:https ://github.com/dariober/ASCIIGenome.git

然后对于 ASCIIGenome 项目我设置:

然后“build”->构建完成(通过)。

但是,一旦我访问http://asciigenome.readthedocs.io/en/latest/上的文档,我就会看到以下页面:

Welcome to Read the Docs
This is an autogenerated index file.

Please create a /home/docs/checkouts/readthedocs.org/user_builds/asciigenome/checkouts/latest/index.rst 

or /home/docs/checkouts/readthedocs.org/user_builds/asciigenome/checkouts/latest/README.rst file with your own content.

If you want to use another markup, choose a different builder in your settings.
Run Code Online (Sandbox Code Playgroud)

如果我点击该页面顶部的“在 GitHub 上编辑”链接,我会转到https://github.com/dariober/ASCIIGenome/blob//trunk//index.rst,在那里我发现了 404 …

svn github read-the-docs

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

阅读文档搜索已损坏

我正在尝试使用 Sphinx 结合阅读文档主题编写文档,但搜索功能似乎已损坏。

\n\n

我在 Windows 10 上运行 Python 3.7 以及最新版本的 Sphinx 和 Read the Docs 主题(均随 一起安装pip install)。在构建页面并在浏览器中打开 index.html 后(尝试过 Edge 和 Chrome),我无法搜索我的离线文档。搜索页面打开,但仅显示动画Search -> Search . -> Search .. -> Search \xe2\x80\xa6,如果我将主题更改回标准主题,搜索将不会出现任何问题。

\n\n

由于搜索适用于标准主题,它似乎不是与浏览器相关的问题,也似乎与我没有在本地主机上托管页面这一事实有关。

\n\n

如果我查看控制台中的错误,我会看到两个错误

\n\n
jquery.js:4 Failed to load file:///C:/user/documentation/_build/html/searchindex.js: \nCross origin requests are only supported for protocol \nschemes: http, data, chrome, chrome-extension, https.\n
Run Code Online (Sandbox Code Playgroud)\n\n

\n\n
searchtools.js:144 Uncaught ReferenceError: Stemmer is not defined\nat Object.query (searchtools.js:144)\nat Object.setIndex (searchtools.js:83)\nat searchindex.js:1\n
Run Code Online (Sandbox Code Playgroud)\n\n

我在网上搜索时找不到任何有用的东西来解决这个问题。还刷新浏览器缓存 ( ),如 …

python python-sphinx read-the-docs

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

Readthedocs 不显示文档字符串文档

我遵循 Readthedocs 上的入门指南,并使用 Sphinx 使用 autodoc 在https://github.com/akdiem/bloodflow上为我的 Python 包创建文档。(文档相关的 .rst 文件在 docs 文件夹中)

readthedoc 构建通过并在https://bloodflow.readthedocs.io/en/latest/上找到

Readthedocs 没有显示作为我代码一部分的任何 docstring 文档,但对我来说一切看起来都应该如此。为什么不呢?

python-sphinx autodoc read-the-docs

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

如何在 sphinx_rtd_theme 中将“查看页面源代码”替换为“在 GitHub 上编辑”链接?

使用sphinx_rtd_theme主题构建 Sphinx 网站时,如何View page source用链接替换文档页面顶部的超链接?Edit on GitHub

我正在使用 GitHub Pages手动构建类似readthedocs.io的网站,但所有文档页面右上角的链接仍然显示“查看页面源代码”而不是“在 GitHub 上编辑”。

主题的文档列出了一些相关选项(display_githubvcs_pageview_modegithub_url),但没有提供示例。我尝试将它们设置在根目录中conf.py,但html_theme_options没有成功。

如何告诉sphinx_rtd_theme主题将View page source链接更改为Edit on GitHub我所有文档页面上的链接?

github python-sphinx github-pages read-the-docs

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

如何修复“readthedocs”上的错误“重复构建”?

readthecods上,我尝试构建一个项目,但收到错误

Error
Duplicated build.
Run Code Online (Sandbox Code Playgroud)

如何解决这个问题?

read-the-docs

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

Python 代码块不使用 readthedocs 和 sphinx 进行渲染

我正在使用 Sphinx 为 python 项目构建文档并阅读文档。由于某种原因,代码块在构建文档后不会呈现,并且内联代码(用反引号标记)显示为斜体。我检查了原始版本,有一个警告,指出无法找到 exomagpy 模块,我通过将 conf.py 的 os.path.abspath() 部分中的“..”更改为“../”来解决该问题,这似乎没有改变文档中的任何内容。stackoverflow上有一个类似的问题,我尝试了解决方案,但它没有改变。

原始版本可以在这里找到:https ://readthedocs.org/api/v2/build/17574729.txt

这些文档是从 github 页面的“开发”分支构建的(链接如下)

以下是 github 页面的链接:https://github.com/quasoph/exomagpy/tree/Develop

回购协议的结构如下:

>.vscode
>build/lib/exomagpy

>docs
   >conf.py
   >rst files (.rst)
   >makefile
   >make.bat

>exomagpy.egg-info

>exomagpy
   >__init__.py
   >module files (.py)

>.readthedocs.yml
>requirements.txt
>setup.py
Run Code Online (Sandbox Code Playgroud)

这是我的文件:

.conf.py

import os
import sys
sys.path.insert(0, os.path.abspath("../"))

# project info

project = "exomagpy"
root_doc = "index"
release = "1.3.0"

# general config

extensions = ["sphinx.ext.autodoc","sphinx.ext.napoleon","sphinx.ext.autosummary"
]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# html options …
Run Code Online (Sandbox Code Playgroud)

python documentation python-sphinx read-the-docs

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