X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=python%2Fauxiliar%2Fpostprocess_html.py;h=3ace451bf083ce6ecec467d4b497d8f6b716a095;hb=5e14482b7f4f929c4a368d02185496f3f4b72cdc;hp=9c0d90dc2fd031046252c59c4bda207a9420783b;hpb=54b02666750062788185bd3f99e644d621e348c2;p=lilypond.git diff --git a/python/auxiliar/postprocess_html.py b/python/auxiliar/postprocess_html.py index 9c0d90dc2f..3ace451bf0 100644 --- a/python/auxiliar/postprocess_html.py +++ b/python/auxiliar/postprocess_html.py @@ -102,7 +102,7 @@ def source_links_replace (m, source_val): return 'href="' + os.path.join (source_val, m.group (1)) + '"' # More hardcoding, yay! -splitted_docs_re = re.compile('(Documentation/out-www/(automated-engraving|essay|notation|changes|extending|music-glossary|usage|web|learning|snippets|contributor))/') +split_docs_re = re.compile('(Documentation/out-www/(automated-engraving|essay|notation|changes|extending|music-glossary|usage|web|learning|snippets|contributor))/') lily_snippets_re = re.compile ('(href|src)="([0-9a-f]{2}/lily-.*?)"') pictures_re = re.compile ('src="(pictures/.*?)"') @@ -110,11 +110,14 @@ docindex_link_re = re.compile (r'href="index.html"') manuals_page_link_re = re.compile (r'href="((?:\.\./)+)Documentation/web/manuals') ## Windows does not support symlinks. -# This function avoids creating symlinks for splitted HTML manuals +# This function avoids creating symlinks for split HTML manuals # Get rid of symlinks in GNUmakefile.in (local-WWW-post) # this also fixes missing PNGs only present in translated docs def hack_urls (s, prefix, target, is_development_branch): - if splitted_docs_re.match (prefix): + depth = (prefix.count ('/') - 1) * '../' + # fix css links + s = css_re.sub ('' % {'rel': depth}, s) + if split_docs_re.match (prefix): s = lily_snippets_re.sub ('\\1="../\\2"', s) s = pictures_re.sub ('src="../\\1"', s) @@ -149,11 +152,11 @@ body_tag_re = re.compile ('(?i)]*)>') html_tag_re = re.compile ('(?i)') doctype_re = re.compile ('(?i)\n' -css_re = re.compile ('(?i)]*)href="[^">]*?lilypond.*\.css"([^>]*)>') +css_re = re.compile ('(?i)]*)href="[^">]*?(lilypond.*\.css)"([^>]*)>') end_head_tag_re = re.compile ('(?i)') -css_link = """ +css_link = """ """