gnunetbib

Bibliography (BibTeX, based on AnonBib)
Log | Files | Refs | README | LICENSE

commit 126f1c78b982305120dd3c5689b329e4d861e699
parent 8bdd10697fbd385ca245557969afbd338461c96a
Author: Nick Mathewson <nickm@torproject.org>
Date:   Sun, 22 Feb 2004 00:18:18 +0000

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:
MBibTeX.py | 11++++++++++-
Manonbib.bib | 8++++++++
Mcss/pubs.css | 18++++++++++++++++++
MwriteHTML.py | 7+++++--
4 files changed, 41 insertions(+), 3 deletions(-)

diff --git 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") diff --git a/anonbib.bib b/anonbib.bib @@ -1391,3 +1391,11 @@ www_pdf_url = "http://www.cs.cornell.edu/people/oneill/papers/jcs_halpern_oneill.pdf", } +@Misc{draft-tor-design-2004, + author = {Roger Dingledine and Nick Mathewson and Paul Syverson}, + title = {Tor: The Second-Generation Onion Router} + howpublished = {(Submitted)}, + year = {forthcoming}, + www_section = comm, + www_pdf_url = "http://freehaven.net/tor/tor-design.pdf", +} diff --git a/css/pubs.css b/css/pubs.css @@ -80,6 +80,24 @@ P.impEntry { margin-bottom: 0; } +DIV.draftEntry { + /* + border-width: 1px; + border-color: black; + border-style: solid; + padding: 0.3em; + margin-top: 0.7em; + margin-bottom: 0; +*/ +} + +P.draftEntry { + color: #555; + padding: 0; + margin-top: 0; + margin-bottom: 0; +} + TABLE.sidebar { border-width: 2px; border-color: black; diff --git a/writeHTML.py b/writeHTML.py @@ -102,8 +102,11 @@ f.close() entries = BibTeX.sortEntriesByDate(bib.entries) entries = BibTeX.splitSortedEntriesBy(entries, 'year') -if entries[-1][0].startswith("<span class='bad'>"): - entries[-1] = ("Unknown", entries[-1][1]) +for idx in -1, -2: + if entries[idx][0].startswith("<span class='bad'>"): + entries[idx] = ("Unknown", entries[idx][1]) + elif entries[idx][0].startswith("forthcoming"): + entries[idx] = ("Forthcoming", entries[idx][1]) sections = [ ent[0] for ent in entries ] first_year = int(entries[0][1][0]['year'])