aboutsummaryrefslogtreecommitdiffstats
path: root/BibTeX.py
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-07-10 18:42:56 +0000
committerNick Mathewson <nickm@torproject.org>2007-07-10 18:42:56 +0000
commitef19d6e6ffdcc5ea552a2ac5ceb7e01c1e00bef9 (patch)
treed0a310bbbe8460db50438a00d6c88c316781616a /BibTeX.py
parent7569ee874013990b661875748fe39a85dd70c2a1 (diff)
downloadanonbib-ef19d6e6ffdcc5ea552a2ac5ceb7e01c1e00bef9.tar.gz
r13683@catbus: nickm | 2007-07-10 14:42:53 -0400
Patch from George to add citation-rank-based icons to anonbib output. Hacked up a bit so that "cache" and "generate page" are separate, so that the image urls are no longer hardwired to ~george, so output locations are configurable, etc. svn:r234
Diffstat (limited to 'BibTeX.py')
-rw-r--r--BibTeX.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/BibTeX.py b/BibTeX.py
index 1b26d72..2181ba6 100644
--- a/BibTeX.py
+++ b/BibTeX.py
@@ -13,6 +13,8 @@ import os
import config
+import rank
+
__all__ = [ 'ParseError', 'BibTeX', 'BibTeXEntry', 'htmlize',
'ParsedAuthor', 'FileIter', 'Parser', 'parseFile',
'splitBibTeXEntriesBy', 'sortBibTexEntriesBy', ]
@@ -400,7 +402,7 @@ class BibTeXEntry:
return errs
def biblio_to_html(self):
- """Return the HTML for the citatation portion of entry."""
+ """Return the HTML for the citation portion of entry."""
if self.type == 'inproceedings':
booktitle = self['booktitle']
bookurl = self.get('bookurl')
@@ -496,7 +498,7 @@ class BibTeXEntry:
"</span>") %bibtexurl)
return htmlize("".join(res))
- def to_html(self, cache_path="./cache"):
+ def to_html(self, cache_path="./cache", base_url="."):
"""Return the HTML for this entry."""
imp = self.isImportant()
draft = self.get('year') == 'forthcoming'
@@ -507,6 +509,14 @@ class BibTeXEntry:
else:
res = ["<li><p class='entry'>"]
+ if imp or not draft:
+ # Add a picture of the rank
+ # Only if year is known or paper important!
+ r = rank.get_rank_html(self['title'], self.get('year'),
+ update=False, base_url=base_url)
+ if r is not None:
+ res.append(r)
+
res.append("<span class='title'><a name='%s'>%s</a></span>"%(
url_untranslate(self.key),htmlize(self['title'])))