有没有人知道如何自动生成我声明的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")发布于 2012-02-22 00:30:45
您可以使用sphinx。你需要对其进行一些修改,使函数的参数列表更漂亮,例如,参见我为minieigen所做的:boost::python source,sphinx config file和generated docs。
对于类似但更复杂的内容,可以看看Yade。
发布于 2016-08-11 03:57:31
使用Sphinx,事实上的Python文档生成器。不需要修改Sphinx。
Sphinx从文档字符串中提取文档,因此添加文档字符串来记录您的Boost Python模块。像往常一样把它编译成一个共享对象(.so文件)。
为每个模块创建一个.rst文件。例如,为模块demo.foo创建demo.foo.rst
.. automodule:: demo.foo
:members:
:undoc-members:
:show-inheritance:然后,设置并运行Sphinx,它将为您创建各种格式的文档。
https://stackoverflow.com/questions/9375175
复制相似问题