diff --git a/pubs/pretty.py b/pubs/pretty.py index 9e8c82c..10de342 100644 --- a/pubs/pretty.py +++ b/pubs/pretty.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals +import os import re from . import color @@ -64,8 +65,12 @@ def paper_oneliner(p, citekey_only=False): return p.citekey else: bibdesc = bib_oneliner(p.bibdata) - tags = '' if len(p.tags) == 0 else '| {}'.format( + doc_str = '' + if p.docpath is not None: + doc_str = color.dye_out(' [{}]'.format(os.path.splitext(p.docpath)[1][1:]), + 'tag') + tags = '' if len(p.tags) == 0 else ' | {}'.format( ','.join(color.dye_out(t, 'tag') for t in sorted(p.tags))) - return '[{citekey}] {descr} {tags}'.format( + return '[{citekey}] {descr}{doc}{tags}'.format( citekey=color.dye_out(p.citekey, 'citekey'), - descr=bibdesc, tags=tags) + descr=bibdesc, tags=tags, doc=doc_str)