From 9b52797ddadf989219c0f1677ee4f403a1e31030 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Thu, 3 Aug 2023 21:17:05 +0200 Subject: [PATCH] bib2html.py: Add support for patents --- bib2html.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bib2html.py b/bib2html.py index 309b6c4..b1ba761 100755 --- a/bib2html.py +++ b/bib2html.py @@ -124,6 +124,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]') @@ -145,6 +155,8 @@ def format_entry(entry): lines.extend(format_details_inproceedings(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: -- 2.39.5