lsy-to-tely simply creates one texinfo page from a list of snippets. If
one wants to insert some texinfo code in between some snippets,
that's currently not really possible (only as texidoc header field of
some dummy snippet, that will create an empty image and display the
dummy file name). This patch allows *.i?te(ly|xi) files to be passed
to lys-to-tely, too, which will simply be include via
@include ${filename}
in the .tely file. All other files are still treated as lilypond snippets
with no difference to the current state.
lys-to-tely will use the same order of files as passed on the command line,
so by sorting the file names appropriately, one can now insert
arbitrary texinfo code somewhere in between some snippets (or at beginning
or end of the file).
import sys
import os
import getopt
+import re
program_name = 'lys-to-tely'
else:
raise Exception ('unknown option: ' + o)
+texi_file_re = re.compile ('.*\.i?te(ly|xi)$')
+
def name2line (n):
- s = r"""
+ if texi_file_re.match (n):
+ # We have a texi include file, simply include it:
+ s = r"@include %s" % os.path.basename (n)
+ else:
+ # Assume it's a lilypond file -> create image etc.
+ s = r"""
@ifhtml
@html
<a name="%s"></a>