Translators, CSLJSON, export CSL variables from Extra field ?
CSL (Citation Style Language) has more variables than the Zotero form interface. Some less common variables are advised to be encoded in the Extra field. They are not exported in their own variable by the CSLJSON translator.
For example, you can produce this citation line in APA7
Doe, J. (n.d.). My review [Review of Totem and Taboo, by S. Freud]. Journal.
“My review” is the title of the article, “John Doe” is an author, “S. Freud” a reviewed author, but there is no form field for the reviewed title. The CSL processor in Zotero handle nicely a variable encoded like that in the Extra field.
reviewed-title: Totem and Taboo
Sadly, this “reviewed-title” variable is not exported with its own name by the CSLJSON translator, but in the note variable, like in the Extra field.
{
"id": "http://zotero.org/users/8989645/items/2W46VRFQ",
"type": "article-journal",
"container-title": "Journal",
"language": "en",
"note": "The Extra field with some mess.\nreviewed-title: Totem and Taboo\nMy variable: for private usage only",
"title": "My review",
"author": [
{
"family": "Doe",
"given": "John"
}
],
"reviewed-author": [
{
"family": "Freud",
"given": "Sigmung"
}
]
}
Why not parse the Extra field, like the CSL processor, before exporting to CSLJSON, to get "reviewed-title" in its own variable ?
{
"title": "My review",
"reviewed-title": "Totem and Taboo"
"note": "The Extra field with some mess.\nMy variable: for private usage only",
…
}
The code handling that is not in the CSLJSON Translator, but in a clever and powerful method in Zotero core
https://github.com/zotero/utilities/blob/9e71e449b67e7e4a437f77d234613587b7c5d4c7/utilities_item.js#L51
Surely, this place allow to call the right method in CSL processor to parse the Extra field for extra CSL variables.
For example, you can produce this citation line in APA7
Doe, J. (n.d.). My review [Review of Totem and Taboo, by S. Freud]. Journal.
“My review” is the title of the article, “John Doe” is an author, “S. Freud” a reviewed author, but there is no form field for the reviewed title. The CSL processor in Zotero handle nicely a variable encoded like that in the Extra field.
reviewed-title: Totem and Taboo
Sadly, this “reviewed-title” variable is not exported with its own name by the CSLJSON translator, but in the note variable, like in the Extra field.
{
"id": "http://zotero.org/users/8989645/items/2W46VRFQ",
"type": "article-journal",
"container-title": "Journal",
"language": "en",
"note": "The Extra field with some mess.\nreviewed-title: Totem and Taboo\nMy variable: for private usage only",
"title": "My review",
"author": [
{
"family": "Doe",
"given": "John"
}
],
"reviewed-author": [
{
"family": "Freud",
"given": "Sigmung"
}
]
}
Why not parse the Extra field, like the CSL processor, before exporting to CSLJSON, to get "reviewed-title" in its own variable ?
{
"title": "My review",
"reviewed-title": "Totem and Taboo"
"note": "The Extra field with some mess.\nMy variable: for private usage only",
…
}
The code handling that is not in the CSLJSON Translator, but in a clever and powerful method in Zotero core
https://github.com/zotero/utilities/blob/9e71e449b67e7e4a437f77d234613587b7c5d4c7/utilities_item.js#L51
Surely, this place allow to call the right method in CSL processor to parse the Extra field for extra CSL variables.
Why this BBT code for CSL-JSON is not in Zotero ? They don’t want it ? They have not enough time to acclimatise it ? To my opinion, their should be one canonic piece of code parsing the Extra field. Users need a consistent behaviour on some issues like : what to do with free text which is truly a note ? unknown CSL variables will be appended ? parsing of names, dates, numbers ?
For myself I already pre-process CSL before consuming it, to be as close as possible to the source of the information if I have a bug.
There is a good argument for you option, the CSL note variable should be used for : «Descriptive text or notes about an item (e.g. in an annotated bibliography)», typically Rich Text. Extra textarea is not the most comfortable control for rich text. But you will have to live with tons of records using Extra for notes.