From: Julien Rioux <jrioux@physics.utoronto.ca>
Date: Thu, 19 Jan 2012 00:03:59 +0000 (-0500)
Subject: lilypond-book: Fix links in texinfo output (issue 2224).
X-Git-Tag: release/2.15.27-1~2
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=39f50579ff91fdca06acd52a9392ab2874f4723b;p=lilypond.git

lilypond-book: Fix links in texinfo output (issue 2224).

Now that we have ext defined, it's important not to overwrite it
to the empty string. Since there should be no extension in the
output for makeinfo, the more logical solution is to modify the
template for makeinfo.
---

diff --git a/python/book_texinfo.py b/python/book_texinfo.py
index 31a10612b1..c5ed564717 100644
--- a/python/book_texinfo.py
+++ b/python/book_texinfo.py
@@ -114,7 +114,7 @@ TexInfo_output = {
 
     OUTPUTIMAGE: r'''@noindent
 @ifinfo
-@image{%(info_image_path)s,,,%(alt)s,%(ext)s}
+@image{%(info_image_path)s,,,%(alt)s,}
 @end ifinfo
 @html
 <p>
@@ -313,19 +313,17 @@ class BookTexinfoOutputFormat (BookBase.BookOutputFormat):
     def output_info (self, basename, snippet):
         str = ''
         rep = snippet.get_replacements ();
+        rep['base'] = basename
+        rep['filename'] = os.path.basename (snippet.filename)
+        rep['ext'] = snippet.ext
         for image in snippet.get_images ():
             rep1 = copy.copy (rep)
-            (rep1['base'], rep1['ext']) = os.path.splitext (image)
+            rep1['base'] = os.path.splitext (image)[0]
             rep1['image'] = image
-
-            # URG, makeinfo implicitly prepends dot to extension.
-            # Specifying no extension is most robust.
-            rep1['ext'] = ''
             rep1['alt'] = snippet.option_dict[ALT]
             rep1['info_image_path'] = os.path.join (self.global_options.info_images_dir, rep1['base'])
             str += self.output[OUTPUTIMAGE] % rep1
 
-        rep['base'] = basename
         str += self.output[OUTPUT] % rep
         return str