CVSROOT: /cvsroot/lilypond
Module name: lilypond
Branch:
Changes by: Han-Wen Nienhuys <[EMAIL PROTECTED]> 05/04/20 10:52:20
Modified files:
. : ChangeLog
Documentation/user: basic-notation.itely
lily : slur-scoring.cc
scripts : lilypond-book.py
Log message:
patches by John Williams:
htmlquote bugfix.
Allow snippets to be given distinct filenames.
Allow the default alt text to be overridden.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.3483&tr2=1.3484&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/Documentation/user/basic-notation.itely.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/slur-scoring.cc.diff?tr1=1.48&tr2=1.49&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scripts/lilypond-book.py.diff?tr1=1.253&tr2=1.254&r1=text&r2=text
Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.3483 lilypond/ChangeLog:1.3484
--- lilypond/ChangeLog:1.3483 Wed Apr 20 08:16:46 2005
+++ lilypond/ChangeLog Wed Apr 20 10:52:18 2005
@@ -1,9 +1,19 @@
+2005-04-20 Han-Wen Nienhuys <[EMAIL PROTECTED]>
+
+ * scripts/lilypond-book.py: patches by John Williams:
+ htmlquote bugfix.
+ Allow snippets to be given distinct filenames.
+ Allow the default alt text to be overridden.
+
2005-04-20 Jan Nieuwenhuizen <[EMAIL PROTECTED]>
* configure.in (no gui_b): Remove optional gtk+ requirement.
2005-04-20 Han-Wen Nienhuys <[EMAIL PROTECTED]>
+ * Documentation/user/basic-notation.itely (Pitches): add
+ LedgerLineSpanner.
+
* lily/dynamic-engraver.cc (process_music): set right bound to
script if present. Else, do not set.
(acknowledge_grob): only set right bound of finished spanner to
Index: lilypond/Documentation/user/basic-notation.itely
diff -u lilypond/Documentation/user/basic-notation.itely:1.8
lilypond/Documentation/user/basic-notation.itely:1.9
--- lilypond/Documentation/user/basic-notation.itely:1.8 Sat Mar 26
04:01:45 2005
+++ lilypond/Documentation/user/basic-notation.itely Wed Apr 20 10:52:19 2005
@@ -138,7 +138,8 @@
@seealso
-Program reference: @internalsref{NoteEvent}, and @internalsref{NoteHead}.
+Program reference: @internalsref{NoteEvent},
[EMAIL PROTECTED], and @internalsref{NoteHead}.
Index: lilypond/lily/slur-scoring.cc
diff -u lilypond/lily/slur-scoring.cc:1.48 lilypond/lily/slur-scoring.cc:1.49
--- lilypond/lily/slur-scoring.cc:1.48 Tue Apr 19 13:11:25 2005
+++ lilypond/lily/slur-scoring.cc Wed Apr 20 10:52:20 2005
@@ -32,8 +32,6 @@
- curve around flag for y coordinate
- - this file is a mess, clean it up
-
- short-cut: try a smaller region first.
- handle non-visible stems better.
Index: lilypond/scripts/lilypond-book.py
diff -u lilypond/scripts/lilypond-book.py:1.253
lilypond/scripts/lilypond-book.py:1.254
--- lilypond/scripts/lilypond-book.py:1.253 Tue Apr 19 21:33:19 2005
+++ lilypond/scripts/lilypond-book.py Wed Apr 20 10:52:20 2005
@@ -118,7 +118,7 @@
latex_filter_cmd = 'latex "\\nonstopmode \input /dev/stdin"'
filter_cmd = 0
process_cmd = ''
-default_ly_options = {}
+default_ly_options = { 'alt': "[image of music]" }
#
# Is this pythonic? Personally, I find this rather #define-nesque. --hwn
@@ -152,6 +152,8 @@
TEXINFO = 'texinfo'
VERBATIM = 'verbatim'
FONTLOAD = 'fontload'
+FILENAME = 'filename'
+ALT = 'alt'
# NOTIME has no opposite so it isn't part of this dictionary.
@@ -390,7 +392,9 @@
PRINTFILENAME,
TEXIDOC,
VERBATIM,
- FONTLOAD
+ FONTLOAD,
+ FILENAME,
+ ALT
]
ly_options = {
@@ -443,7 +447,7 @@
OUTPUT: r'''
<img align="center" valign="center"
- border="0" src="%(image)s" alt="[image of music]">''',
+ border="0" src="%(image)s" alt="%(alt)s">''',
PRINTFILENAME: '<p><tt><a
href="%(base)s.ly">%(filename)s</a></tt></p>',
@@ -507,13 +511,13 @@
OUTPUTIMAGE: r'''@noindent
@ifinfo
[EMAIL PROTECTED](base)s,,,[image of music],%(ext)s}
[EMAIL PROTECTED](base)s,,,%(alt)s,%(ext)s}
@end ifinfo
@html
<p>
<a href="%(base)s.ly">
<img align="center" valign="center"
- border="0" src="%(image)s" alt="[image of music]">
+ border="0" src="%(image)s" alt="%(alt)s">
</a>
</p>
@end html
@@ -623,8 +627,14 @@
def split_options (option_string):
if option_string:
- return re.split (format_res[format]['option_sep'],
- option_string)
+ if format == HTML:
+ options =
re.findall('[\w\.-:]+(?:\s*=\s*(?:"[^"]*"|\'[^\']*\'|\S+))?',option_string)
+ for i in range(len(options)):
+ options[i] =
re.sub('^([^=]+=\s*)(?P<q>["\'])(.*)(?P=q)','\g<1>\g<3>',options[i])
+ return options
+ else:
+ return re.split (format_res[format]['option_sep'],
+ option_string)
return []
class Chunk:
@@ -683,8 +693,7 @@
def __init__ (self, type, match, format, line_number):
Snippet.__init__ (self, type, match, format, line_number)
os = match.group ('options')
- if os:
- self.do_options (os, self.type)
+ self.do_options (os, self.type)
def ly (self):
return self.substring ('code')
@@ -872,6 +881,8 @@
return self.hash
def basename (self):
+ if FILENAME in self.option_dict:
+ return self.option_dict[FILENAME]
if use_hash_p:
return 'lily-%d' % self.get_hash ()
raise 'to be done'
@@ -893,8 +904,9 @@
and os.path.exists (system_file)\
and os.stat (system_file)[stat.ST_SIZE] \
and re.match ('% eof', open (system_file).readlines ()[-1])
- if ok and (use_hash_p \
- or self.ly () == open (ly_file).read ()):
+ if ok and (not use_hash_p or FILENAME in self.option_dict):
+ ok = (self.full_ly () == open (ly_file).read ())
+ if ok:
# TODO: Do something smart with target formats
# (ps, png) and m/ctimes.
return None
@@ -957,6 +969,7 @@
str += output[HTML][BEFORE] % vars ()
for image in self.get_images ():
(base, ext) = os.path.splitext (image)
+ alt = self.option_dict[ALT]
str += output[HTML][OUTPUT] % vars ()
str += output[HTML][AFTER] % vars ()
return str
@@ -969,6 +982,7 @@
# URG, makeinfo implicitly prepends dot to extension.
# Specifying no extension is most robust.
ext = ''
+ alt = self.option_dict[ALT]
str += output[TEXINFO][OUTPUTIMAGE] % vars ()
base = self.basename ()
_______________________________________________
Lilypond-cvs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-cvs