Sphinx and documenting python from a swigged C++ api [duplicate]

China☆狼群 提交于 2019-12-23 04:03:25

问题


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.

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?


回答1:


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.



来源:https://stackoverflow.com/questions/24836000/sphinx-and-documenting-python-from-a-swigged-c-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!