From: Reinhold Kainhofer Date: Tue, 5 Aug 2008 18:42:57 +0000 (+0200) Subject: texi2html: handle sections without node; top-level unnumbered get their own file X-Git-Tag: release/2.11.58-1~32^2~91 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f9e1b8172001eba5c0bc412e03c257402edbd156;p=lilypond.git texi2html: handle sections without node; top-level unnumbered get their own file --- diff --git a/buildscripts/extract_texi_filenames.py b/buildscripts/extract_texi_filenames.py index e93dc2317d..ec7a42dc21 100755 --- a/buildscripts/extract_texi_filenames.py +++ b/buildscripts/extract_texi_filenames.py @@ -111,11 +111,13 @@ def process_sections (filename, page): this_filename = '' this_anchor = '' this_unnumbered = False + had_section = False for sec in sections: if sec[0] == "node": # Write out the cached values to the file and start a new section: if this_title != '': f.write (this_title + "\t" + this_filename + "\t" + this_anchor + "\n") + had_section = False this_title = remove_texinfo (sec[1]) this_anchor = create_texinfo_anchor (sec[1]) elif sec[0] == "translationof": @@ -126,10 +128,21 @@ def process_sections (filename, page): if not this_unnumbered: this_filename = anchor else: + # Some pages might not use a node for every section, so treat this + # case here, too: If we already had a section and encounter enother + # one before the next @node, we write out the old one and start + # with the new values + if had_section and this_title != '': + f.write (this_title + "\t" + this_filename + "\t" + this_anchor + "\n") + this_title = remove_texinfo (sec[1]) + this_anchor = create_texinfo_anchor (sec[1]) + had_section = True + # unnumbered nodes use the previously used file name, only numbered - # nodes get their own filename! + # nodes get their own filename! However, top-level @unnumbered + # still get their own file. this_unnumbered = unnumbered_re.match (sec[0]) - if not this_unnumbered: + if not this_unnumbered or sec[0] == "unnumbered": this_filename = this_anchor if this_title != '':