Syntax for the new tag is:
-) LaTeX: \lilypondversion
-) HTML: <lilypondversion />
-) Texinfo: @lilypondversion
-) Docbook: NONE
The tag / command will be replaced by the LilyPond version, like "2.11.64".
TEXIDOC = 'texidoc'
TEXINFO = 'texinfo'
VERBATIM = 'verbatim'
TEXIDOC = 'texidoc'
TEXINFO = 'texinfo'
VERBATIM = 'verbatim'
+VERSION = 'lilypondversion'
FONTLOAD = 'fontload'
FILENAME = 'filename'
ALT = 'alt'
FONTLOAD = 'fontload'
FILENAME = 'filename'
ALT = 'alt'
+
+ 'lilypondversion':
+ no_match,
(?s)
(?P<match>
(?P<code><pre>\s.*?</pre>\s))''',
(?s)
(?P<match>
(?P<code><pre>\s.*?</pre>\s))''',
+
+ 'lilypondversion':
+ r'''(?mx)
+ (?P<match>
+ <lilypondversion\s*/>)''',
\\begin\s*{verbatim}
.*?
\\end\s*{verbatim}))''',
\\begin\s*{verbatim}
.*?
\\end\s*{verbatim}))''',
+
+ 'lilypondversion':
+ r'''(?smx)
+ (?P<match>
+ \\lilypondversion)[^a-zA-Z]''',
+
@example
\s.*?
@end\s+example\s))''',
@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>''',
<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>'
},
PRINTFILENAME: '<textobject><simpara><ulink url="%(base)s.ly"><filename>%(filename)s</filename></ulink></simpara></textobject>'
},
VERBATIM: r'''<pre>
%(verb)s</pre>''',
VERBATIM: r'''<pre>
%(verb)s</pre>''',
+
+ VERSION: program_version,
VERBATIM: r'''\noindent
\begin{verbatim}%(verb)s\end{verbatim}''',
VERBATIM: r'''\noindent
\begin{verbatim}%(verb)s\end{verbatim}''',
+ VERSION: program_version,
+
FILTER: r'''\begin{lilypond}[%(options)s]
%(code)s
\end{lilypond}''',
FILTER: r'''\begin{lilypond}[%(options)s]
%(code)s
\end{lilypond}''',
%(verb)s@end verbatim
''',
%(verb)s@end verbatim
''',
+ VERSION: program_version,
+
ADDVERSION: r'''@example
\version @w{"@version{}"}
@end example
ADDVERSION: r'''@example
\version @w{"@version{}"}
@end example
+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,
snippet_type_to_class = {
'lilypond_file': LilypondFileSnippet,
'lilypond_block': LilypondSnippet,
'lilypond': LilypondSnippet,
'include': IncludeSnippet,
+ 'lilypondversion': LilyPondVersionString,
}
def find_linestarts (s):
}
def find_linestarts (s):
'lilypond_file',
'include',
'lilypond',
'lilypond_file',
'include',
'lilypond',
)
progress (_ ("Dissecting..."))
chunks = find_toplevel_snippets (source, global_options.format, snippet_types)
)
progress (_ ("Dissecting..."))
chunks = find_toplevel_snippets (source, global_options.format, snippet_types)