]> git.donarmstrong.com Git - lilypond.git/commitdiff
lys-to-tely: If a .i?te(ly|xi) file is passed to the script, include it
authorReinhold Kainhofer <reinhold@kainhofer.com>
Sun, 16 Nov 2008 15:03:58 +0000 (16:03 +0100)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Sun, 16 Nov 2008 17:16:12 +0000 (18:16 +0100)
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).

buildscripts/lys-to-tely.py

index e74c7145034e26f715bb73dfb04da015aef57c39..96539a27fcaa353471274b0339325ef0d7e2b894 100755 (executable)
@@ -12,6 +12,7 @@ TODO:
 import sys
 import os
 import getopt
+import re
 
 program_name = 'lys-to-tely'
 
@@ -85,8 +86,15 @@ for opt in options:
     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>