input_filename = ""
glob_input = ""
template = '''\input texinfo
+
+@c This file was autogenerated
+@c from: %s
+@c by: %s
+
@setfilename %%(name)s.info
@settitle %%(title)s
@finalout @c we do not want black boxes.
+@c Trick to use with proper font mappings the same NCSB fonts as
+@c LilyPond instead of those provided by TeX distribution
+@tex
+\\ifpdf
+ \\pdfmapfile{=lilypond.map}
+\\fi
+@end tex
+
@c fool ls-latex
@ignore
@author %%(author)s
%s
@bye
-''' % include_snippets
+''' % (", ".join(files), sys.argv[0], include_snippets)
for opt in options:
o = opt[0]
else:
raise Exception ('unknown option: ' + o)
-texi_file_re = re.compile ('.*\.i?te(ly|xi)$')
-html_file_re = re.compile ('.*\.i?htm(l)?$')
-xml_file_re = re.compile ('.*\.i?(xm|mx)l$')
-tex_file_re = re.compile ('.*\.i?(la)?tex$')
+html_file_re = re.compile ('.*\.i?html?$')
+info_file_re = re.compile ('.*\.info$')
pdf_file_re = re.compile ('.*\.i?pdf$')
+tex_file_re = re.compile ('.*\.i?(la)?tex$')
+texi_file_re = re.compile ('.*\.i?te(ly|xi|xinfo)$')
+xml_file_re = re.compile ('.*\.i?(xm|mx)l$')
def name2line (n):
if texi_file_re.match (n):
# We have a texi include file, simply include it:
s = r"@include %s" % os.path.basename (n)
- elif (html_file_re.match (n) or pdf_file_re.match (n) or
- tex_file_re.match (n)):
+ elif (html_file_re.match (n) or info_file_re.match (n)
+ or pdf_file_re.match (n) or tex_file_re.match (n)):
s = r"""
@ifhtml
@html
s = "\n".join (map (name2line, files))
s = template.replace (include_snippets, s, 1)
f = "%s/%s" % (dir, name)
- sys.stderr.write ("%s: writing %s..." % (program_name, f))
h = open (f, "w")
h.write (s)
h.close ()
- sys.stderr.write ('\n')
else:
# not Unix philosophy, but hey, at least we notice when
# we don't distribute any .ly files.
- sys.stderr.write ("No files specified. Doing nothing")
+ sys.stderr.write ("No files specified. Doing nothing. Use -h to display usage.")