Merge pull request #127 from pubs/fix/remove_journal_customization
Removes journal customization (fixes #126)
This commit is contained in:
commit
1adb26471c
@ -48,7 +48,6 @@ def customizations(record):
|
|||||||
record = bp.customization.type(record)
|
record = bp.customization.type(record)
|
||||||
record = bp.customization.author(record)
|
record = bp.customization.author(record)
|
||||||
record = bp.customization.editor(record)
|
record = bp.customization.editor(record)
|
||||||
record = bp.customization.journal(record)
|
|
||||||
record = bp.customization.keyword(record)
|
record = bp.customization.keyword(record)
|
||||||
record = bp.customization.page_double_hyphen(record)
|
record = bp.customization.page_double_hyphen(record)
|
||||||
|
|
||||||
@ -99,8 +98,6 @@ class EnDecoder(object):
|
|||||||
if 'editor' in entry:
|
if 'editor' in entry:
|
||||||
entry['editor'] = ' and '.join(
|
entry['editor'] = ' and '.join(
|
||||||
editor['name'] for editor in entry['editor'])
|
editor['name'] for editor in entry['editor'])
|
||||||
if 'journal' in entry:
|
|
||||||
entry['journal'] = entry['journal']['name']
|
|
||||||
if 'keyword' in entry:
|
if 'keyword' in entry:
|
||||||
entry['keyword'] = ', '.join(
|
entry['keyword'] = ', '.join(
|
||||||
keyword for keyword in entry['keyword'])
|
keyword for keyword in entry['keyword'])
|
||||||
|
@ -8,9 +8,11 @@ from .bibstruct import TYPE_KEY
|
|||||||
|
|
||||||
CHARS = re.compile('[{}\n\t\r]')
|
CHARS = re.compile('[{}\n\t\r]')
|
||||||
|
|
||||||
|
|
||||||
def sanitize(s):
|
def sanitize(s):
|
||||||
return CHARS.sub('', s)
|
return CHARS.sub('', s)
|
||||||
|
|
||||||
|
|
||||||
# should be adaptated to bibtexparser dicts
|
# should be adaptated to bibtexparser dicts
|
||||||
def person_repr(p):
|
def person_repr(p):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
@ -35,7 +37,7 @@ def bib_oneliner(bibdata):
|
|||||||
authors = short_authors(bibdata)
|
authors = short_authors(bibdata)
|
||||||
journal = ''
|
journal = ''
|
||||||
if 'journal' in bibdata:
|
if 'journal' in bibdata:
|
||||||
journal = ' ' + bibdata['journal']['name']
|
journal = ' ' + bibdata['journal']
|
||||||
elif bibdata[TYPE_KEY] == 'inproceedings':
|
elif bibdata[TYPE_KEY] == 'inproceedings':
|
||||||
journal = ' ' + bibdata.get('booktitle', '')
|
journal = ' ' + bibdata.get('booktitle', '')
|
||||||
|
|
||||||
@ -44,14 +46,14 @@ def bib_oneliner(bibdata):
|
|||||||
title=color.dye_out(bibdata.get('title', ''), 'title'),
|
title=color.dye_out(bibdata.get('title', ''), 'title'),
|
||||||
journal=color.dye_out(journal, 'publisher'),
|
journal=color.dye_out(journal, 'publisher'),
|
||||||
year=' ({})'.format(color.dye_out(bibdata['year'], 'year'))
|
year=' ({})'.format(color.dye_out(bibdata['year'], 'year'))
|
||||||
if 'year' in bibdata else ''
|
if 'year' in bibdata else ''
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
def bib_desc(bib_data):
|
def bib_desc(bib_data):
|
||||||
article = bib_data[list(bib_data.keys())[0]]
|
article = bib_data[list(bib_data.keys())[0]]
|
||||||
s = '\n'.join('author: {}'.format(p)
|
s = '\n'.join('author: {}'.format(p)
|
||||||
for p in article['author'])
|
for p in article['author'])
|
||||||
s += '\n'
|
s += '\n'
|
||||||
s += '\n'.join('{}: {}'.format(k, v) for k, v in article.items())
|
s += '\n'.join('{}: {}'.format(k, v) for k, v in article.items())
|
||||||
return s
|
return s
|
||||||
|
Loading…
x
Reference in New Issue
Block a user