X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=buildscripts%2Fwww_post.py;h=b2d7ca510cb9bf663e3697d958709bce57acb96d;hb=2e4daf487c7ba55a3b32d20c715ba13ac8c7e044;hp=8d7899ef0ebf7de524234f0c27d235919101d5e7;hpb=f21e96f7088d8faf32b4b15a05ec4418a17c4949;p=lilypond.git diff --git a/buildscripts/www_post.py b/buildscripts/www_post.py index 8d7899ef0e..b2d7ca510c 100644 --- a/buildscripts/www_post.py +++ b/buildscripts/www_post.py @@ -9,27 +9,30 @@ import sys import os import re -import gettext -package_name, package_version, buildscript_dir, localedir, outdir, targets = sys.argv[1:] +package_name, package_version, buildscript_dir, outdir, targets = sys.argv[1:] targets = targets.split (' ') outdir = os.path.normpath (outdir) doc_dirs = ['input', 'Documentation', outdir] target_pattern = os.path.join (outdir, '%s-root') +# these redirection pages allow to go back to the documentation index +# from HTML manuals/snippets page static_files = { os.path.join (outdir, 'index.html'): - ''' + ''' Redirecting to the documentation index...\n''', os.path.join (outdir, 'VERSION'): - package_version + '\n' } + package_version + '\n', + os.path.join ('input', 'lsr', outdir, 'index.html'): + ''' +Redirecting to the documentation index...\n''' + } import langdefs -# ugly hack: the following overwrites HTML Info dir with a link to -# the (more useful) documentation index for l in langdefs.LANGUAGES: - static_files[os.path.join ('Documentation/user', outdir, l.file_name ('index', '.html'))] = \ + static_files[os.path.join ('Documentation', 'user', outdir, l.file_name ('index', '.html'))] = \ '\nRedirecting to the documentation index...\n' @@ -45,9 +48,9 @@ sys.stderr.write ("Mirrorring...\n") dirs, symlinks, files = mirrortree.walk_tree ( tree_roots = doc_dirs, process_dirs = outdir, - exclude_dirs = '(^|/)(' + '|'.join ([l.code for l in langdefs.LANGUAGES]) + r'|po|out|\w*?-root)(/|$)', + exclude_dirs = '(^|/)(' + r'|po|out|out-test|.*?[.]t2d|\w*?-root)(/|$)|Documentation/(' + '|'.join ([l.code for l in langdefs.LANGUAGES]) + ')', find_files = r'.*?\.(?:midi|html|pdf|png|txt|ly|signature)$|VERSION', - exclude_files = r'lily-[0-9a-f]+.*\.pdf') + exclude_files = r'lily-[0-9a-f]+.*\.(pdf|txt)') # actual mirrorring stuff html_files = [] @@ -74,7 +77,13 @@ for t in targets: os.link (f, strip_file_name[t] (f)) for l in symlinks: p = mirrortree.new_link_path (os.path.normpath (os.readlink (l)), os.path.dirname (l), strip_re) - os.symlink (p, strip_file_name[t] (l)) + dest = strip_file_name[t] (l) + if not os.path.exists (dest): + os.symlink (p, dest) + + ## ad-hoc renaming to make xrefs between PDFs work + os.rename (os.path.join (out_root, 'input/lsr/lilypond-snippets.pdf'), + os.path.join (out_root, 'Documentation/user/lilypond-snippets.pdf')) # need this for content negotiation with documentation index if 'online' in targets: @@ -82,17 +91,10 @@ if 'online' in targets: f.write ('#.htaccess\nDirectoryIndex index\n') f.close () -# load gettext messages catalogs -translation = {} -for l in langdefs.LANGUAGES: - if l.enabled and l.code != 'en': - translation[l.code] = gettext.translation('lilypond-doc', localedir, [l.code]).gettext - add_html_footer.build_pages_dict (html_files) for t in targets: sys.stderr.write ("Processing HTML pages for %s target...\n" % t) add_html_footer.add_html_footer ( - translation = translation, package_name = package_name, package_version = package_version, target = t,