Closed bwiernik closed 4 years ago
This is the best news I've heard all day! I'll get it in rbbt in the next few days.
What version? I get
curl http://localhost:23119/better-bibtex/json-rpc -X POST -H "Content-Type: application/json" -H "Accept: application/json" --data-binary '{"jsonrpc": "2.0", "method": "item.export", "params": [["dunnington_etal19"], "csl_json"] }'
{"jsonrpc":"2.0","error":{"code":-32601,"message":"Method not found: item.export"},"id":null}
https://github.com/retorquere/zotero-better-bibtex/issues/1503
Should be in the release of BBT within a few days.
Still experimental, but give it a go! I updated the README with instructions. The new bbt_detect_citations()
and bbt_write_bib()
power most of it.
This looks great!
The default translator should probably be csljson
. I've mentioned this a few places, but people using pandoc/RMarkdown will only get accurate citations for journal articles and books/chapters when biblatex. Anything else (software, reports, multimedia items) is going to lose information and generate inaccurate citations. Internally, pandoc converts bibtext back to csljson, but fields like "Report type" and "Format" will get lost in the trip.
The BBT developer has added an endpoint to generate a bibliography file from a list of citekeys. Within this, rbbt could generate a bibliography file from the citekeys that are inserted into a document.
This is the API:
In
format
you can specify either a name (better
at the start not necessary) to get one of the BBT formats, or a translator GUID to get any one that's available at that moment in Zotero.Could you possibly add a function like
rbbt::bbt_bib_file()
to extract the citekeys from a document (e.g., using a simple@
regex) and pass these to this endpoint and save the output to a file? Something like:x
here is the path to a file from which to extract the citekeys or the current document in the editor if using the RStudio add-in.file
is the filename to save to,format
is what format to request from BBT ("csljson"
should be the default format because it it pandoc-citeproc's native format and it will yield the highest quality citations).