doxygen-> doxy2swig-> PDOC导致重复的类docstrings
我有一个C ++标头文件(.H),该文件(通过SWIG)为我生成一个Python模块。我的目标是在生成的.py文件中包含来自.h文件的doxygen文档,但是由于我目前无法使用通过SWIG支持这一点的最新SWIG(V4+),所以我使用doxygen和doxy2swig来实现这一目标。
我的过程如下:
- 在.h文件上运行doxygen以生成xml输出
- 在xml输出上运行doxy2swig,以生成一个带有%docString insertion
- 更新我的project my project my file
- swig on。 生成的。
- 包括在生成的.py文件上运行pdoc的
doxy2swig ,导致重复的描述。
我正在寻找一种做以下方法之一的方法:
- 强制doxy2swig仅在类或_ init
- 强制pdoc忽略类或
__ init __ init __ init __
我已经尝试过的情况查看:
__ PDOC __ [class .__ Int __]
= false。这是行不通的,即使这样做也意味着将我所有的课程添加到此范围内。- 手动修改了Doxy2swig生成的.i文件以将DOCSTRING附加到类。 init 而不是类。这是一种无效的格式。
- 找不到任何可以帮助我的PDOC或doxy2swig参数 - 希望与我认为存在的类似的sphinx选项相似,这些选项将类文档排除在生成的文档中,或者排除
__ INT __ INT __ INT __ INT __ INT __
的内容。医生。
I have a C++ header file (.h) that (through swig) I generate a python module for. My goal is to include the Doxygen documentation from the .h file in the generated .py file, but since I am currently unable to use the latest swig (v4+) that supports this through swig, I am using Doxygen and doxy2swig to accomplish this.
My process is as follows:
- run Doxygen on .h file to generate xml output
- run doxy2swig on xml output to generate a .i file with %docstring insertion
- update my project's .i file
- run swig on .h file (with a .i file that includes the doxy2swig generated .i file)
- run pdoc on generated .py file to generate interface documentation
I've found that doxy2swig inserts docstrings in both the class and __init__
docstrings, and pdoc concatenates these in the generated documentation, resulting in duplicate descriptions.
I am looking for a way to do one of the following:
- force doxy2swig to only insert docstrings in class OR _init
- force pdoc to ignore class or
__init__
This I have tried/looked into:
__pdoc__[class.__init__]
= False. This didn't work, and even if it did it would mean adding all of my classes to this dict.- manually modified the doxy2swig generated .i file to append docstring to class.init instead of class. This was an invalid format.
- Couldn't find any pdoc or doxy2swig arguments that would help me with this - was hoping for something similar to the sphinx options that I believe exist for excluding class documentation from generated docs, or something to exclude the
__init__
doctoring.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以修改 pdoc的html html template 为了。以下是自定义
module.html.jinja2
的一些示例:__ __ INT __ INT __
:hide class-level docstrings:hide
__ INT __ INT __ INT __ INT __ INT __
完全:完全:
You can modify pdoc's HTML template to accomplish what you are looking for. Here are some examples for a custom
module.html.jinja2
:Hide docstrings for
__init__
:Hide class-level docstrings:
Hide
__init__
entirely: