]> git.donarmstrong.com Git - lilypond.git/commitdiff
Only print base name in lilypond-book printfilename option
authorJohn Mandereau <john.mandereau@gmail.com>
Wed, 27 Feb 2008 15:19:10 +0000 (16:19 +0100)
committerJohn Mandereau <john.mandereau@gmail.com>
Wed, 27 Feb 2008 15:19:10 +0000 (16:19 +0100)
This should fix file names with absolute paths in regtests compiled
with GUB.

Documentation/user/lilypond-book.itely
buildscripts/lys-to-tely.py
scripts/lilypond-book.py

index 6196811450f89f01f214d47fa620cd06ef2d0b39..edafa9e528ce31fb80ac483d91544ce7cb0d50a5 100644 (file)
@@ -700,8 +700,9 @@ useful if you want to @code{quote} the music snippet but not the
 
 @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
-a link.
+the file name right before the music snippet.  For HTML output, this
+is a link.  Only the base name of the file is printed, i.e. the
+directory part of the file path is stripped.
 
 @item fontload
 This option includes fonts in all of the generated EPS-files for this
index c026522434e37b77a453592aaca71487c2e5b1b3..22aff30be503cc4a72839f286538556fdd046c49 100644 (file)
@@ -85,11 +85,11 @@ def name2line (n):
     s = r"""
 @ifhtml
 @html
-<A NAME="%s"></A>
+<a name="%s"></a>
 @end html
 @end ifhtml
 
-@lilypondfile[%s]{%s}""" % (n, fragment_options, n)
+@lilypondfile[%s]{%s}""" % (os.path.basename (n), fragment_options, n)
     return s
 
 if files:
index dee8223de6e66d51cdd85f2b6268f963cc2ddba4..96c5dcc9c5f7360c3ae1fda604a3aac5f00b9985 100644 (file)
@@ -1244,7 +1244,7 @@ class Lilypond_snippet (Snippet):
         str = ''
         if PRINTFILENAME in self.option_dict:
             base = self.basename ()
-            filename = self.substring ('filename')
+            filename = os.path.basename (self.substring ('filename'))
             str = output[global_options.format][PRINTFILENAME] % vars ()
 
         return str