Skip to content

Comments

use key: value format when inserting to field "Extra"#17

Open
robna wants to merge 1 commit intoFrLars21:mainfrom
robna:main
Open

use key: value format when inserting to field "Extra"#17
robna wants to merge 1 commit intoFrLars21:mainfrom
robna:main

Conversation

@robna
Copy link

@robna robna commented Nov 18, 2024

I like the plugin and thx @FrLars21 for porting it to Zotero7! This PR changes the way the retrieved citation counts are inserted into the "Extra" field of a record using a key: value structure: Citations: <count> (<source>, <date>). For me this is preferable as it makes it easier to be read automatically from the resulting bib-file when you export the record.

@robna robna changed the title Main use key: value format when inserting to field "Extra" Nov 18, 2024
@robna
Copy link
Author

robna commented Nov 18, 2024

The regex that is supposed to find and delete existing entries of previous citation counts is not working reliably (it was also not working for me before my additions). For my purpose it would be better to delete any "Citations: " entry in the Extra-field when new counts are downloaded.
So, changing line 392 of zoterocitationcounts.js to const pattern = /^Citations: /i; would do. And then it actually removes older entries for me, when getting new ones.

Another idea (useful at least to me) is to implement it so that it adds to the Extra-field as tex.citations: <count> (<source>, <date>). By doing so it would ensure that an exported bibtex will carry a field citations = {<count> (<source>, <date>)} instead of nesting it in the annotations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant