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.
To put Demo
class into new_package
namespace if it is defined in new_package.temp
module:
new_package/
├── __init__.py
│ # from .temp import Demo
└── temp.py
# class Demo:
# pass
In this case doxygen would need just to reflect the relation that is already in the code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With