简体   繁体   中英

How to make doxygen ignore the first line of a Python script?

I have a docstring in the beginning of a Python script that Doxygen parses perfectly. However, if I add #!/usr/bin/env python in the beginning of the file (to make the script executable), the entire docstring is not recognized by Doxygen.

So, how can I make Doxygen ignore this first line?

Example of a working docstring:

"""@package HelloWorld
This is a docstring and it's recognized by doxygen."""

Example of a non-working docstring:

#!/usr/bin/env python
"""@package HelloWorld
This is a docstring and it's not recognized by doxygen because of the first line."""

Thanks!

Ok, I found it: I need to use a parser first. I tried doxypy and it works really well. You only have to make the following changes in your doxy_conf file:

FILTER_SOURCE_FILES = YES
INPUT_FILTER = "python path/to/doxypy.py"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM