feat(cmd edit): exclude bibtex fields if specified

main
Mitsuhiro Nakamura 3 years ago
parent b208bc45bc
commit d2dfe7dc9a

@ -59,6 +59,12 @@ def command(conf, args):
ui.info(("The metadata of paper '{}' was successfully "
"edited.".format(color.dye_out(citekey, 'citekey'))))
else:
# exclude bibtex fields if specified
for item in content.values():
for field in conf['main']['bibtex_field_excludes']:
if field in item:
del item[field]
new_paper = Paper.from_bibentry(content,
metadata=paper.metadata)
if rp.rename_paper(new_paper, old_citekey=paper.citekey):

Loading…
Cancel
Save