-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: add JSON as an export format #421
Comments
Do you have a specific JSON standard for bib data in mind? It's not that difficult to add an output option for JSON and I've considered it before but I was never sure how useful that would be if it's not some format that something expected. |
@plk thanks for your reply. I have found this standard. |
This looks interesting. @moewew - I wonder if we might just drop |
There is also CSL-JSON, which might be interesting for interoperability with CSL styles: https://github.com/citation-style-language/schema#csl-json-schema. Not sure how different that is from bibjson. Question is if we can map everything Biber does with
|
I'll have a look at CSL-JSON. BibJSON has no fixed schema so we can basically do anything we want but then again having no fixed schema means it's of more limited use. |
Have a look at this - I have implemented a https://gist.github.com/plk/99cdd0379da2c2b53f110bcb6e2a3430 |
Digging around a bit, it looks like |
@plk Thanks, the sample JSON file look great to me. My initial idea for this feature was to simply map each key/value pair in the bibtex file to a key/value pair in the JSON file, and the implementation would look like this (in pseudocode):
This way, the user would know which keys they should expect in the JSON output just by reading biblatex's documentation. Another option might be to adopt the CSL-JSON standard, but the manual should warn the user that the conversion from bibtex to JSON could be "lossy", depending on the input file. What do you think? |
I think probably CSL-JSON is a better choice as any custom JSON won't have any parser for its schema without someone writing one which makes the use-case extremely niche and we already have a completely customisable output format with |
@plk then I'm ok with biber using CSL-JSON as its JSON output format. |
I've had a look at this and from experience implementing things like RIS, Endnote and some other JSON output formats in the past (now all deprecated due to lack of use), I'm not sure this is a good idea. The mapping from CSL-JSON to |
I see. Thanks for taking the time to discuss this feature request. |
Currently, biber in tool mode can convert a bib file to formats such as XML or dot, but not JSON.
Vim and Emacs both have native functions that can read and parse a JSON-formatted string, thus being able to read a JSON file containing bibliographic information
would allow users to easily build rich completion plugins without the need for an additional tool. For example, when completing a bibliographic key, Vim could show a popup window with additional information such as the title and the author of the work being cited; a plugin called vim-pandoc provides such functionality, but it has to use Python to do so.
As an example, a single bibliographic entry could be represented as such:
and an entire bib file would be a list of entries:
Thank you very much for your work on biber.
The text was updated successfully, but these errors were encountered: