]> git.donarmstrong.com Git - lilypond.git/commitdiff
Add addversion lilypond-book fragment option
authorJohn Mandereau <john.mandereau@gmail.com>
Fri, 29 Feb 2008 16:12:58 +0000 (17:12 +0100)
committerJohn Mandereau <john.mandereau@gmail.com>
Fri, 29 Feb 2008 16:12:58 +0000 (17:12 +0100)
Documentation/user/lilypond-book.itely
scripts/lilypond-book.py

index edafa9e528ce31fb80ac483d91544ce7cb0d50a5..ed457215df72945a4d88070b84b3991532430135 100644 (file)
@@ -656,6 +656,10 @@ will be printed with a verbatim block like
   f2 e
 @end example
 
+@item addversion
+(Only for Texinfo output.)  Prepend line @code{\version
+@@w{"@@version@{@}"}} to @code{verbatim} output.
+
 @item texidoc
 (Only for Texinfo output.)  If @command{lilypond} is called with the
 @option{--header=@/texidoc} option, and the file to be processed is
index 824cbabef9f5a69cdc081ba0223eddae1d303df5..0da7ce48289860bde8d4b0905402daa72f60f57c 100644 (file)
@@ -197,6 +197,7 @@ default_ly_options = { 'alt': "[image of music]" }
 #
 # Is this pythonic?  Personally, I find this rather #define-nesque. --hwn
 #
+ADDVERSION = 'addversion'
 AFTER = 'after'
 BEFORE = 'before'
 DOCBOOK = 'docbook'
@@ -682,6 +683,9 @@ output = {
 @verbatim
 %(verb)s@end verbatim
 ''',
+
+        ADDVERSION: r'''\version @w{"@version{}"}
+%(verb)s'''
     },
 }
 
@@ -1260,6 +1264,8 @@ class Lilypond_snippet (Snippet):
         substr = ''
         if VERBATIM in self.option_dict:
             verb = self.verb_ly ()
+            if ADDVERSION in self.option_dict:
+                verb = output[TEXINFO][ADDVERSION] % vars ()
             substr += output[TEXINFO][VERBATIM] % vars ()
             if not QUOTE in self.option_dict:
                 substr = output[TEXINFO][NOQUOTE] % {'str':substr}