From 303dabf513faaa6364150da8e159a4e997437d95 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Sun, 16 Nov 2008 16:03:58 +0100 Subject: [PATCH] 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). --- buildscripts/lys-to-tely.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.39.2