From 4c6a51c128d515169dfcd2f864e37e1e79e849a2 Mon Sep 17 00:00:00 2001 From: John Mandereau Date: Fri, 28 Dec 2007 14:15:20 +0100 Subject: [PATCH] Add 'lilyquote' fragment option to lilypond-book This commit fixes part 1) of issue #531, and documents this new option in application usage manual. --- Documentation/user/lilypond-book.itely | 8 ++++++++ scripts/lilypond-book.py | 10 ++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Documentation/user/lilypond-book.itely b/Documentation/user/lilypond-book.itely index 08f50350cd..ef1176d435 100644 --- a/Documentation/user/lilypond-book.itely +++ b/Documentation/user/lilypond-book.itely @@ -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 diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index ebe2efd1dd..7084350d5a 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -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') -- 2.39.2