X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=python%2Fauxiliar%2Fpostprocess_html.py;h=568ff17e75e42331648135b4423f0f836b16ee8c;hb=a6044285d052ffe24123d656c9029a9733c35364;hp=f327e4e393a474d2155e54fb7b8d4f026d0e6b21;hpb=f115fc1bdeb3fdd356db670ef4fe3e6b9aee019c;p=lilypond.git
diff --git a/python/auxiliar/postprocess_html.py b/python/auxiliar/postprocess_html.py
index f327e4e393..568ff17e75 100644
--- a/python/auxiliar/postprocess_html.py
+++ b/python/auxiliar/postprocess_html.py
@@ -54,11 +54,11 @@ web_footer = '''
footer_name_version = _doc ('This page is for %(package_name)s-%(package_version)s (%(branch_str)s).')
# ugh, must not have "_doc" in strings because it is naively replaced with "_" in hacked gettext process
-footer_report_links = _doc ('Your suggestions for the documentation are welcome, please report errors to our bug list.')
+footer_report_links = _doc ('We welcome your aid; please help us by reporting errors to our bug list.')
mail_address = 'http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs'
-suggest_Docs_url = 'http://lilypond.org/web/devel/participating/documentation-adding'
+help_us_url = 'http://lilypond.org/help-us.html'
header_tag = ''
header_tag_re = re.compile (header_tag)
@@ -107,13 +107,13 @@ lily_snippets_re = re.compile ('(href|src)="([0-9a-f]{2}/lily-.*?)"')
pictures_re = re.compile ('src="(pictures/.*?)"')
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
# 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):
+def hack_urls (s, prefix, target, is_development_branch):
if splitted_docs_re.match (prefix):
s = lily_snippets_re.sub ('\\1="../\\2"', s)
s = pictures_re.sub ('src="../\\1"', s)
@@ -130,7 +130,15 @@ def hack_urls (s, prefix):
else:
indexfile = "index"
s = docindex_link_re.sub ('href="' + rel_link + indexfile + '.html\"', s)
-
+ # make the "return to doc index" work with the online website.
+ if target == 'online':
+ if (('Documentation/contributor' in prefix) or
+ is_development_branch):
+ manuals_page = 'development'
+ else:
+ manuals_page = 'manuals'
+ s = manuals_page_link_re.sub (r'href="../../\1website/%s'
+ % manuals_page, s)
source_path = os.path.join (os.path.dirname (prefix), 'source')
if not os.path.islink (source_path):
return s
@@ -143,9 +151,7 @@ doctype_re = re.compile ('(?i)\n'
css_re = re.compile ('(?i)]*)href="[^">]*?lilypond.*\.css"([^>]*)>')
end_head_tag_re = re.compile ('(?i)')
-css_link = """
-
-
+css_link = """
@@ -343,7 +349,7 @@ def process_html_files (package_name = '',
in_f.close()
s = s.replace ('%', '%%')
- s = hack_urls (s, prefix)
+ s = hack_urls (s, prefix, target, bool (int (versiontup[1]) % 2))
s = add_header (s, prefix)
### add footer