File tree 2 files changed +12
-3
lines changed
tests/data/publication_list
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ @article{a2015
5
5
journal = { Great Journal} ,
6
6
volume = 1 ,
7
7
page = { 1--10} ,
8
- fulltext = { /pdf/a2015.pdf}
8
+ fulltext = { /pdf/a2015.pdf} ,
9
+ abstract = { The abstract}
9
10
}
10
11
11
12
@book {b2010 ,
Original file line number Diff line number Diff line change 31
31
32
32
from nikola .plugin_categories import RestExtension
33
33
34
- from pybtex .database import BibliographyData
34
+ from pybtex .database import BibliographyData , Entry
35
35
from pybtex .database .input .bibtex import Parser
36
36
from pybtex .plugin import find_plugin
37
37
@@ -117,7 +117,15 @@ def run(self):
117
117
html += '<li class="publication">' + pub_html
118
118
119
119
extra_links = ""
120
- bib_data = BibliographyData (dict ({label : entry })) # detail_page_dir may need it later
120
+ bibtex_fields = dict (entry .fields )
121
+ # Remove some fields for the publicly available BibTeX file since they are mostly only
122
+ # used by this plugin.
123
+ for field_to_remove in ('abstract' , 'fulltext' ):
124
+ if field_to_remove in bibtex_fields :
125
+ del bibtex_fields [field_to_remove ]
126
+ bibtex_entry = Entry (entry .type , bibtex_fields , entry .persons )
127
+ # detail_page_dir may need bib_data later
128
+ bib_data = BibliographyData (dict ({label : bibtex_entry }))
121
129
if bibtex_dir : # write bib files to bibtex_dir for downloading
122
130
bib_link = '{}/{}.bib' .format (bibtex_dir , label )
123
131
bib_data .to_file ('/' .join ([self .output_folder , bib_link ]), 'bibtex' )
You can’t perform that action at this time.
0 commit comments