Description
I'm opening this issue to start the discussion on documentations syntax. I think that there are three kinds of documentation:
- in depth documentation, contained in READMEs, Markdown files etc.
- annotated usage examples
- API documentation, describing the interface of each public function
Of the above list, the first two items are already in place. As per the API documentation, I see two possible ways to embed it into source files:
- Special purpose comments. This is the style adopted by Java, where you have a block commend annotating an element with the relevant documentation.
- Docstrings. The Lisp/Python way. Definitions embed a string of documentation.
In my opinion, the first approach is better in our case, since it will allow to annotate registerOption
invocations, so to document options defined modules.
Lilypond already has block comments, delimited by %{ %}
. I propose to use marked block comments for documentation:
%{
This is a normal block comment
%}
%{!
This is a *documentation* comment.
- it may be in Markdown
- so we have nice formatting both in source code and in html
%}
someDefinition =
Notice the !
in the documentation comment to distinguish it from a normal block comment.
I am working on the implementation of a parser with python-ly
to parse such comments. I should have a preliminary version ready for the week-end. However, I'd like to know your ideas about the documentation syntax.