+2003-03-22 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ * scripts/lilypond-book.py (make_lilypond_file): convert
+ lilypond-file to lilypond block directly, without going through
+ begin/end lilypond text.
+
2003-03-21 Juergen Reuter <reuter@ipd.uka.de>
""")
for m in charmetrics:
escapedname=re.sub('_','\\\\\\\\_', m['name'])
- file.write ('s^\\markup { \\musicglyph #"%s" "%s" }\n' % (m['name'], escapedname))
+ file.write (' s^\\markup { \\char #%d "%s" }\n' % (m['code'], escapedname))
file.write (r"""
}
\paper{
'html' : {
- 'output-lilypond': '''<lilypond%s>
-%s
-</lilypond>''',
'output-filename' : r'''
<!-- %s >
<a href="%s">
%% %s
%% %s
''',
- 'output-lilypond': r'''\begin[%s]{lilypond}
-%s
-\end{lilypond}
-''',
+
# verbatim text is always finished with \n
'output-verbatim': r'''\begin{verbatim}
%s\end{verbatim}
'texi' : {
- 'output-lilypond': '''@lilypond[%s]
-%s
-@end lilypond
-''',
+
'output-filename' : r'''@ifnothtml
@file{%s}:@*
@end ifnothtml
'verb': r'''(?P<code>@code{.*?})''',
'lilypond-file': '(?m)^(?P<match>@lilypondfile(\[(?P<options>[^]]*)\])?{(?P<filename>[^}]+)})',
'lilypond' : '(?m)^(?P<match>@lilypond(\[(?P<options>[^]]*)\])?{(?P<code>.*?)})',
- 'lilypond-block': r'''(?ms)^(?P<match>@lilypond(\[(?P<options>[^]]*)\])?\s(?P<code>.*?)@end +lilypond)\s''',
+ 'lilypond-block': r'''(?ms)^(?P<match>@lilypond(\[(?P<options>[^]]*)\])?\s(?P<code>.*?)@end lilypond)\s''',
'option-sep' : ',\s*',
'intertext': r',?\s*intertext=\".*?\"',
'multiline-comment': r"(?sm)^\s*(?!@c\s+)(?P<code>@ignore\s.*?@end ignore)\s",
'''
if m.group ('options'):
- options = m.group ('options')
+ options = get_re ('option-sep').split (m.group ('options'))
else:
- options = ''
+ options = []
(content, nm) = find_file (m.group ('filename'))
- options = "filename=%s," % nm + options
+ options.append ("filename=%s" % nm)
- return [('input', get_output ('output-lilypond') %
- (options, content))]
+ return [('lilypond', content, options)]
def make_ly2dvi_block (m):
'''