了解命名空间文档
我正在努力理解 doxygen 如何与 Python 中的命名空间一起工作。默认情况下会生成名称为“filename”的命名空间,即 temp.py
。我还可以使用 \package
或 \namespace
命令声明新的命名空间。
但是,我不明白的是为什么下面的类(或任何其他定义)总是出现在 temp
命名空间下?
请帮助我了解命名空间命令在 doxygen 中的工作原理。
如果您知道 doxygen 中如何以及为何使用 /namespace pr /package 命令,您可以绕过下面的示例并直接回答。
#filename = temp.py
##\mainpage Main Page Title
#\brief main page title comments \n
## class class_demo1 \n
# the class declared below \n
class class_demo1:
pass
from new_package import *
现在,我添加了一个名为 \new_package 的新命名空间,添加在 temp.py 文件中,
##\package new_package
#new namespace comments \n
我还创建了一个名为 \new_package.py 的文件,并在其中添加了以下行:
def demo_fun:
pass
class demo_class:
pass
在生成的文档中,我在命名空间 \temp 下得到 \class_demo1。 但是,新的命名空间 \new_package.py 不显示在下面声明的类和 def 它。
I am struggling to understand how doxygen works with namespaces in Python. A namespace of the name "filename" i.e. temp.py
, is generated by default. I can also declare new namespaces with the \package
or \namespace
command.
However, what I don't understand is why the class below (or any other definition) always appears under the temp
namespace?
Please help me understand how the namespace command works in doxygen.
If you know how and why /namespace pr /package commands are used in doxygen, you can bypass the example below and directly answer it.
#filename = temp.py
##\mainpage Main Page Title
#\brief main page title comments \n
## class class_demo1 \n
# the class declared below \n
class class_demo1:
pass
from new_package import *
Now, I am adding a new namespace by the name \new_package , added to the temp.py file
##\package new_package
#new namespace comments \n
I have also created a file named \new_package.py and added the below lines in it:
def demo_fun:
pass
class demo_class:
pass
In the generated documentation, I get \class_demo1 under namespace \temp.
However, the new namespace \new_package.py doesn't display the class and def declared under
it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果在
new_package.temp
模块中定义了Demo
类,则将它放入new_package
命名空间中:在这种情况下,doxygen 只需要反映以下关系:已经在代码中了。
To put
Demo
class intonew_package
namespace if it is defined innew_package.temp
module:In this case doxygen would need just to reflect the relation that is already in the code.