]> git.donarmstrong.com Git - lilypond.git/commitdiff
Docs: extract_texi_filenames.py: improve node names normalization
authorJohn Mandereau <john.mandereau@gmail.com>
Fri, 27 Nov 2009 18:47:17 +0000 (19:47 +0100)
committerJohn Mandereau <john.mandereau@gmail.com>
Fri, 27 Nov 2009 19:07:23 +0000 (20:07 +0100)
This fixes a bunch of mismatched lookups in 'node name'->'file name'
maps by Texi2HTML.

Also comment how maps for translations are generated.

scripts/build/extract_texi_filenames.py

index 61f6014e160894808a8c1cde678b0e24b861abfa..661020f31e89dd09d5c408a64f32d45fef388e81 100644 (file)
 #        NODE\tFILENAME\tANCHOR
 # LANG is the document language in case it's not 'en'
 # Note: The filename does not have any extension appended!
-# This file can then be used by our texi2html init script to determine
+# This file should then be used by our texi2html init script to determine
 # the correct file name and anchor for external refs
 
+# For translated documentation: cross-references to nodes that exist
+# only in documentation in English are allowed, that's why the already
+# generated map file of docs in English is loaded with
+# --master-map-file option, then the node names that are defined in
+# the map for the manual in English but not in the translated manual
+# are added to the map for the translated manual.
+
+
 import sys
 import re
 import os
@@ -154,9 +162,10 @@ def texinfo_file_name(title):
         result = 't_g' + result
     return result
 
-texinfo_re = re.compile (r'@.*{(.*)}')
+texinfo_re = re.compile (r'@.*?{(.*?)}')
 def remove_texinfo (title):
-    return texinfo_re.sub (r'\1', title)
+    title = title.replace ('--', '-')
+    return texinfo_re.sub (r'\1', title).strip ()
 
 def create_texinfo_anchor (title):
     return texinfo_file_name (remove_texinfo (title))