Fixed js links to articles

This commit is contained in:
Alexander Zolotarev 2013-08-08 14:38:39 +03:00
parent ce77499cbe
commit 82164df26b

View file

@ -36,12 +36,14 @@ def cleanUp(soup):
bodyTag = soup.new_tag("body")
bodyTag["class"] = "mediawiki ltr sitedir-ltr mobile stable skin-mobile action-view"
content = content.wrap(bodyTag)
content = content.wrap(soup.new_tag("html", lang="en", dir="ltr"))
htmlTag = soup.new_tag("html", lang="en", dir="ltr")
htmlTag["class"] = "client-js"
content = content.wrap(htmlTag)
# Here we add our own js and css into the <head>
headTag = soup.new_tag("head")
headTag.append(soup.new_tag("meta", charset="UTF-8"))
headTag.append(soup.new_tag("link", rel="stylesheet", type="text/css", href="article.css"))
headTag.append(soup.new_tag("script", type="text/javascript", href="article.js"))
headTag.append(soup.new_tag("script", type="text/javascript", src="article.js"))
meta1 = soup.new_tag("meta", content="yes")
# workaround as "name" is used in python
meta1["name"] = "apple-mobile-web-app-capable"
@ -153,4 +155,4 @@ if not os.path.exists(imagesDstDir):
os.makedirs(imagesDstDir)
for image in imageSet:
shutil.copy2(os.path.join(imagesSrcDir, imageFiles[image]), os.path.join(imagesDstDir, image))
shutil.copy2(os.path.join(imagesSrcDir, imageFiles[image]), os.path.join(imagesDstDir, image))