summaryrefslogtreecommitdiff
path: root/python/auxiliar
diff options
context:
space:
mode:
authorJulien Rioux <jrioux@physics.utoronto.ca>2011-10-16 07:04:17 -0400
committerGraham Percival <graham@percival-music.ca>2011-10-25 01:12:38 +0100
commit7a5ed5ba18cd1b11b9468e6e6d45ab1c8987923a (patch)
tree2c8e2bfd9b9d9389c6ccf834e4b5be38a686ce99 /python/auxiliar
parentf299c35871038f6d0c959935dcf5f81e29372b86 (diff)
Centralize the css files and fix the links to css files (issue 983).
Put them in Documentation/css.
Diffstat (limited to 'python/auxiliar')
-rw-r--r--python/auxiliar/postprocess_html.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/python/auxiliar/postprocess_html.py b/python/auxiliar/postprocess_html.py
index de3848537c..3ace451bf0 100644
--- a/python/auxiliar/postprocess_html.py
+++ b/python/auxiliar/postprocess_html.py
@@ -114,6 +114,9 @@ manuals_page_link_re = re.compile (r'href="((?:\.\./)+)Documentation/web/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):
+ depth = (prefix.count ('/') - 1) * '../'
+ # fix css links
+ s = css_re.sub ('<link \\1href="%(rel)sDocumentation/css/\\2"\\3>' % {'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)<body([^>]*)>')
html_tag_re = re.compile ('(?i)<html>')
doctype_re = re.compile ('(?i)<!DOCTYPE')
doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n'
-css_re = re.compile ('(?i)<link rel="stylesheet" type="text/css" ([^>]*)href="[^">]*?lilypond.*\.css"([^>]*)>')
+css_re = re.compile ('(?i)<link ([^>]*)href="[^">]*?(lilypond.*\.css)"([^>]*)>')
end_head_tag_re = re.compile ('(?i)</head>')
-css_link = """ <link rel="stylesheet" type="text/css" title="Default design" href="%(rel)sDocumentation/lilypond-manuals.css">
+css_link = """ <link rel="stylesheet" type="text/css" title="Default design" href="%(rel)sDocumentation/css/lilypond-manuals.css">
<!--[if lte IE 7]>
- <link href="%(rel)sDocumentation/lilypond-ie-fixes.css" rel="stylesheet" type="text/css">
+ <link href="%(rel)sDocumentation/css/lilypond-ie-fixes.css" rel="stylesheet" type="text/css">
<![endif]-->
"""