Skip to content

Cache citation data in a file #164

@nichtich

Description

@nichtich

I though about using citation-js and Wikidata for reference management from command line. Given a list of Wikidata ids citation-js can lookup and convert to CSL-JSON, e.g.:

echo Q163335 > citekeys
echo Q3290152 >> citekeys
citation-js -o references -i citekeys

When added another key I don't want citation-js to download known items again. This can be done with some command line magic:

echo Q3020388 >> citekeys
{ cat citekeys & jq -r .[].id references.json; } | sort | uniq -u | citation-js >> references.json

A missing step is needed to combine the list of JSON array in references.json (or implement #163):

jq -s '[.[][]]' references.json > tmp; mv tmp references.json

Would it make sense to include this functionality in citation-js?:

citation --cache references.json < citekeys

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiRequests for improvement to APIsenhancementFeature requests

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions