article template 2-col layout. typography tweaks.

workspace
Brendan Howell 9 years ago
parent 44914e90e7
commit 90a7908490

@ -11,13 +11,9 @@
}
h1 {
font-variant: small-caps;
width: 67%;
}
p {
width: 67%;
}
img {
width: 67%;
max-width: 100%;
}
a {
text-decoration: none;
@ -29,27 +25,31 @@
font-size: smaller;
vertical-align: super;
}
#twocol {
-moz-column-count: 2;
-webkit-column-count: 2;
column-count: 2;
text-align: justify;
}
#date #article-src {
padding-bottom: 10%;
font-style: italic;
}
.sidenote {
float: right;
clear: right;
margin-right: -30%;
width: 30%;
height: 30%;
position: relative;
.footnote {
font-size: smaller;
padding-bottom: 0.5em;
}
.sidenote svg {
width: 100%;
height: 100%;
.footnote svg {
width: 50%;
height: 50%;
}
</style>
<body>
<h1>${title}</h1>
<div id="twocol">
<p id="date">${date}</p>
${article}
<p id="article-src">Article Source: ${url}</p>
</div>
</body>
</html>

@ -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"),

Loading…
Cancel
Save