From d270b6f3929c76f854e00229f80be9955d6e8735 Mon Sep 17 00:00:00 2001 From: John Mandereau Date: Fri, 27 Nov 2009 19:47:17 +0100 Subject: [PATCH] Docs: extract_texi_filenames.py: improve node names normalization 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 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/build/extract_texi_filenames.py b/scripts/build/extract_texi_filenames.py index 61f6014e16..661020f31e 100644 --- a/scripts/build/extract_texi_filenames.py +++ b/scripts/build/extract_texi_filenames.py @@ -18,9 +18,17 @@ # 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)) -- 2.39.5