summaryrefslogtreecommitdiffstats
path: root/build.py
diff options
context:
space:
mode:
Diffstat (limited to 'build.py')
-rw-r--r--build.py8
1 files changed, 7 insertions, 1 deletions
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