ldoc
ldoc copied to clipboard
Python Support
I love the simplicity of LDoc. I currently use Doxygen for my Python projects, but was wondering how difficult it would be to add Python support to LDoc. I think I would prefer to use it over Doxygen in cases where I just want some quick & simple documentation.
Documenting with Doxygen in Python is as follows:
The docstring begins with a double hashtag (##), followed by multiple lines of description. tags/directives are determined by either a backslash ( \ ) or an 'at' symbol (@). I'm not sure what all tags are supported, but it uses param & return like LDoc does. I believe that tag descriptions can be on the same line, but don't remember for sure.
## Description.
#
# @param parameter1
# Parameter 1 description.
# @param parameter2 Parameter 2 description.
# @return
# Return description.
Multiline comments in Python use three double or single quotation marks. I haven't used this method for documenting my code so I am not 100% sure how it works. But I believe an exclamation is added to delimit a docstring for Doxygen:
'''! Description
@ param parameter1
Parameter 1 description.
@ param parameter2 Parameter 2 description.
@ return
Return description.
'''
Just judging by the looks of the way Python docstrings are formatted, it doesn't seem like adding Python support in LDoc would be too difficult. But then again, I don't know how LDoc works.
Yeah, those are pretty sane patterns. LDoc does a little bit of code parsing, nothing heavy. It's not a technical problem but I'm worried that the project will start to lose focus and get overambitious. But, I like compliments and interesting challenges ;)
This is not currently planned. That doesn't mean a contribution would be refused if somebody found a nice way to implement it and submitted a PR, but as the current maintainer I have no plans to try to bring this to Python.