+for t in targets:
+ out_root = target_pattern % t
+ strip_file_name[t] = lambda s: os.path.join (target_pattern % t, (strip_re.sub ('', s)))
+ os.mkdir (out_root)
+ map (os.mkdir, [os.path.join (out_root, d) for d in dirs])
+ for f in hardlinked_files:
+ 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)
+ 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:
+ f = open (os.path.join (target_pattern % 'online', 'Documentation/.htaccess'), 'w')
+ 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)