Hi,
I have tried to write a tool in Python to (re-)indent lilypond source
files. Something like indent ( for C/C++ ) or tidy ( for HTML ) but now
with Lilypond in mind.
The tool can handle multiple inputfiles, and there is a commandline option
that lets you specify how much spacecharacters to use for indentation,
or to use TAB characters for that (= default behaviour).
First I tried to make it do a complete re-formatting of the input files
(like indent and tidy can), changing newlines and empty lines and all
that. But I abandoned that idea, to give the user more freedom to use and
keep his/her own personal lilypond coding style, and to make things easier
for me :-)
I think it does a nice job, but comments are welcome.
You get it here:
http://www.home.zonnet.nl/m.tarenskeen/tmp/indent-ly
Known bugs:
I don't know if lilypond allows this, but indent-ly does not like
something like:
\relative c' { c d e f | %{ a strange comment block {{{ in << << the middle of
a line %} g a b c |
}
So please don't use such constructs ;-)
--
Martin Tarenskeen
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user