Skip to content
Permalink
Browse files

publication_list: remove all workaround to deal with bibtex to unicod…

…e conversion

Enforcing pybtex>=0.20 since this version of pybtex can handle it for us.
  • Loading branch information
xuhdev committed Mar 11, 2016
1 parent 932dc50 commit 0d82b04dc33b4e50020cbbe4b96c1b2b271f984d
Showing with 3 additions and 14 deletions.
  1. +2 −13 v7/publication_list/publication_list.py
  2. +1 −1 v7/publication_list/requirements.txt
@@ -36,17 +36,6 @@
from pybtex.plugin import find_plugin


def process_bibtex_string(s):
"""
Process the BibTeX string to a Unicode string.
"""
# replace the special quote characters with the HTML version
s = s.replace("``", "\u201c").replace("''", "\u201d")
s = s.replace("`", "\u2018").replace("'", "\u2019")
s = s.replace("---", "\u2014")
return s


class Plugin(RestExtension):

name = "publication_list"
@@ -144,8 +133,8 @@ def run(self):
html += ' [<a href="{}">abstract and details</a>]'.format(
self.site.config['BASE_URL'] + page_url)
context = {
'title': process_bibtex_string(entry.fields['title']),
'abstract': process_bibtex_string(entry.fields['abstract']) if 'abstract' in entry.fields else '',
'title': entry.fields['title'],
'abstract': entry.fields['abstract'] if 'abstract' in entry.fields else '',
'bibtex': bib_data.to_string('bibtex'),
'bibtex_link': '/' + bib_link if bibtex_dir else '',
'default_lang': self.site.config['DEFAULT_LANG'],
@@ -1 +1 @@
pybtex
pybtex>=0.20

0 comments on commit 0d82b04

Please sign in to comment.
You can’t perform that action at this time.