From: John Mandereau Date: Mon, 2 Jul 2007 10:45:02 +0000 (+0200) Subject: Fix and improve add_html_footer.py offline target X-Git-Tag: release/2.11.28-1~53 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=cc357db7079474c144c90304f371d9982f568068;p=lilypond.git Fix and improve add_html_footer.py offline target - fix changes in add_html_footer.py: "get rid of symlinks in offline docs target" in 6c3fc2c73d0211e4a8d49a6faf739c5d3cb30955 - improve non_copied_pages usage: match beginning of path instead of matching path exactly. This should result in a less bloated-up docball. --- diff --git a/buildscripts/add_html_footer.py b/buildscripts/add_html_footer.py index 802134f9f4..a80189550d 100644 --- a/buildscripts/add_html_footer.py +++ b/buildscripts/add_html_footer.py @@ -15,15 +15,11 @@ non_copied_pages = ['Documentation/user/out-www/lilypond-big-page', 'Documentation/user/out-www/lilypond-internals-big-page', 'Documentation/user/out-www/music-glossary-big-page', 'out-www/examples', - 'Documentation/topdocs/out-www/NEWS', - 'Documentation/topdocs/out-www/INSTALL', - 'Documentation/bibliography/out-www/index', - 'Documentation/bibliography/out-www/engraving', - 'Documentation/bibliography/out-www/colorado', - 'Documentation/bibliography/out-www/computer-notation' + 'Documentation/topdocs', + 'Documentation/bibliography', 'Documentation/out-www/THANKS', 'Documentation/out-www/DEDICATION', - 'Documentation/topdocs/out-www/AUTHORS'] + 'input/'] def _doc (s): return s @@ -86,10 +82,13 @@ def build_pages_dict (filelist): def source_links_replace (m, source_val): return 'href="' + os.path.join (source_val, m.group (1)) + '"' +splitted_docs_re = re.compile ('Documentation/user/out-www/(lilypond|music-glossary)/') + # On systems without symlinks (e.g. Windows), docs are not very usable -# Get rid of symlinks here (also in GNUmakefile.in (local-WWW-post)) +# Get rid of symlinks references here +# Get rid of symlinks in GNUmakefile.in (local-WWW-post) def replace_symlinks_urls (s, prefix): - if prefix.startswith ('Documentation/user/'): + if splitted_docs_re.match (prefix): s = re.sub ('(href|src)="(lily-.*?|.*?-flat-.*?)"', '\\1="../\\2"', s) source_path = os.path.join (os.path.dirname (prefix), 'source') if not os.path.islink (source_path): @@ -159,7 +158,7 @@ def find_translations (prefix, lang_ext): if lang_ext != e: if e in pages_dict[prefix]: available.append (l) - elif lang_ext == '' and l.enabled and not prefix in non_copied_pages: + elif lang_ext == '' and l.enabled and reduce (lambda x, y: x and y, [not prefix.startswith (s) for s in non_copied_pages]): # English version of missing translated pages will be written missing.append (e) return available, missing