Browse Source

adjusted URLs to be absroot

add-quote-import
Michael Murtaugh 8 years ago
parent
commit
d4f5aae657
  1. 8
      etherdump/commands/pull.py

8
etherdump/commands/pull.py

@ -155,7 +155,7 @@ storing enough information to reconstruct (or understand an error occurred)
# and link it in the metadata!
links = []
links.append({"href":"../styles.css", "rel":"stylesheet"})
links.append({"href":"/styles.css", "rel":"stylesheet"})
# todo, make this process reflect which files actually were made
versionbaseurl = quote(padid.encode("utf-8"))
links.append({"href":versions[0]["url"], "rel":"alternate", "type":"text/html", "title":"Etherpad"})
@ -163,7 +163,7 @@ storing enough information to reconstruct (or understand an error occurred)
links.append({"href":versionbaseurl+".raw.html", "rel":"alternate", "type":"text/html", "title":"HTML"})
links.append({"href":versionbaseurl+".diff.html", "rel":"alternate", "type":"text/html", "title":"HTML with author colors"})
links.append({"href":versionbaseurl+".meta.json", "rel":"alternate", "type":"application/json", "title":"Meta data"})
links.append({"href":"../", "rel":"search", "type":"text/html", "title":"Index"})
links.append({"href":"/", "rel":"search", "type":"text/html", "title":"Index"})
if args.all or args.dhtml:
data['startRev'] = "0"
@ -176,7 +176,7 @@ storing enough information to reconstruct (or understand an error occurred)
ver["path"] = p+".diff.html"
ver["url"] = quote(ver["path"])
doc = html5lib.parse(html.encode("utf-8"), encoding="utf-8", namespaceHTMLElements=False)
html5tidy(doc, indent=True, title=padid, scripts="../versions.js", links=links)
html5tidy(doc, indent=True, title=padid, scripts="/versions.js", links=links)
with open(ver["path"], "w") as f:
# f.write(html.encode("utf-8"))
print(ET.tostring(doc, method="html", encoding="utf-8"), file=f)
@ -192,7 +192,7 @@ storing enough information to reconstruct (or understand an error occurred)
ver["path"] = p+".raw.html"
ver["url"] = quote(ver["path"])
doc = html5lib.parse(html, namespaceHTMLElements=False)
html5tidy(doc, indent=True, title=padid, scripts="../versions.js", links=links)
html5tidy(doc, indent=True, title=padid, scripts="/versions.js", links=links)
with open(ver["path"], "w") as f:
# f.write(html.encode("utf-8"))
print (ET.tostring(doc, method="html", encoding="utf-8"), file=f)

Loading…
Cancel
Save