From 44efb251eb3bf7b6fb0f618683319b63b64c1f9b Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Mon, 2 Mar 2015 23:28:08 -0500 Subject: Add papers --- build.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'build.py') diff --git a/build.py b/build.py index 73a9b89..be367c2 100644 --- a/build.py +++ b/build.py @@ -16,7 +16,8 @@ def get_references(sessions): "-o - -unicode -nokeys -a -citefile keys.txt " "-s abbrv sub.bib"], shell=True) os.remove("keys.txt") - body = BeautifulSoup(html_refs, "lxml").body + soup = BeautifulSoup(html_refs, "lxml") + body = soup.body body.name = "ol" body.hr.decompose() entries = body.find_all("p") @@ -28,6 +29,11 @@ def get_references(sessions): entry["id"] = entry.a["name"] entry.a.decompose() keys[entry["id"]] = i + 1 + fname = op.join("papers", entry["id"] + ".pdf") + if op.isfile(fname): + link = soup.new_tag("a", href=fname) + link.string = "[pdf]" + entry.append(link) return unicode(body), keys -- cgit v1.2.3-70-g09d2