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