]> git.donarmstrong.com Git - lilypond.git/commitdiff
Add 'lilyquote' fragment option to lilypond-book
authorJohn Mandereau <john.mandereau@gmail.com>
Fri, 28 Dec 2007 13:15:20 +0000 (14:15 +0100)
committerJohn Mandereau <john.mandereau@gmail.com>
Fri, 28 Dec 2007 13:15:20 +0000 (14:15 +0100)
This commit fixes part 1) of issue #531, and documents this new option
in application usage manual.

Documentation/user/lilypond-book.itely
scripts/lilypond-book.py

index 08f50350cdac62fd4029bbe3b61d43c24c9cc242..ef1176d435c688e7d582a8d08aaf93dc3b768d87 100644 (file)
@@ -631,6 +631,8 @@ Reduce line length of a music snippet by @math{2*0.4}@dmn{in} and put
 the output into a quotation block.  The value @q{0.4@dmn{in}} can be
 controlled with the @code{exampleindent} option.
 
+@c in lilypond-book.py at l.953, it is said that this option is broken.
+@c remove?
 @item exampleindent
 Set the amount by which the @code{quote} option indents a music snippet.
 
@@ -688,6 +690,12 @@ lilypond-book --process="lilypond --format=tex --tex \
 Most LilyPond test documents (in the @file{input} directory of the
 distribution) are small @file{.ly} files which look exactly like this.
 
+@item lilyquote
+(Only for Texinfo output.)  This is the same option as quote, but only
+the music snippet is put into a quotation block.  This option is useful
+if you want to @code{quote} the music snippet but not the @code{texidoc}
+documentation block.
+
 @item printfilename
 If a LilyPond input file is included with @code{\lilypondfile}, print
 the file name right before the music snippet.  For HTML output, this is
index ebe2efd1dd1797665f3bc8d18aab37f004234ddf..7084350d5ae668afa5142a1d609e099724bb6651 100644 (file)
@@ -188,6 +188,7 @@ INDENT = 'indent'
 LATEX = 'latex'
 LAYOUT = 'layout'
 LINE_WIDTH = 'line-width'
+LILYQUOTE = 'lilyquote'
 NOFRAGMENT = 'nofragment'
 NOINDENT = 'noindent'
 NOQUOTE = 'noquote'
@@ -510,6 +511,8 @@ ly_options = {
 
         QUOTE: r'''line-width = %(line-width)s - 2.0 * %(exampleindent)s''',
 
+        LILYQUOTE: r'''line-width = %(line-width)s - 2.0 * %(exampleindent)s''',
+
         RAGGED_RIGHT: r'''ragged-right = ##t''',
 
         PACKED: r'''packed = ##t''',
@@ -1250,11 +1253,14 @@ class Lilypond_snippet (Snippet):
 
         if VERBATIM in self.option_dict:
             verb = self.substring ('code')
-            str += (output[TEXINFO][VERBATIM] % vars ())
+            str += output[TEXINFO][VERBATIM] % vars ()
             if not QUOTE in self.option_dict:
                 str = output[TEXINFO][NOQUOTE] % vars ()
 
-        str += self.output_info ()
+        if LILYQUOTE in self.option_dict:
+            str += output[TEXINFO][QUOTE] % {'str':self.output_info ()}
+        else:
+            str += self.output_info ()
 
 #                str += ('@ifinfo\n' + self.output_info () + '\n@end ifinfo\n')
 #                str += ('@tex\n' + self.output_latex () + '\n@end tex\n')