I like Doxygen to create documentation of C or PHP code. I have an upcoming Python project and I think I remember that Python doesn’t have /* .. */ comments, and also has its own self-documentation facility which seems to be the pythonic way to document.
Since I’m familiar with Doxygen, how can I use it to produce my Python documentation? Is there anything in particular that I need to be aware of?
This is documented on the doxygen website, but to summarize here:
You can use doxygen to document your Python code. You can either use the Python documentation string syntax:
In which case the comments will be extracted by doxygen, but you won’t be able to use any of the special doxygen commands.
Or you can (similar to C-style languages under doxygen) double up the comment marker (
#) on the first line before the member:In that case, you can use the special doxygen commands. There’s no particular Python output mode, but you can apparently improve the results by setting
OPTMIZE_OUTPUT_JAVAtoYES.Honestly, I’m a little surprised at the difference – it seems like once doxygen can detect the comments in ## blocks or ”’ blocks, most of the work would be done and you’d be able to use the special commands in either case. Maybe they expect people using ”’ to adhere to more Pythonic documentation practices and that would interfere with the special doxygen commands?