TEXIDOC = 'texidoc'
TEXINFO = 'texinfo'
VERBATIM = 'verbatim'
+VERSION = 'lilypondversion'
FONTLOAD = 'fontload'
FILENAME = 'filename'
ALT = 'alt'
'verbatim':
no_match,
-
+
+ 'lilypondversion':
+ no_match,
},
##
HTML: {
(?s)
(?P<match>
(?P<code><pre>\s.*?</pre>\s))''',
+
+ 'lilypondversion':
+ r'''(?mx)
+ (?P<match>
+ <lilypondversion\s*/>)''',
},
##
\\begin\s*{verbatim}
.*?
\\end\s*{verbatim}))''',
+
+ 'lilypondversion':
+ r'''(?smx)
+ (?P<match>
+ \\lilypondversion)[^a-zA-Z]''',
+
},
##
@example
\s.*?
@end\s+example\s))''',
+
+ 'lilypondversion':
+ r'''(?mx)
+ (?P<match>
+ @lilypondversion)[^a-zA-Z]''',
+
},
}
<imagedata fileref="%(base)s.png" format="PNG"/></imageobject>''',
VERBATIM: r'''<programlisting>%(verb)s</programlisting>''',
+
+ VERSION: program_version,
PRINTFILENAME: '<textobject><simpara><ulink url="%(base)s.ly"><filename>%(filename)s</filename></ulink></simpara></textobject>'
},
VERBATIM: r'''<pre>
%(verb)s</pre>''',
+
+ VERSION: program_version,
},
##
VERBATIM: r'''\noindent
\begin{verbatim}%(verb)s\end{verbatim}''',
+ VERSION: program_version,
+
FILTER: r'''\begin{lilypond}[%(options)s]
%(code)s
\end{lilypond}''',
%(verb)s@end verbatim
''',
+ VERSION: program_version,
+
ADDVERSION: r'''@example
\version @w{"@version{}"}
@end example
% (name, self.contents))
+class LilyPondVersionString (Snippet):
+ """A string that does not require extra memory."""
+ def __init__ (self, type, match, format, line_number):
+ Snippet.__init__ (self, type, match, format, line_number)
+
+ def replacement_text (self):
+ return output[self.format][self.type]
+
+
snippet_type_to_class = {
'lilypond_file': LilypondFileSnippet,
'lilypond_block': LilypondSnippet,
'lilypond': LilypondSnippet,
'include': IncludeSnippet,
+ 'lilypondversion': LilyPondVersionString,
}
def find_linestarts (s):
'lilypond_file',
'include',
'lilypond',
+ 'lilypondversion',
)
progress (_ ("Dissecting..."))
chunks = find_toplevel_snippets (source, global_options.format, snippet_types)