|
From: | Tom Cloyd |
Subject: | Re: "Harvesting" comments from music sources |
Date: | Sat, 19 May 2012 11:08:07 -0600 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 |
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. 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 address@hidden (435) 272-3332 St. George/Cedar City, Utah On 05/19/2012 04:29 AM, Urs Liska wrote: Hi list, |
[Prev in Thread] | Current Thread | [Next in Thread] |