X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=python%2Fauxiliar%2Fpostprocess_html.py;h=7e379dcbb8018c77dd000ec5ed235900a150398e;hb=cea739616b8abfa29efbe1ea7df309411e07348c;hp=42ccdbe54114d6febe319ab73366434f2ed137ef;hpb=817cb71f9189abb8c3743562f9c94439075d1f3b;p=lilypond.git diff --git a/python/auxiliar/postprocess_html.py b/python/auxiliar/postprocess_html.py index 42ccdbe541..7e379dcbb8 100644 --- a/python/auxiliar/postprocess_html.py +++ b/python/auxiliar/postprocess_html.py @@ -6,6 +6,7 @@ add footer, tweak links, add language selection menu. """ import re import os +import sys import time import operator @@ -26,7 +27,6 @@ non_copied_pages = ['Documentation/out-www/notation-big-page', 'out-www/examples', 'Documentation/topdocs', 'Documentation/bibliography', - 'Documentation/out-www/THANKS', 'Documentation/out-www/DEDICATION', 'input/'] @@ -38,23 +38,26 @@ header = r""" footer = ''' -''' +''' % sys.argv[0] web_footer = ''' -''' +''' % sys.argv[0] 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 ('We welcome your aid; please help us by reporting errors to our bug list.') +sidebar_version = _doc (' v%(package_version)s (%(branch_str)s).') mail_address = 'http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs' @@ -67,16 +70,17 @@ footer_tag = '' footer_tag_re = re.compile (footer_tag) lang_available = _doc ("Other languages: %s.") -browser_lang = _doc ('About automatic language selection.') -browser_language_url = "/web/about/browser-language" +browser_lang = _doc ('About automatic language selection.') +browser_language_url = "http://www.lilypond.org/website/misc/browser-language" LANGUAGES_TEMPLATE = '''

- %(language_available)s + + %%(language_available)s
- %(browser_language)s + %%(browser_language)s

-''' +''' % sys.argv[0] html_re = re.compile ('(.*?)(?:[.]([^/.]*))?[.]html$') @@ -292,10 +296,7 @@ def add_menu (page_flavors, prefix, available, target, translation): if language_menu != '': language_menu += ', ' language_menu += '%s' % (lang_file, t (lang.name)) - if target == 'offline': - browser_language = '' - elif target == 'online': - browser_language = t (browser_lang) % browser_language_url + browser_language = t (browser_lang) % browser_language_url if language_menu: language_available = t (lang_available) % language_menu languages = LANGUAGES_TEMPLATE % vars () @@ -364,6 +365,9 @@ def process_html_files (package_name = '', s = hack_urls (s, prefix, target, bool (int (versiontup[1]) % 2)) s = add_header (s, prefix) + ### add sidebar information + s = s.replace ('', sidebar_version) + ### add footer if footer_tag_re.search (s) == None: if 'web' in file_name: