开发者

Doxygen using python not extracting method descriptions for files

开发者 https://www.devze.com 2023-04-02 07:48 出处:网络
I am documenting a python project using doxygen. I created my config file, and set the In and out Directory, but that is all I really did. When I generate the documentation it extracts the class and c

I am documenting a python project using doxygen. I created my config file, and set the In and out Directory, but that is all I really did. When I generate the documentation it extracts the class and class hierarchy, but fo开发者_如何学Gor my modules with functions it does not.

As in, I have a .py file that has a main and a set of functions which I have documented in the correct comment syntax, but these functions are not represented in the documentation whatsoever. Why is this?


With a default doxygen configuration, module-level functions are only documented if the file or module they are in are also documented. For example:

##
# My function
#
def func():
    pass

Will not be documented unless the file is documented:

##
# @file
# File documentation
#

Or the module is documented:

##
# @package MyModule Module documentation
#

For more information on documenting Python code in Doxygen, see http://www.doxygen.nl/manual/docblocks.html#pythonblocks.


Contrary to the official documentation, "special commands" are supported in docstrings. To do this the docstring must start with """!

Example:

def area(l, w):
    """! Calculate the area in sqm

    @param l length 
    @param w width
    @return area 

    @todo throw error if l<0 or w<0
    """
    return l*w
0

精彩评论

暂无评论...
验证码 换一张
取 消