This patch adds an "alt" option, which is used replace the default
alt text (alt="[image of music]") placed on the lilypond img tag.

(The htmlquote patch is especially needed to support this.)

~ John Williams

P.S. These patches are brought to you by the needs of the fine folks at
pgdp.net.

--- lilypond-book       2005/04/02 22:50:31     1.1.1.4
+++ lilypond-book       2005/04/02 22:51:11     1.1.1.5
@@ -113,7 +113,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
@@ -148,6 +148,7 @@
 VERBATIM = 'verbatim'
 FONTLOAD = 'fontload'
 FILENAME = 'filename'
+ALT = 'alt'
 
 
 # NOTIME has no opposite so it isn't part of this dictionary.
@@ -386,7 +387,8 @@
        TEXIDOC,
        VERBATIM,
        FONTLOAD,
-       FILENAME
+       FILENAME,
+       ALT
 ]
 
 ly_options = {
@@ -439,7 +441,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>',
 
@@ -503,13 +505,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
@@ -952,6 +954,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
@@ -964,6 +967,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 ()
_______________________________________________
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to