|
|
|
@ -98,8 +98,10 @@ class Publications(Bureau):
|
|
|
|
|
|
|
|
|
|
html = lxml.html.document_fromstring(doc.summary())
|
|
|
|
|
|
|
|
|
|
notecount = 0
|
|
|
|
|
# store links then make corresponding svg barcodes
|
|
|
|
|
for link in html.findall(".//a"):
|
|
|
|
|
notecount += 1
|
|
|
|
|
tmpcode = ''.join(random.choice(string.ascii_letters +\
|
|
|
|
|
string.digits)\
|
|
|
|
|
for _ in range(5))
|
|
|
|
@ -110,10 +112,13 @@ class Publications(Bureau):
|
|
|
|
|
|
|
|
|
|
svg = code128.svg("PBr." + tmpcode)
|
|
|
|
|
|
|
|
|
|
sidenote = html.makeelement("span")
|
|
|
|
|
sidenote.attrib["class"] = "sidenote"
|
|
|
|
|
sidenote.append(lxml.html.fromstring(svg.encode()))
|
|
|
|
|
link.addnext(sidenote)
|
|
|
|
|
footnote = html.makeelement("div")
|
|
|
|
|
footnote.attrib["class"] = "footnote"
|
|
|
|
|
notetext = html.makeelement("div")
|
|
|
|
|
notetext.text = str(notecount) + ". " + link.attrib["href"]
|
|
|
|
|
footnote.append(notetext)
|
|
|
|
|
footnote.append(lxml.html.fromstring(svg.encode()))
|
|
|
|
|
html.append(footnote)
|
|
|
|
|
|
|
|
|
|
self.print_full("article.html", title=doc.title(),
|
|
|
|
|
article=lxml.html.tostring(html).decode("utf-8"),
|
|
|
|
|