article template 2-col layout. typography tweaks.

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

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

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

Loading…
Cancel
Save