diff options
Diffstat (limited to 'build.py')
| -rw-r--r-- | build.py | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 |
