X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fbuild%2Fextract_texi_filenames.py;h=9e338b5daf0f26312c7b5c6ddf55cd80a5ea859d;hb=HEAD;hp=a3577ae830a77316570b37806ce415eee9180931;hpb=a066a93ee74edebb9d238a1bac93c3bc7e8e6e4a;p=lilypond.git diff --git a/scripts/build/extract_texi_filenames.py b/scripts/build/extract_texi_filenames.py index a3577ae830..9e338b5daf 100644 --- a/scripts/build/extract_texi_filenames.py +++ b/scripts/build/extract_texi_filenames.py @@ -111,11 +111,12 @@ if not os.path.isdir (outdir): os.unlink (outdir) os.makedirs (outdir) -include_re = re.compile (r'@include ((?!../lily-).*?\.i?te(xi|ly))$', re.M) +# Only look at @include if it is not preceeded by a @c: +include_re = re.compile (r'^(?!.*@c .*@include)@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 +226,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 +261,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 +275,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,