在 PyCharm 中工作时,我在 Sphinx 中创建的文档的预览模式显示:
System Message: ERROR/3 (<stdin>, line 9)
Unknown directive type "toctree".
..toctree::
:maxdepth: 2
file1
file2
我已经包括了autodoc
我的 conf.py 文件中的扩展名。当我打开 /build/index.html 文件时,它工作正常。因此,我的问题是:如何从 PyCharm 预览模式中删除此错误,以便我可以预览文档而不必一直打开 /build/index.html 文件?
Sphinx 构建在 Docutils 库之上。这toctree
指令适用于 Sphinx,但 Docutils 无法识别。
PyCharm 预览器不使用 Sphinx(对于免费社区版和截至 2019 年的专业版来说都是如此);它可能使用rst2html.py http://docutils.sourceforge.net/docs/user/tools.html#rst2html-py来自Docutils。
这个邮件列表线程也有同样的错误:https://web.archive.org/web/20180715103227/https://mail.python.org/pipermail/python-list/2008-June/493826.html https://web.archive.org/web/20180715103227/https://mail.python.org/pipermail/python-list/2008-June/493826.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)