Sphinx和从C ++ api编写文档的python文档

问题描述:

我基本上是在问同样的问题:

I'm basically asking the same question as this: Is there a good way to produce documentation for swig interfaces?

但是,那是一个两岁的孩子,现在有了狮身人面像。

However, that one was like two years old and now there is sphinx.

问题是,sphinx可以从swig产生的python代码中自动获取某些信息,还是需要手动重新输入 C ++中的文档代码?

Question is, can sphinx automatically get something out from the python code that swig produces, or does one need to manually 're-enter' the documentation that is in the C++ code?

SWIG尚不支持从C ++头文件中的注释中提取类/方法/函数文档。您可以得到的最接近的是%feature( autodoc,level)%feature( docstring)如SWIG文档的 36.10文档字符串功能所述。似乎在代码2012年夏季 ,但此后似乎还没有进一步的工作。

SWIG does not yet support extracting class/method/function documentation from comments in C++ header files. The closest you can get is the %feature("autodoc", level) and %feature("docstring") as explained in section 36.10 Docstring Features of SWIG docs. It looks as though some work on extending SWIG to recognize Doxygen tags to generate javadoc and python docstrings occurred as part of "Summer of Code 2012", but it doesn't look like there has been any further work on it since.