doc extension visible in pubs list

main
Fabien C. Y. Benureau 7 years ago
parent 8fe2414040
commit 94e6dccac9
No known key found for this signature in database
GPG Key ID: C3FB5E831A249A9A

@ -1,5 +1,6 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import os
import re import re
from . import color from . import color
@ -64,8 +65,12 @@ def paper_oneliner(p, citekey_only=False):
return p.citekey return p.citekey
else: else:
bibdesc = bib_oneliner(p.bibdata) 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))) ','.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'), citekey=color.dye_out(p.citekey, 'citekey'),
descr=bibdesc, tags=tags) descr=bibdesc, tags=tags, doc=doc_str)

Loading…
Cancel
Save