diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2015-03-02 23:28:08 -0500 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2015-03-02 23:28:08 -0500 |
| commit | 44efb251eb3bf7b6fb0f618683319b63b64c1f9b (patch) | |
| tree | b7864e679270ca63dda378b08ff576aedced2726 /build.py | |
| parent | af35aa6ae14885e2dcb1f9260cdd49cbd1073fa6 (diff) | |
| download | reading_group-44efb251eb3bf7b6fb0f618683319b63b64c1f9b.tar.gz | |
Add papers
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 |
