From b208bc45bc83e835174893644e230965ff1563ec Mon Sep 17 00:00:00 2001 From: Mitsuhiro Nakamura Date: Fri, 10 Dec 2021 14:51:42 +0900 Subject: [PATCH] feat(cmd export): exclude bibtex fields if specified --- pubs/commands/export_cmd.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pubs/commands/export_cmd.py b/pubs/commands/export_cmd.py index b316efc..042d053 100644 --- a/pubs/commands/export_cmd.py +++ b/pubs/commands/export_cmd.py @@ -53,6 +53,11 @@ def command(conf, args): for p in papers: bib[p.citekey] = p.bibdata + # exclude bibtex fields if specified + for field in conf['main']['bibtex_field_excludes']: + if field in bib[p.citekey]: + del bib[p.citekey][field] + exporter = endecoder.EnDecoder() bibdata_raw = exporter.encode_bibdata(bib, args.ignore_fields) ui.message(bibdata_raw)