Sphinx和从C ++ api编写文档的python文档 [英] Sphinx and documenting python from a swigged C++ api

查看:97
本文介绍了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.

这篇关于Sphinx和从C ++ api编写文档的python文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆