CSL YAML import translator

It would be nice if Zotero could import pandoc-style CSL YAML in addition to CSL-JSON. BBT has implemented a CSL YAML export translator. @emilianoeheyns


---
references:
- id: WackernagelTrackingecologicalovershoot2002
accessed:
- year: 2013
month: 12
day: 29
author:
- family: Wackernagel
given: Mathis
- family: Schulz
given: Niels B.
- family: Deumling
given: Diana
- family: Linares
given: Alejandro Callejas
- family: Jenkins
given: Martin
- family: Kapos
given: Valerie
- family: Monfreda
given: Chad
- family: Loh
given: Jonathan
- family: Myers
given: Norman
- family: Norgaard
given: Richard
- family: Randers
given: Jørgen
container-title: Proceedings of the National Academy of Sciences
container-title-short: PNAS
DOI: 10.1073/pnas.142033699
ISSN: 0027-8424, 1091-6490
issue: '14'
issued:
- year: 2002
month: 7
day: 9
language: en
page: 9266-9271
source: www.pnas.org
title: Tracking the ecological overshoot of the human economy
type: article-journal
URL: http://www.pnas.org/content/99/14/9266
volume: '99'
...

  • Not sure you're aware of this, but just in case: CSL_JSON support is actually built into Zotero itself and the translator just calls on the relevant function:
    https://github.com/zotero/translators/blob/master/CSL JSON.js#L107

    I don't know if there's an easy JS way to convert YAML to JSON? If so, that might be a better way to write a translator than to code it from scratch.
  • Yes, the YAML is a straight conversion of the JSON spec. It’s straightforward to convert between the two formats (eg with js-yaml package). It would be nice if Zotero’s import tools could accept this format
  • edited June 21, 2021
    There's actually a few minor differences: YAML is a really icky format to parse, you would most def want to use js-yaml. I can probably adjust the BBT CSL YAML translator to import it.
  • Adjusting the BBT translator would be great!
  • Next release will ship with CSL YAML import.
Sign In or Register to comment.