-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
892245c
commit 3e136b0
Showing
7 changed files
with
112 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#!/bin/bash | ||
|
||
cd references/ | ||
python3 filter-reference.py | ||
cd .. | ||
|
||
make clean | ||
make html |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python | ||
# coding: utf-8 | ||
|
||
zotero_file = open("from-zotero.bib", "r") | ||
cleaned_file = open("../source/references.bib", "w") | ||
|
||
for line in zotero_file: | ||
|
||
if "journaltitle =" in line: | ||
line = line.replace("journaltitle", "journal") | ||
|
||
if ("date =" in line) & (("urldate =" not in line)): | ||
if "-" in line: | ||
year = line.split("-")[0].split("{")[1] | ||
else: | ||
year = line.split("}")[0].split("{")[1] | ||
assert len(year) == 4 | ||
line = " year = {"+year+"},\n" | ||
|
||
if ("shortjournal =" not in line) & \ | ||
("keywords =" not in line) & \ | ||
("abstract =" not in line) & \ | ||
("urldate =" not in line) & \ | ||
("langid =" not in line) & \ | ||
("file =" not in line): | ||
|
||
cleaned_file.write(line) | ||
|
||
zotero_file.close() | ||
cleaned_file.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters