PYBIND11_MODULE(python_example, m) { m.doc() = R"pbdoc( Pybind11 example plugin ----------------------- .. currentmodule:: python_example .. autosummary:: :toctree: _generate add subtract )pbdoc"; m.def("add", &add, R"pbdoc( Add two numbers Some other explanation about the add function. )pbdoc"); m.def("subtract", [](int i, int j) { return i - j; }, R"pbdoc( Subtract two numbers Some other explanation about the subtract function. )pbdoc");
比如说我有这么一段代码,如何用 Sphinx 为python_example
模块和它下面的函数生成 api 文档?我尝试过直接 make https://github.com/pybind/python_example 仓库的文档,但是生成的文档并没有包含这些内容。所以请教一下各位大佬如何处理这种情况。
1 l1xnan 2023-11-03 14:51:00 +08:00 |