From: Reinhold Kainhofer Date: Sun, 16 Nov 2008 15:03:58 +0000 (+0100) Subject: lys-to-tely: If a .i?te(ly|xi) file is passed to the script, include it X-Git-Tag: release/2.11.64-1~4 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=303dabf513faaa6364150da8e159a4e997437d95;p=lilypond.git lys-to-tely: If a .i?te(ly|xi) file is passed to the script, include it 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). --- diff --git a/buildscripts/lys-to-tely.py b/buildscripts/lys-to-tely.py index e74c714503..96539a27fc 100755 --- a/buildscripts/lys-to-tely.py +++ b/buildscripts/lys-to-tely.py @@ -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