File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -142,12 +142,24 @@ def parse_bibtex_entry(
142142 if "keywords" in entry :
143143 page .fm ["tags" ] = clean_bibtex_tags (entry ["keywords" ], normalize )
144144
145- if "url" in entry :
146- page .fm ["url_pdf" ] = clean_bibtex_str (entry ["url" ])
147-
148145 if "doi" in entry :
149146 page .fm ["doi" ] = clean_bibtex_str (entry ["doi" ])
150147
148+ links = []
149+ if all (f in entry for f in ["archiveprefix" , "eprint" ]) and entry ["archiveprefix" ].lower () == "arxiv" :
150+ links += [{"name" : "arXiv" , "url" : "https://arxiv.org/abs/" + clean_bibtex_str (entry ["eprint" ])}]
151+
152+ if "url" in entry :
153+ sane_url = clean_bibtex_str (entry ["url" ])
154+
155+ if sane_url [- 4 :].lower () == ".pdf" :
156+ page .fm ["url_pdf" ] = sane_url
157+ else :
158+ links += [{"name" : "URL" , "url" : sane_url }]
159+
160+ if links :
161+ page .fm ["links" ] = links
162+
151163 # Save Markdown file.
152164 try :
153165 log .info (f"Saving Markdown to '{ markdown_path } '" )
You can’t perform that action at this time.
0 commit comments