【发布时间】:2019-04-07 09:58:00
【问题描述】:
在 PyCharm 中工作时,我在 Sphinx 中创建的文档的预览模式显示:
System Message: ERROR/3 (<stdin>, line 9) Unknown directive type "toctree". ..toctree:: :maxdepth: 2 file1 file2
我在我的 conf.py 文件中包含了 autodoc 扩展名。当我打开 /build/index.html 文件时,它工作正常。因此,我的问题是:如何从 PyCharm 预览模式中删除此错误,以便无需一直打开 /build/index.html 文件即可预览文档?
【问题讨论】:
-
Sphinx 构建在 Docutils 库之上。
toctree指令适用于 Sphinx,但不仅仅适用于 Docutils。 PyCharm 预览器不使用 Sphinx;它可能使用 Docutils rst2html.py 工具。见grokbase.com/t/python/python-list/086kaqv52v/…。 -
@mzjn 谢谢,遇到了类似的问题,后来发现社区版没有这个功能。
标签: pycharm python-sphinx preview autodoc toctree