Urs,
I'm not much of a programmer, but to me this seems to be both a good
idea and an easy one to implement. Here's how I'd do it, since [a] I
don't program in Scheme at all, and [b] I do have some skills in Ruby:
1. Insert all comments in the source with a leading "%|". The second
character is arbitrary, and is merely there to indicate that what
follows is a documentation comment. Inserting the comment text is easy
if one is using a programming text editor such as jEdit, which has the
ability to do columnwise selections and insertions - you write the
entire comment, THEN insert the leading "%|". Quite painless.
2. Format the comments, if desired, using some simple markup logic like
Markdown <http://daringfireball.net/projects/markdown/>.
3. Write a simple text processing routine (I'd do it in Ruby), to be
invoked when you wished to generate a new documentation file. It would
read every line of the Lilypond source file, ignoring all but those
which begin with the documentation text flag string - "%|", or whatever.
It strips the flag string, and outputs the remainder of the line to a
temporary text file, which is then processed by some routine that can
process Markdown files. In the Ruby world, that would be the Bluecloth gem.
Hope this helps...
t.
~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA
t...@tomcloyd.com
(435) 272-3332
St. George/Cedar City, Utah
On 05/19/2012 04:29 AM, Urs Liska wrote:
Hi list,
any ideas/experience on parsing lilypond input files for special
comments and produce some documentation from it?
I would love to write editorial comments directly in the lilypond source.
Some script could then read these from the source and produce html or
OpenDocumentText or some latex input file.
What could be a practical approach or language for this?
Are there solutions to build upon?
Best
Urs
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user