]> git.donarmstrong.com Git - lilypond.git/commitdiff
Add a node prefix to snippets, preventing duplicate node errors.
authorJulien Rioux <jrioux@physics.utoronto.ca>
Thu, 12 Jan 2012 17:22:32 +0000 (12:22 -0500)
committerJulien Rioux <jrioux@physics.utoronto.ca>
Fri, 13 Jan 2012 14:10:35 +0000 (09:10 -0500)
26 files changed:
Documentation/snippets.tely
Documentation/snippets/ancient-notation-intro.itely
Documentation/snippets/chords-intro.itely
Documentation/snippets/contexts-and-engravers-intro.itely
Documentation/snippets/editorial-annotations-intro.itely
Documentation/snippets/expressive-marks-intro.itely
Documentation/snippets/fretted-strings-intro.itely
Documentation/snippets/keyboards-intro.itely
Documentation/snippets/midi-intro.itely
Documentation/snippets/paper-and-layout-intro.itely
Documentation/snippets/percussion-intro.itely
Documentation/snippets/pitches-intro.itely
Documentation/snippets/repeats-intro.itely
Documentation/snippets/rhythms-intro.itely
Documentation/snippets/simultaneous-notes-intro.itely
Documentation/snippets/spacing-intro.itely
Documentation/snippets/staff-notation-intro.itely
Documentation/snippets/template-intro.itely
Documentation/snippets/text-intro.itely
Documentation/snippets/titles-intro.itely
Documentation/snippets/tweaks-and-overrides-intro.itely
Documentation/snippets/unfretted-strings-intro.itely
Documentation/snippets/vocal-music-intro.itely
Documentation/snippets/winds-intro.itely
Documentation/snippets/world-music-intro.itely
scripts/build/extract_texi_filenames.py

index b44f4c5a901963b59f290a0e8f4680305461e5c1..2d30fa92ae0d72617e8ea81286055a5848009853 100644 (file)
@@ -41,15 +41,20 @@ by the authors.
 @include macros.itexi
 
 @ifnothtml
+@macro nodeprefix{PRE}
+@end macro
 @macro lydoctitle{TEXT}
 @unnumberedsec \TEXT\
 @end macro
 @end ifnothtml
 
 @ifhtml
+@macro nodeprefix{PRE}
+@unmacro lydoctitle
 @macro lydoctitle{TEXT}
-@node \TEXT\
-@unnumberedsec \TEXT\
+@node \PRE\: \\TEXT\\
+@unnumberedsec \\TEXT\\
+@end macro
 @end macro
 @end ifhtml
 
index a6de3f24c603c6dc1d2ecd43dea37623a322a40d..30b13b9828f16d15fe797cfc9e918ec7c2a36507 100644 (file)
@@ -1,5 +1,6 @@
 @node Ancient notation
 @unnumbered Ancient notation
+@nodeprefix Ancient notation
 
 @ruser{Ancient notation}
 
index 83aeaaaf25077a5ce926943fe4f726066363837e..1427e49a5bc69fb4f0fc3bf3512559c1f45e1360 100644 (file)
@@ -1,5 +1,6 @@
 @node Chords
 @unnumbered Chords
+@nodeprefix Chords
 
 @ruser{Chord notation}
 
index ef796b0592511526d57ad1d251c5892b47ba7d41..e4e11670ccf26d898d56901afbdd819e9802a61c 100644 (file)
@@ -1,5 +1,6 @@
 @node Contexts and engravers
 @unnumbered Contexts and engravers
+@nodeprefix Contexts and engravers
 
 @c FIXME make xref more precise when the chapter has been
 @c revised in GDP
index 0dd710632ac2de83c62a1d04188909418be2467e..793c8570b1896be3ad9203e4475f03010334481f 100644 (file)
@@ -1,5 +1,6 @@
 @node Editorial annotations
 @unnumbered Editorial annotations
+@nodeprefix Editorial annotations
 
 @ruser{Editorial annotations}
 
index c869a5347ce731e3d12449c00dfbba458bffe156..60598e5420cf28a3368db8cba13ccfd7f2cc88c2 100644 (file)
@@ -1,5 +1,6 @@
 @node Expressive marks
 @unnumbered Expressive marks
+@nodeprefix Expressive marks
 
 @ruser{Expressive marks}
 
index 48a1fea65cbd5f4b928d4b3af4557b860bbc4ee9..308e4694bdc7a1693247ff6693a83dd3c611bb46 100644 (file)
@@ -1,5 +1,6 @@
 @node Fretted strings
 @unnumbered Fretted strings
+@nodeprefix Fretted strings
 
 @ruser{Fretted string instruments}
 
index 3fd9b07b27a1ceb4aafc406cd18882388b9df55e..21675bec1444a02c14a058983f7bd9f36f175146 100644 (file)
@@ -1,5 +1,6 @@
 @node Keyboards
 @unnumbered Keyboards
+@nodeprefix Keyboards
 
 @ruser{Keyboard and other multi-staff instruments}
 
index cfa76077b8077eb8b9bb07105a08b50f3d9605bd..3302e03eab81fbd45bbd9ce3371af945117cd9de 100644 (file)
@@ -1,5 +1,6 @@
 @node MIDI
 @unnumbered MIDI
+@nodeprefix MIDI
 
 @ruser{MIDI output}
 
index 5b654b797f4744479abb1da630f5100d83a3de63..f227ffe80d3dd8e06a00f4ccdd1d9529bc0ce42a 100644 (file)
@@ -1,5 +1,6 @@
 @node Paper and layout
 @unnumbered Paper and layout
+@nodeprefix Paper and layout
 
 @c FIXME not precise enough reference?
 @ruser{Spacing issues}
index 68369ab077976c13217590aa5eeaab602eca4fa5..01a3cb42c5e8c4a05874887754cd67d839807453 100644 (file)
@@ -1,5 +1,6 @@
 @node Percussion
 @unnumbered Percussion
+@nodeprefix Percussion
 
 @ruser{Percussion}
 
index 7ca94ff7a27b73216251cb839df439273cc5945c..6141af9afcb434af626c2a01261ef1c022e777ca 100644 (file)
@@ -1,5 +1,6 @@
 @node Pitches
 @unnumbered Pitches
+@nodeprefix Pitches
 
 @ruser{Pitches}
 
index 896f8f8e4e0382375caa14b2fade94b55b8478f1..27556b74a8a7545b068e361ce46516956c6edd6f 100644 (file)
@@ -1,5 +1,6 @@
 @node Repeats
 @unnumbered Repeats
+@nodeprefix Repeats
 
 @ruser{Repeats}
 
index dede3bf13ef88105eff80caf606c877ab61dc160..ec7b2a923ec2cb0e62ea6208b24b88b43ee33ead 100644 (file)
@@ -1,5 +1,6 @@
 @node Rhythms
 @unnumbered Rhythms
+@nodeprefix Rhythms
 
 @ruser{Rhythms}
 
index 9a4612c2eafaca45b61d3757992f05a90274bd7a..8a2d2a275ad057f77059eaaf04c0d9353e0e759c 100644 (file)
@@ -1,5 +1,6 @@
 @node Simultaneous notes
 @unnumbered Simultaneous notes
+@nodeprefix Simultaneous notes
 
 @ruser{Simultaneous notes}
 
index c19a14091cf2624bbf32ffb112089ef886a62029..b29c9fcb59f423bef87e62afa395bf9fb9addbe7 100644 (file)
@@ -1,5 +1,6 @@
 @node Spacing
 @unnumbered Spacing
+@nodeprefix Spacing
 
 @ruser{Spacing issues}
 
index b78176376a3d5f9f223bdb05dda8d3f1202f144e..e71bb4d78f1ef5ff6a4ac23a4c3d8cfe8ec906a2 100644 (file)
@@ -1,5 +1,6 @@
 @node Staff notation
 @unnumbered Staff notation
+@nodeprefix Staff notation
 
 @ruser{Staff notation}
 
index 22c9952e840cbabbc9718ea396ed137ff104dc94..1521e0cd34678b2307c87e4a97ccc2fa45c662ca 100644 (file)
@@ -1,5 +1,6 @@
 @node Templates
 @unnumbered Templates
+@nodeprefix Templates
 
 @lysnippets
 
index eb71a4598e354aec165670d1ed661eaaea94a9c7..a3c95a403a2a06daaac21fe69d9f70cb0513210b 100644 (file)
@@ -1,5 +1,6 @@
 @node Text
 @unnumbered Text
+@nodeprefix Text
 
 @ruser{Text}
 
index 1d4c288f93de6e90f6d81e1eab6eff308e0c4ad9..9a5f466c758d00d89b39ee34c9852d4e9827451f 100644 (file)
@@ -1,5 +1,6 @@
 @node Titles
 @unnumbered Titles
+@nodeprefix Titles
 
 @ruser{Titles and headers}
 
index d5308b5bf8ccb12d3803d33b4936b271c1a1b442..7721859f1e58b579eef960cbb8031e87b7f047d7 100644 (file)
@@ -1,5 +1,6 @@
 @node Tweaks and overrides
 @unnumbered Tweaks and overrides
+@nodeprefix Tweaks and overrides
 
 @c FIXME make xref more precise when the chapter has been
 @c revised in GDP
index 4770fa7bec23193a5c1d55d2dad12bccd9c68d7f..959b85201395acf026e5c1b05b974f4138261148 100644 (file)
@@ -1,5 +1,6 @@
 @node Unfretted strings
 @unnumbered Unfretted strings
+@nodeprefix Unfretted strings
 
 @ruser{Unfretted string instruments}
 
index fd192ae9259557bb14d5c7ad8522e8a559d0b030..26326831de7246ac0e64fae3e5f0a2d331cefec0 100644 (file)
@@ -1,5 +1,6 @@
 @node Vocal music
 @unnumbered Vocal music
+@nodeprefix Vocal music
 
 @ruser{Vocal music}
 
index 01c5671f6f18b89beb037111663ffbff01950c2d..89e35e20d651b69515a2b2b26de8e854ac3ea979 100644 (file)
@@ -1,5 +1,6 @@
 @node Winds
 @unnumbered Winds
+@nodeprefix Winds
 
 @ruser{Wind instruments}
 
index 7dc01da4d365d76ac8385785fe207bc87f92e55d..63977c850f447465bcee54f48c3165a700909589 100644 (file)
@@ -1,5 +1,6 @@
 @node World music
 @unnumbered World music
+@nodeprefix World music
 
 @ruser{World music}
 
index a3577ae830a77316570b37806ce415eee9180931..37a7547966be9c09db3886779ca93d72ffb6dae1 100644 (file)
@@ -115,7 +115,7 @@ include_re = re.compile (r'@include ((?!../lily-).*?\.i?te(xi|ly))$', re.M)
 whitespaces = re.compile (r'\s+')
 section_translation_re = re.compile ('^@(node|(?:unnumbered|appendix)\
 (?:(?:sub){0,2}sec)?|top|chapter|(?:sub){0,2}section|\
-(?:major|chap|(?:sub){0,2})heading|lydoctitle|translationof) \
+(?:major|chap|(?:sub){0,2})heading|lydoctitle|translationof|nodeprefix) \
 (.+)$', re.MULTILINE)
 external_node_re = re.compile (r'\s+@c\s+external.*')
 
@@ -225,6 +225,7 @@ def process_sections (filename, lang_suffix, page):
         print 'writing:', p
     f = open (p, 'w')
 
+    node_prefix_title = ''
     this_title = ''
     this_filename = 'index'
     this_anchor = ''
@@ -259,6 +260,9 @@ def process_sections (filename, lang_suffix, page):
                 this_filename = anchor
             elif original_node in initial_map:
                 this_filename = initial_map[original_node][2]
+        elif sec[0] == "nodeprefix":
+            node_prefix_title = remove_texinfo (sec[1])
+            node_prefix_anchor = create_texinfo_anchor (sec[1])
         else:
             # Some pages might not use a node for every section, so
             # treat this case here, too: If we already had a section
@@ -270,6 +274,10 @@ def process_sections (filename, lang_suffix, page):
                 this_anchor = create_texinfo_anchor (sec[1])
             had_section = True
 
+            if sec[0] == "lydoctitle" and node_prefix_title:
+                this_title = "%s: %s" % (node_prefix_title, this_title)
+                this_anchor = "%s-%s" % (node_prefix_anchor, this_anchor)
+
             if split == 'custom':
                 # unnumbered nodes use the previously used file name,
                 # only numbered nodes get their own filename! However,