X-Git-Url: http://git.sthu.org/?a=blobdiff_plain;ds=sidebyside;f=bib2html.py;h=7a1b7d93ce5bb5f4a43667941ec1cc4e701a8719;hb=d7b49a5434e2001d5e04ab8d9ea290982933d037;hp=309b6c49c1dc48bf11dd2bd632d99a9c1b08d408;hpb=ad936fd7ae65ffc642d2727c7a1e0c9cd8630942;p=shutils.git
diff --git a/bib2html.py b/bib2html.py
index 309b6c4..7a1b7d9 100755
--- a/bib2html.py
+++ b/bib2html.py
@@ -44,7 +44,7 @@ def format_latex(text):
'\\"a': 'ä',
'\\"o': 'ö',
'\\"u': 'u',
- '\mathcal': '',
+ '\\mathcal': '',
'{': '',
'}': '',
'\\': '',
@@ -103,6 +103,21 @@ def format_details_inproceedings(entry):
line = filter(lambda l: l != "", line)
return [where, ", ".join(line)]
+def format_details_incollection(entry):
+ where = format_field(entry, 'booktitle')
+
+ line = []
+ line.append(format_field(entry, 'publisher'))
+ line.append(format_field(entry, 'pages', pre='pp. '))
+ 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)]
+
def format_details_thesis(entry):
line = []
line.append(format_field(entry, 'school'))
@@ -124,6 +139,16 @@ def format_details_book(entry):
line = filter(lambda l: l != "", line)
return [", ".join(line)]
+def format_details_patent(entry):
+ line = []
+ line.append(format_field(entry, 'number', pre='Pat. '))
+ 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)]
+
def format_links(entry):
doi = format_field(entry, 'doi', pre='[DOI]')
webpdf = format_field(entry, 'webpdf', pre='[PDF]')
@@ -143,8 +168,12 @@ def format_entry(entry):
lines.extend(format_details_article(entry))
elif entry.type=='inproceedings':
lines.extend(format_details_inproceedings(entry))
+ elif entry.type=='incollection':
+ lines.extend(format_details_incollection(entry))
elif entry.type=='book':
lines.extend(format_details_book(entry))
+ elif entry.type=='patent':
+ lines.extend(format_details_patent(entry))
elif entry.type in ['mastersthesis', 'phdthesis']:
lines.extend(format_details_thesis(entry))
else: