使用sphinx生成c ++文档

时间:2017-07-19 07:31:14

标签: python c++ documentation python-sphinx

我正在开发一个python和C ++项目,并希望生成一个全局的html文档。对于python部分,我已经设置了sphinx来生成文档。这就像一个魅力。

但现在有了C ++部分。 首先我通过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更改为:

.. Test documentation master file, created by
   sphinx-quickstart on Wed Jul 19 09:18:10 2017.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to Test's documentation!
================================

.. toctree::
   :maxdepth: 2
   :caption: Contents:

.. doxygenclass:: MyClass
   :members:



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

但是当我现在运行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

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

0 个答案:

没有答案