Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding namespace documentation

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.

like image 426
Ani Avatar asked Feb 03 '12 07:02

Ani


1 Answers

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.

like image 119
jfs Avatar answered Oct 12 '22 22:10

jfs