aboutsummaryrefslogtreecommitdiffstats
path: root/BibTeX.py
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-02-22 00:18:18 +0000
committerNick Mathewson <nickm@torproject.org>2004-02-22 00:18:18 +0000
commit3118c4faf912213683061c76248d70adcee78340 (patch)
treed7d3afb7afd5f3230ae4191488d87478afe86b7a /BibTeX.py
parent19593ff205af53d2467c68384704fdf3cd12b94e (diff)
downloadanonbib-3118c4faf912213683061c76248d70adcee78340.tar.gz
Implement a 'draft' article category for submitted but unpublished stuff.
If you create an entry with year=='forthcoming', it will appear in a year called "Forthcoming", in the CSS class 'draftEntry'. Add draft-tor-design-2004 as an example. svn:r88
Diffstat (limited to 'BibTeX.py')
-rw-r--r--BibTeX.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/BibTeX.py b/BibTeX.py
index 26c55df..af414dd 100644
--- a/BibTeX.py
+++ b/BibTeX.py
@@ -210,6 +210,11 @@ def sortEntriesByDate(entries):
i = 0
for ent in entries:
i += 1
+ if (ent.get('month') == "forthcoming" or
+ ent.get('year') == "forthcoming"):
+ tmp.append((20000*13, i, ent))
+ continue
+
try:
mon = MONTHS.index(ent.get("month"))
except ValueError:
@@ -222,6 +227,7 @@ def sortEntriesByDate(entries):
print "ERROR: No year field in %s"%ent.key
date = 10000*13
except ValueError:
+ print "ERROR: Bad year field in %s"%ent.key
date = 10000*13
tmp.append((date, i, ent))
tmp.sort()
@@ -448,8 +454,11 @@ class BibTeXEntry:
def to_html(self):
"""Return the HTML for this entry."""
imp = self.isImportant()
+ draft = self.get('year') == 'forthcoming'
if imp:
res = ["<li><div class='impEntry'><p class='impEntry'>" ]
+ elif draft:
+ res = ["<li><div class='draftEntry'><p class='draftEntry'>" ]
else:
res = ["<li><p class='entry'"]
@@ -509,7 +518,7 @@ class BibTeXEntry:
res.append("<p class='remarks'>%s</span>"%htmlize(
self['www_remarks']))
- if imp:
+ if imp or draft:
res.append("</div>")
res.append("</li>\n\n")