问题标签 [toctree]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
73 浏览

latex - 如何在 HTML 和 LaTeX 中使用不同的 master_docs?

由于toctree构建器处理索引和标题的方式存在差异,我想为我的 Sphinx 文档的 HTML 和 LaTeX 构建使用不同的“主”文档。

以下几乎可以工作:

…但由于它修改了配置,每次我从 HTML 切换到 LaTeX 时都会导致完全重建,反之亦然。

我还尝试使用以下索引only::

…但这会导致许多问题,包括重复的目录条目,因为这两个文档都被解析和索引。

为我的 LaTeX 和 HTML 构建使用不同的主文档的正确方法是什么?

0 投票
1 回答
601 浏览

python-sphinx - 如何使用 Sphinx 链接本地 Python 帮助文档

如何让我的 Sphinx RST 文件包含指向“contents.html”Python 帮助页面的链接?

更多细节

我在离线环境中有一个 RST 帮助文档 ( index.rst )。我已经下载并使用命令成功构建了 Python 文档make.bat html。然后我将此文档复制到 C:\Temp\PyDoc。

然后我更新了我的 conf.py 文件以包含以下 Intersphinx 映射:

然后,在我的index.rst文件中,我有类似的内容:

Python链接已从生成的文档中删除,并带有警告消息:

警告:toctree 包含对不存在文档 ':ref:`Python <python:contents>` 的引用

我已验证输出包含以下文本:

从 C:/Temp/PyDoc/objects.inv 加载 intersphinx 库存...

我还通过运行验证了 Python 文档中存在“内容”标签:

生成包含以下行的输出:

内容 Python 文档内容:contents.html

有谁知道如何从我的 RST 文件中引用这个外部文档?

0 投票
1 回答
888 浏览

python-sphinx - 狮身人面像雪花石膏主题目录未显示在所有页面中

我试图让 TOC 出现在我的所有页面中。我的设置非常简单。在 index.rst 中,我有

在其他页面中,我有:

为了让 TOC 出现,我改为conf.py反映:

但这样做时,index.rst任何 TOC 中都不会出现任何嵌套内容。这是它的截图:

伊姆古尔

如何从雪花石膏中获取原始/正常 TOC 以显示在我的所有页面中?

0 投票
1 回答
2361 浏览

python-sphinx - Sphinx toctree 包含对不存在文档的引用

我对斯芬克斯很陌生。Doc 说它很容易设置 - 也许是这样,但我有时间。我终于创建了 .rst 文件,但是当我更新了 index.rst 时,我收到了这个错误。我确认 .rst 文件存在于 /docs 目录中。以下是我的 conf.py 和索引中的系统路径。

我已经尝试了所有这些组合但没有成功 - .rst 文件位于 /home/efultz/src/Sicom2.0/docs

我在 index.rst 中有以下内容 - 我已经确认在各个文件名之前只有 3 个空格

0 投票
0 回答
1438 浏览

python-sphinx - 带有自动模块的 Sphinx 目录树

我有要记录的模块,以便目录位于主页上index,而文档本身位于单独的页面中。我是自动文档和 Sphinx 的新手,但我已经接近了:

使用的原因noindex是得到重复的对象描述错误。但是,这会阻止模块出现toctreeindex. 如何避免这种情况?这似乎是一件基本的事情,但我无法理解它。任何帮助将不胜感激!

似乎这个问题及其答案试图解决类似的问题,但我认为它并不完全相同,因为 OP 对答案发表了评论。

0 投票
0 回答
306 浏览

python - 无法在 Python Sphinx html 输出中创建侧边栏?

我正在使用 Sphinx 工具记录我的 Python 项目,我的 HTML 输出当前如下所示:

如您所见,工具栏的“导航”标题下没有任何内容。当我将以下代码添加到我的conf.py文件中时,HTML 工具栏保持不变(导航下没有任何内容):

我必须自己创建一些文件还是我做错了什么?

我的目标是让 HTML 看起来像这样:

我认为这与将徽标添加到我也无法创建的 HTML 是相同的问题。

这些是index.rst我的 Sphinx 项目中文件的内容:

0 投票
2 回答
446 浏览

python - Toctree 激活侧边栏上的当前页面和主页

de上没有问题,index.rst如下所示:

Sphinx RTD 文档主页

但是,当我转到另一个页面时,在我的情况下是annotation-module.rst,侧边栏会选择并同时显示indexannotation-module,如下所示:

Sphinx RTD 侧边栏显示两个菜单

但是,我只想激活注释模块页面并显示其子部分。

conf.py唯一的用途html_theme是通过查找READTHEDOCS如下环境变量:

我的index.rst

annotation-module.rst甚至不包括任何,我toctree只有它下面的部分。

那么,如何仅激活侧边栏上的当前文档部分?

Steve Piercy要求的文档源目录。


环境

  • 蟒蛇 3.5
  • 狮身人面像 1.7.6
  • 狮身人面像 rtd 主题 0.4.0
0 投票
1 回答
175 浏览

directory - Sphinx Documentation with different separated subjects

I'm trying to build kind of a dashboard in the index with one tile per subject. Each subject will later have its own folder in source with it's own md files.

I want each subject to be disconnected to the others. So the previous button should no go to another subject.

The structure should be something like this: enter image description here First there is an overview with all subjects, then there is a subpage with one toctree per subject and then each document has its own normal view.

Does anyone have an idea how I would go about it?

Currently I build the index like that, but this doesn't separate the files:

0 投票
1 回答
295 浏览

python-sphinx - Prevent sphinx from restarting section numbering every file

I've got my index file set up like so:

If the contents are thus...

01_file1.txt:

and for 01.3_file2.txt:

I would expect this because Sphinx treats everything as a single document:

But instead I get this:

I'm guessing this is because Sphinx (or maybe reST/Markdown?) restarts implicit heading levels with each new text file. Is there a way to get what I actually want?

Quoting the reST documentation...

Rather than imposing a fixed number and order of section title adornment styles, the order enforced will be the order as encountered. The first style encountered will be an outermost title (like HTML H1), the second style will be a subtitle, the third will be a subsubtitle, and so on.

0 投票
1 回答
8114 浏览

pycharm - 未知指令类型“toctree”。Pycharm 中的错误,但 index.html 有效

在 PyCharm 中工作时,我在 Sphinx 中创建的文档的预览模式显示:

我已将autodoc扩展名包含在我的 conf.py 文件中。当我打开 /build/index.html 文件时,它工作正常。因此,我的问题是:如何从 PyCharm 预览模式中删除此错误,以便无需一直打开 /build/index.html 文件即可预览文档?