From: Han-Wen Nienhuys Date: Fri, 13 Jun 2003 22:28:09 +0000 (+0000) Subject: * input/regression/span-bar.ly: smaller file. X-Git-Tag: release/1.7.21~3 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b008966a8de740291c9535d88d9c66691b1c0654;p=lilypond.git * input/regression/span-bar.ly: smaller file. * input/test/markup.ly: remove * scripts/lilypond-book.py: put printfilename in separate chunk, so texidoc is printed after the filename. --- diff --git a/buildscripts/lys-to-tely.py b/buildscripts/lys-to-tely.py index 9f2099b90b..55becc8275 100644 --- a/buildscripts/lys-to-tely.py +++ b/buildscripts/lys-to-tely.py @@ -84,7 +84,7 @@ if files: s += "@lilypondfile[printfilename]{%s}" % n return s - + files.sort () s = s + string.join (map (lambda x: name2line (x), files), "\n") s = s + '\n@bye\n' f = "%s/%s.tely" % (dir, name) diff --git a/input/regression/+.ly b/input/regression/+.ly index 8218afc2ea..f7ee566dc1 100644 --- a/input/regression/+.ly +++ b/input/regression/+.ly @@ -25,5 +25,5 @@ foollilypondbook = " } \score{ -\context Lyrics \lyrics { "." } +\context Lyrics \lyrics { " " } } diff --git a/input/regression/beam-french.ly b/input/regression/beam-french.ly index 0e978017cc..f7fe947038 100644 --- a/input/regression/beam-french.ly +++ b/input/regression/beam-french.ly @@ -1,16 +1,20 @@ \version "1.7.18" \header { - texidoc = "French style beaming. In french beaming, the stems do not go to the outer beams." + + texidoc = "French style beaming. In french beaming, the + stems do not go to the outer beams." + } \score { \notes -\relative c' + \relative c' { - \property Voice.Beam \override #'french-beaming = ##t - c16-[ c c c] - c8-[ c16 c16 c8] - c8-[ c16 e16 g8] + \property Voice.Stem \override #'french-beaming = ##t + c16-[ c c c] + c8-[ c16 c16 c8] + c8-[ c16 e16 g8] + } + } - }} -%% new-chords-done %% \ No newline at end of file +%% new-chords-done %% diff --git a/input/regression/grace-dynamic.ly b/input/regression/grace-dynamic.ly index 25764bcffa..eba3373849 100644 --- a/input/regression/grace-dynamic.ly +++ b/input/regression/grace-dynamic.ly @@ -5,5 +5,10 @@ texidoc="Dynamics on grace notes are small and behave nicely (don't crash into to main note)." } - \score { \notes \context Voice {\grace {c'_\f} d e f g}} +\score { + \notes \relative c' \context Voice {\grace {c_\f} d, c' f g} + \paper { raggedright = ##t } + +} + %% new-chords-done %% diff --git a/input/regression/grace-nest4.ly b/input/regression/grace-nest4.ly index 8a5cfb461e..bffc916ee9 100644 --- a/input/regression/grace-nest4.ly +++ b/input/regression/grace-nest4.ly @@ -3,13 +3,15 @@ texidoc = "Another combination of grace note nesting." } -\score { \notes \context Voice { +\score { \notes \context Voice \relative c'' { < { \grace g32 f4 } > \grace c16 c2. \bar "|." } + \paper { raggedright = ##t } + } diff --git a/input/regression/grace-nest5.ly b/input/regression/grace-nest5.ly index 9f17e07238..f6e7662f03 100644 --- a/input/regression/grace-nest5.ly +++ b/input/regression/grace-nest5.ly @@ -1,9 +1,11 @@ \version "1.7.18" \score -{ \notes { +{ \notes \relative c'' { s2 <>4 \grace g e4 } + + \paper { raggedright = ##t } } %% new-chords-done %% diff --git a/input/regression/key-signature-scordatura.ly b/input/regression/key-signature-scordatura.ly index c86a8ffc7d..97990de626 100644 --- a/input/regression/key-signature-scordatura.ly +++ b/input/regression/key-signature-scordatura.ly @@ -1,7 +1,7 @@ \version "1.7.18" \header { texidoc = "Key signatures can be set per pitch -individually. This can be done bby setting @code{Staff.keySignature} +individually. This can be done by setting @code{Staff.keySignature} directly." } diff --git a/input/regression/lyric-align.ly b/input/regression/lyric-align.ly index 996b630f32..83399492ad 100644 --- a/input/regression/lyric-align.ly +++ b/input/regression/lyric-align.ly @@ -1,10 +1,13 @@ \version "1.7.18" \header{ - texidoc="Lyric alignment + texidoc=" - Lyric alignment is adjustable both interms of alignment between stanzas and on notehead. + Lyric alignment is adjustable both in terms of alignment between + stanzas and on notehead. - If the property alignment is not set, there is automatic determination of alignment type based on punctuation. (ee lyric-phrasing.ly) + If the property alignment is not set, there is automatic + determination of alignment type based on punctuation. (see + lyric-phrasing.ly) " } diff --git a/input/regression/slur-attachment.ly b/input/regression/slur-attachment.ly index 9e77e87200..40bc5b420e 100644 --- a/input/regression/slur-attachment.ly +++ b/input/regression/slur-attachment.ly @@ -3,7 +3,7 @@ \header{ texidoc=" Slurs should be attached to note heads, except when they would collide -with beams. Also see: ophee-slurs. +with beams. " } \score{ diff --git a/input/regression/spacing-loose.ly b/input/regression/spacing-loose.ly deleted file mode 100644 index ba6c65c71d..0000000000 --- a/input/regression/spacing-loose.ly +++ /dev/null @@ -1,14 +0,0 @@ -\version "1.7.18" - -\header{ -texidoc=" -Loose: -" -} -\score { - \notes { \time 2/2 c'2 c'2 \time 2/2 } - \paper { linewidth = 5.0\cm - indent = 0.0 - } -} -%% new-chords-done %% diff --git a/input/regression/spacing-natural.ly b/input/regression/spacing-natural.ly deleted file mode 100644 index ac48a172e1..0000000000 --- a/input/regression/spacing-natural.ly +++ /dev/null @@ -1,16 +0,0 @@ -\version "1.7.18" - -\header{ -texidoc=" -Natural: -" -} - -\score { - \notes { \time 2/2 c'2 c'2 \time 2/2 } - \paper { raggedright = ##t - indent = 0.0 - } -} - -%% new-chords-done %% diff --git a/input/regression/spacing-tight.ly b/input/regression/spacing-tight.ly deleted file mode 100644 index 9ebfc4e649..0000000000 --- a/input/regression/spacing-tight.ly +++ /dev/null @@ -1,18 +0,0 @@ -\version "1.7.18" - -\header{ -texidoc=" -Even if a line is very tightly spaced, there will still be room -between prefatory matter and the following notes. The space after the -prefatory is rigid. In contrast, the space before the barline -must stretch like the space within the measure. - -" -} -\score { - \notes { \time 2/2 f''2 c'2 \time 2/2 } - \paper { linewidth = 2.5 \cm - indent = 0.0 - } -} -%% new-chords-done %% diff --git a/input/regression/span-bar.ly b/input/regression/span-bar.ly index ccfe8b99b4..f7e080b236 100644 --- a/input/regression/span-bar.ly +++ b/input/regression/span-bar.ly @@ -6,34 +6,19 @@ texidoc = "Span bars draw only in between staff bar lines, so setting those to t \score { \notes \relative c' \context StaffGroup = groupie < - \context Staff = SA { c1 c1 c1} - \context Lyrics = LA \lyrics < - { bla1 die bla } - > - \context Staff = SB { a1 a1 a1} + \context Staff = SB { a1 a1 a1} \context Lyrics = LB \lyrics < { bla1 die bla } { foo bar foo } > \context Staff = SC { f1 f1 f1} - \context Lyrics = LC \lyrics < - { bla1 die bla } - { foo bar foo } - { foo bar foo } - > - \context Staff = SD { d1 d1 d1} - \context Lyrics = LD \lyrics < - { bla1 die bla } - { foo bar foo } - { foo bar foo } - { foo bar foo } - > > \paper { \translator { \StaffContext BarLine \override #'transparent = ##t } + raggedright =##t } } %% new-chords-done %% diff --git a/input/regression/stanza-number.ly b/input/regression/stanza-number.ly index 4b98071023..52c273d425 100644 --- a/input/regression/stanza-number.ly +++ b/input/regression/stanza-number.ly @@ -8,12 +8,13 @@ texidoc = "Stanza numbers may differ for the first and following systems." \context LyricsVoice \lyrics { \property LyricsVoice . stanza = "first" - \property LyricsVoice . stz = \markup { "2" \super "nd" } + \property LyricsVoice . stz = \markup { "32" \super "nd" } Foo1 Bar1 } \notes { c''1 \break c''1 } > +\paper { raggedright = ##t } } %% new-chords-done %% diff --git a/input/test/markup.ly b/input/test/markup.ly deleted file mode 100644 index 94fac787e6..0000000000 --- a/input/test/markup.ly +++ /dev/null @@ -1,52 +0,0 @@ -\version "1.7.18" - -\header { - texidoc ="Test font selection and scm text markup -" -} - - -\score{ - \notes\relative c''{ - \stemUp - a-"text" - b-"texta" - c-\markup \bold "textb" - - d-\markup { "one" "two" "three" } | - e1-\markup { \column << \bold "one" - { "and" "there" "is" \override #'(font-family . number) "2" } - \italic "three" >> } - e2. - f4-\markup \teeny \number "3" - f2. - b4-\markup { "a" \hspace #-8 \raise #2 "b" "c" } - b4-\markup { "1" \raise #-2 \hspace #-1 "2" "3" } - d4-\markup { \column << "Violoncello" " e" "Contrabasso" >> } - d4_\markup {\override #'(baseline-skip . 0.0) - \override #'(word-space . 1.5) - \column << "Violoncello" " e" "Contrabasso" >> } - - - g1-"ÅÖÄÜÇÕ" - c,, - c1 - - - } - \paper{ - %raggedright = ##t - fontenc = "T1" - \translator{ - \ScoreContext - TextScript \override #'font-family = #'roman - TextScript \override #'font-shape = #'upright - TextScript \revert #'no-spacing-rods - TextScript \override #'direction = #1 - } - } -} -%%% Local variables: -%%% LilyPond-indent-level:2 -%%% End: -%% new-chords-done %% diff --git a/input/test/move-specific-text.ly b/input/test/move-specific-text.ly index fd59be9097..f1b9b68c4b 100644 --- a/input/test/move-specific-text.ly +++ b/input/test/move-specific-text.ly @@ -6,7 +6,7 @@ \score { \notes\relative c''' { \property Voice.Stem \set #'direction = #1 - \outputproperty #(make-text-checker "m.d.") + \outputproperty #(make-text-checker (make-simple-markup "m.d.")) #'extra-offset = #'(-3.5 . -4.5) a^2^"m.d." } diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 981611d984..bb0e447655 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -1,40 +1,54 @@ #!@PYTHON@ # vim: set noexpandtab: -# TODO: -# * junk --outdir for--output -# * Figure out clean set of options. -# * -# * texinfo: add support for @pagesize -# todo: dimension handling (all the x2y) is clumsy. (tca: Thats -# because the values are taken directly from texinfo.tex, -# geometry.sty and article.cls. Give me a hint, and I'll -# fix it.) +""" -# -# TODO: magnification support should also work for texinfo -> html: eg. add as option to dvips. -# + TODO: + * junk --outdir for--output + * Figure out clean set of options. + * + * texinfo: add support for @pagesize + todo: dimension handling (all the x2y) is clumsy. (tca: Thats + because the values are taken directly from texinfo.tex, + geometry.sty and article.cls. Give me a hint, and I'll + fix it.) -# -# This is a slightly hairy program. The general approach is as follows -# The input string is chopped up in chunks, i.e. , a list of tuples -# -# with the format (TAG_STR, MAIN_STR, OPTIONS, TODO, BASE) -# -# This list is build step by step: first ignore and verbatim commands are handled, -# delivering a list of chunks. -# -# then all chunks containing lilypnod commands are chopped up -# -# when all chunks have their final form, all bodies from lilypond blocks are -# extracted, and if applicable, written do disk and run through lilypond. -# + TODO: magnification support should also work for texinfo -> html: eg. add as option to dvips. + + + + This is a slightly hairy program. The general approach is as follows + The input string is chopped up in chunks, i.e. , a list of tuples + + with the format (TAG_STR, MAIN_STR, OPTIONS, TODO, BASE) + + This list is built step by step: first ignore and verbatim commands + are handled, delivering a list of chunks. + + then all chunks containing lilypond commands are chopped up + + when all chunks have their final form, all bodies from lilypond blocks are + extracted, and if applicable, written do disk and run through lilypond. + -# This is was the idea for handling of comments: +tags supported + ignore + lilypond + input + verb + verbatim + multicols + numcols + + + +""" + +# This is was the idea for handling of comments: # Multiline comments, @ignore .. @end ignore is scanned for # in read_doc_file, and the chunks are marked as 'ignore', so # lilypond-book will not touch them any more. The content of the @@ -413,7 +427,8 @@ output_dict= { 'texi' : { - 'output-filename' : r'''@ifnothtml + 'output-filename' : r''' +@ifnothtml @file{%s}:@* @end ifnothtml @ifhtml @@ -892,7 +907,9 @@ def make_lilypond_file (m): (content, nm) = find_file (m.group ('filename')) options.append ("filename=%s" % nm) + return [('lilypond', content, options)] + def make_ly2dvi_block (m): ''' @@ -1021,10 +1038,15 @@ def schedule_lilypond_block (chunk): for the main file). The .ly is written, and scheduled in TODO. - Return: a chunk (TYPE_STR, MAIN_STR, OPTIONS, TODO, BASE) + Return: multiple chunks. - TODO has format [basename, extension, extension, ... ] + The chunk pertaining to the lilypond output + has the format (TYPE_STR, MAIN_STR, OPTIONS, TODO, BASE), + where TODO has format [basename, extension, extension, ... ] ''' + + return_chunks = [] + (type, body, opts) = chunk assert type == 'lilypond' file_body = compose_full_body (body, opts) @@ -1068,6 +1090,7 @@ def schedule_lilypond_block (chunk): todo.append ('png') newbody = '' + filename_chunk = None if 'printfilename' in opts: for o in opts: m= re.match ("filename=(.*)", o) @@ -1078,14 +1101,14 @@ def schedule_lilypond_block (chunk): ## todo: include path, but strip ## first part of the path. - newbody = newbody + template % (human_base, b,human_base) + filename_chunk = ('input', template % (human_base, b,human_base)) break if 'smallverbatim' in opts: - newbody = newbody + output_verbatim (body, 1) + newbody += output_verbatim (body, 1) elif 'verbatim' in opts: - newbody = newbody + output_verbatim (body, 0) + newbody += output_verbatim (body, 0) for o in opts: m = re.search ('intertext="(.*?)"', o) @@ -1115,7 +1138,13 @@ def schedule_lilypond_block (chunk): else: # format == 'html' s = 'output-html' newbody = newbody + get_output (s) % {'fn': basename } - return ('lilypond', newbody, opts, todo, basename) + + if filename_chunk: + return_chunks += [filename_chunk] + + return_chunks += [('lilypond', newbody, opts, todo, basename)] + + return return_chunks @@ -1124,13 +1153,15 @@ def process_lilypond_blocks (chunks):#ugh rename newchunks = [] # Count sections/chapters. for c in chunks: + cs = [] if c[0] == 'lilypond': - c = schedule_lilypond_block (c) + cs = schedule_lilypond_block (c) elif c[0] == 'numcols': paperguru.m_num_cols = c[2] elif c[0] == 'multicols': paperguru.m_multicols = c[2] - newchunks.append (c) + newchunks += cs + return newchunks def process_ly2dvi_blocks (chunks): @@ -1400,9 +1431,7 @@ def do_file (input_filename): chunks = chop_chunks (chunks, 'preamble-end', do_preamble_end) chunks = chop_chunks (chunks, 'numcols', do_columns) chunks = chop_chunks (chunks, 'multicols', do_multicols) - #print "-" * 50 - #for c in chunks: print "c:", c; - #sys.exit () + scan_preamble (chunks) chunks = process_lilypond_blocks (chunks) chunks = process_ly2dvi_blocks (chunks)