C++ 生成boostpython引用

C++ 生成boostpython引用,c++,python,boost,documentation,boost-python,C++,Python,Boost,Documentation,Boost Python,有人知道如何自动生成我声明的boost python方法的引用吗: def("foo", foo, args("x", "y"), "foo's docstring") def("foo2", foo, args("x", "y"), "foo's docstring") def("foo3", foo, args("x", "y"), "foo's docstring") def("foo4", foo, args("x", "y"), "foo's docstring") 你可以用

有人知道如何自动生成我声明的boost python方法的引用吗:

 def("foo", foo, args("x", "y"), "foo's docstring")
 def("foo2", foo, args("x", "y"), "foo's docstring")
 def("foo3", foo, args("x", "y"), "foo's docstring")
 def("foo4", foo, args("x", "y"), "foo's docstring")
你可以用。您需要对其进行一些修改,以使函数参数列表更漂亮,例如,请参见我所做的:,和

有关类似但更复杂的内容,请查看。

使用事实上的Python文档生成器。没有必要修改斯芬克斯

Sphinx从docstrings中提取文档,因此将docstrings添加到boostPython模块的文档中。像往常一样将其编译为共享对象(
.so
文件)

为每个模块创建一个
.rst
文件。例如,为模块
demo.foo
创建
demo.foo.rst

.. automodule:: demo.foo
    :members:
    :undoc-members:
    :show-inheritance:
然后,设置并运行Sphinx,它将为您提供各种格式的文档