diff --git a/buildscripts/add_html_footer.py b/buildscripts/add_html_footer.py index a7bc7e1..7c63755 100644 --- a/buildscripts/add_html_footer.py +++ b/buildscripts/add_html_footer.py @@ -9,10 +9,23 @@ import time import langdefs -default_header = r""" +# This is to try to make the docball not too big with almost duplicate files +# see process_links() +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/out-www/THANKS', + 'Documentation/out-www/DEDICATION', + 'Documentation/topdocs/ou-www/AUTHORS'] + +header = r""" """ -default_footer = r''' +footer = r'''
@@ -24,6 +37,8 @@ Report errors to %(mail_address)s. ''' +mail_address = 'http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs' + header_tag = '' footer_tag = '' @@ -44,10 +59,11 @@ LANGUAGES_TEMPLATE = '''\ html_re = re.compile ('(.*?)(?:[.]([^/.]*))?[.]html$') +pages_dict = {} def build_pages_dict (filelist): """Build dictionnary of available translations of each page""" - pages_dict = {} + global pages_dict for f in filelist: m = html_re.match (f) if m: @@ -60,19 +76,9 @@ def build_pages_dict (filelist): pages_dict[g[0]] = [e] else: pages_dict[g[0]].append (e) - return pages_dict - - -def do_file (prefix, lang_ext, target, header, footer, pages_dict, out_root, name_filter, - package_name, package_version, branch_str, mail_address_url, mail_address): - file_name = langdefs.lang_file_name (prefix, lang_ext, '.html') - in_f = open (file_name) - s = in_f.read() - in_f.close() - - s = re.sub ('%', '%%', s) - ### add header +def add_header (s): + """Add header (
and doctype)""" if re.search (header_tag, s) == None: body = '' s = re.sub ('(?i)', body, s) @@ -88,10 +94,13 @@ def do_file (prefix, lang_ext, target, header, footer, pages_dict, out_root, nam if re.search ('(?i)\n' s = doctype + s + return s - # remove info's annoying's indication of referencing external document - s = re.sub (' \((lilypond|lilypond-internals|music-glossary)\)', '', s) +def info_external_ref_remove (s): + """Remove info's annoying's indication of referencing external document""" + return re.sub (' \((lilypond|lilypond-internals|music-glossary)\)', '', s) +def add_title (s): # urg # maybe find first node? fallback_web_title = '-- --' @@ -99,108 +108,103 @@ def do_file (prefix, lang_ext, target, header, footer, pages_dict, out_root, nam if m: fallback_web_title = m.group (1) s = re.sub ('@WEB-TITLE@', fallback_web_title, s) + return s + +info_nav_bar = re.compile (r'', re.M | re.S) + +def add_footer (s): + """add footer - ### add footer +also add navigation bar to bottom of Info HTML pages""" + m = info_nav_bar.search (s) + if m: + custom_footer = '' + m.group (1) + '