使用sphinx生成c++文档

2024-09-30 10:36:18 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在研究Python和C++项目,并希望生成一个全局HTML文档。对于python部分,我已经设置了sphinx来生成文档。这很有魅力。在

<>但现在出现了C++部分。 首先,我安装了breathe through pip并遵循了quick start guide。在

<>为了使测试更容易,我只用一个类创建了简单的C++项目。 我还用doxygen创建了所需的xml文件。在

现在我希望sphinx生成文档。我发出了sphinx-quickstart,所有的都是默认的。之后,我在conf.py文件中添加了以下行:

extensions = ['breathe']
# -- Options for Breathe
breathe_projects = { "test": "/home/ubuntu/Downloads/testDocu/xml" }
breathe_default_project = "test"

我还将index.rst改为如下所示:

^{pr2}$

但是当我现在运行make html时,我得到了以下错误消息:

Exception occurred:   File "/usr/lib/python2.7/dist-packages/docutils/transforms/universal.py", line 290, in apply
    txtnode.parent.replace(txtnode, nodes.Text(newtext)) AttributeError: 'NoneType' object has no attribute 'replace' The full traceback has been saved in /tmp/sphinx-err-fLAGKW.log, if you want to report the issue to the developers. Please also report this if it was a user error, so that a better error message can be provided next time. A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks! make: *** [html] Error 1

这是一个已知错误还是我做错了什么?在


Tags: 文件the项目in文档pytestreport

热门问题