]> git.donarmstrong.com Git - lilypond.git/commitdiff
Web build: translation and pdf links.
authorGraham Percival <graham@percival-music.ca>
Fri, 5 Mar 2010 19:28:47 +0000 (19:28 +0000)
committerGraham Percival <graham@percival-music.ca>
Fri, 5 Mar 2010 19:28:47 +0000 (19:28 +0000)
scripts/build/website_post.py

index 4475b467fc00f9f52cce610620a5d1e6aacebcdb..1f573910d4a2cd4bfb3a51aed90f2eec146d70d9 100644 (file)
@@ -46,14 +46,15 @@ for file in html_files:
 langs = list(langs_set)
 langs.sort()
 
-def makeFooter(currentLang):
+def makeFooter(currentLang, currentPage):
        text = "<p id=\"languages\">\n"
        text += lang_other_langs[currentLang]
        for i in range(len(langs)):
                l = langs[i]
                if (l == currentLang):
                        continue
-               text += "<a href=\"index"
+               text += "<a href=\""
+               text += currentPage
                if (not (l=="")):
                        text += "." + l
                text += ".html\">"
@@ -89,7 +90,8 @@ for file in html_files:
        # ick
        os.remove(file)
 
-       lang_footer = makeFooter(lang)
+       # ick
+       lang_footer = makeFooter(lang, out_filename.split('.')[0])
        
        outfile = open( os.path.join(outdir, out_filename), 'w')
        for line in lines:
@@ -103,6 +105,16 @@ for file in html_files:
                                text += "." + lang
                        text += ".html"
                        line = line.replace(".html", text)
+               if ((line.find("href") >= 0) and
+                   (line.find("http")==-1) and
+                   (line.find("pdf") >= 0)):
+                       text = ""
+                       if (not (lang=="")):
+                               text += "." + lang
+                       text += ".pdf"
+                       line = line.replace(".pdf", text)
+
+
                if (line.find("<!-- FOOTER -->") >= 0):
                        outfile.write( lang_footer )
                outfile.write(line)