bib2html.py: Add isbn and note fields
[shutils.git] / bib2html.py
index 64286f25ed25a3c513164c6481194e67f8280be2..5db0d075d32d4ba6b75cbe1ddc7ba66a51cc822c 100755 (executable)
@@ -65,8 +65,9 @@ def format_details_article(entry):
             format_field(entry, 'number', pre='(', post=')'))
     line.append(format_field(entry, 'month', post=' ') + \
             format_field(entry, 'year'))
-    line = filter(lambda l: l != "", line)
+    line.append(format_field(entry, 'note'))
 
+    line = filter(lambda l: l != "", line)
     return [where, ", ".join(line)]
 
 def format_details_inproceedings(entry):
@@ -77,6 +78,9 @@ def format_details_inproceedings(entry):
     line.append(format_field(entry, 'address'))
     line.append(format_field(entry, 'month', post=' ') + \
             format_field(entry, 'year'))
+    line.append(format_field(entry, 'isbn', pre='ISBN '))
+    line.append(format_field(entry, 'note'))
+
     line = filter(lambda l: l != "", line)
     return [where, ", ".join(line)]
 
@@ -85,6 +89,8 @@ def format_details_thesis(entry):
     line.append(format_field(entry, 'school'))
     line.append(format_field(entry, 'month', post=' ') + \
             format_field(entry, 'year'))
+    line.append(format_field(entry, 'note'))
+
     line = filter(lambda l: l != "", line)
     return [", ".join(line)]
 
@@ -94,6 +100,8 @@ def format_details_book(entry):
     line.append(format_field(entry, 'isbn', pre='ISBN '))
     line.append(format_field(entry, 'month', post=' ') + \
             format_field(entry, 'year'))
+    line.append(format_field(entry, 'note'))
+
     line = filter(lambda l: l != "", line)
     return [", ".join(line)]
 
@@ -136,11 +144,16 @@ def entryDateSortKey(p):
             'apr' : '04', 'may' : '05', 'jun' : '06', \
             'jul' : '07', 'aug' : '08', 'sep' : '09', \
             'oct' : '10', 'nov' : '11', 'dec' : '12'}
+
+    if not 'month' in e.fields:
+        return e.fields['year']
+
     month = e.fields['month'].lower()[0:3]
     if month in month2num:
         month = month2num[month]
     else:
         month = ""
+
     return e.fields['year'] + "-" + month