Skip to content

Commit

Permalink
release 9.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Jun 7, 2022
1 parent 413c2bb commit 3e84f1f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- 2022-06-07 release 9.5.5
- 2022-06-07 addings now also works with URLs containing DOIs
- 2022-06-03 release 9.5.4
- 2022-06-03 added logging + fix #9
- 2022-06-03 make last version indicator uploadable to github
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ If there is a citation syntax that commonly using, feel free to make a PR to [th
- `⌘fn + ↵`: Delete the entry from the BibTeX library.
- ⚠️ This feature is untested with BiBTeX files created with apps other than BibDesk and Bookends (or have been formatted with `bibtex-tidy`). [Create an issue](https://github.com/chrisgrieser/alfred-bibtex-citation-picker/issues) for problems with other apps.
- __Add entries to the BibTex library__: use the Alfred Keyword `+`, followed by a DOI or ISBN
- This also works with URLs that contain a DOI.
- the respective entry will be added to your library, with a properly formatted citekey (avoiding duplicates with existing library, etc.)
- Leave the input after the `+` empty to create a new, empty BibTeX entry.
- Opens the entry afterwards in the app specified in `open_entries_in`.
Expand Down
Binary file modified Supercharged-Citation-Picker.alfredworkflow
Binary file not shown.
2 changes: 1 addition & 1 deletion info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3196,7 +3196,7 @@ to set a hotkey for the citaiton picker.</string>
<string>bibtex_library_path</string>
</array>
<key>version</key>
<string>9.5.4</string>
<string>9.5.5</string>
<key>webaddress</key>
<string>https://github.com/chrisgrieser/alfred-bibtex-citation-picker</string>
</dict>
Expand Down
6 changes: 3 additions & 3 deletions scripts/add-to-bib.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

function run (argv) {

const doiRegex = /\b10.\d{4,9}\/[-._;()/:A-Z0-9]+\b/i; // https://www.crossref.org/blog/dois-and-matching-regular-expressions/
const isbnRegex = /^ *[\d-]{9,} *$/;
const doiRegex = /\b10.\d{4,9}\/[-._;()/:A-Z0-9]+(?=$|[?/ ])/i; // https://www.crossref.org/blog/dois-and-matching-regular-expressions/
const isbnRegex = /^[\d-]{9,}$/;
const isEmptyRegex = /^\s*$/;

const bibtexEntryTemplate = "@misc{NEW_ENTRY,\n\tauthor = {Doe, Jane},\n\ttitle = {NEW_ENTRY},\n\tpages = {1--1},\n\tyear = 0000\n}\n";
Expand Down Expand Up @@ -128,7 +128,7 @@ function run (argv) {
}

if (isISBN) {
const isbn = input.trim();
const isbn = input;
bibtexEntry = app.doShellScript (`curl -sHL "https://www.ebook.de/de/tools/isbn2bibtex?isbn=${isbn}"`);
if (bibtexEntry === "Not found" || !bibtexEntry.includes("@")) return "ERROR";

Expand Down

0 comments on commit 3e84f1f

Please sign in to comment.