I have what may be a rather dumb question. I’m trying to understand short titles. The spec says, in discussing
variable - renders the text contents of a variable. Attribute value must be one of the standard variables. May be accompanied by the
form attribute to select the “long” (default) or “short” form of a variable (e.g. the full or short title). If the “short” form is selected but unavailable, the “long” form is rendered instead.
And under variables,
short/abbreviated form of “title” (also accessible through the “short” form of the “title” variable)
However, if one implements that behaviour, at least naively, then this test fails:
"container-title": "my container title",
So it looks as if citeproc-js is using
shortTitle as an input field, at least in JSON.
One possibility would be that for whatever reason
shortTitle in json input, in which case one could simply remap
title-short on input and be done. However, I’m doubtful about this. Googling throws up some old questions that suggest that something more is going on here (my guess is that it’s supposed to set
title-short only after
title has been rendered at least once, but really that’s a guess). I can’t find
shortTitle referred to in the CSL spec.
I guess I have two questions: First, what’s happening: what is the intended behavior here (and where is it documented)? Second, if there is some undocumented behavior involving
shortTitle, should a standards-compliant processor implement it, or should it be regarded as a
citeproc-js oddity? In practical terms I suspect that depends on whether it’s behavior that styles “in the wild” rely on significantly (I understand “standards-compliant” pragmatically rather than religiously).
This seems like a citeproc-js oddity to work with Zotero output. I don’t actually know why Zotero exports short title to
titleShort to CSL JSON (it’s how the field is referred to internally in Zotero), but it does. @Frank_Bennett – do you have any insight on this?
Thanks. If that’s so, then the “fix” is simply to translate zotero-generated
shortTitle fields to canonical
title-short fields on input, which would be gratifyingly (and surprisingly) simple.
It’s definitely a citeproc-js oddity. I thing I hacked that variable in before title-short arrived in the CSL spec. In current citeproc-js, it should work to map the value to title-short before input. If that’s not the case, raise the alarm and I can fix things; but the intention all around is to ease titleShort out of service, I think.
Thanks. I’ve no reason to think it’s not working in citeproc-js: the “fix” i was referring to was in relation to a new processor. Sounds like I can either change the test input, or if I want to be generous in handling input map
shortTitle directly to
title-short on import, neither of which is a big deal. (The tests are invaluable, but judgement is sometimes needed when deciding whether a failure of a citeproc-js test is necessarily significant.)
Oh, right, thanks for prompting again on that - I see that shortTitle is all over the place in the test suite. If there are no objections from anyone, would be happy to change those to title-short fields, for clarity.
Seems the right thing, so I went ahead and pushed that change.
Generally OK but we’d want to fix Zotero’s CSL JSON export at the same time.
It doesn’t affect the processor at all, it will accept either input; but the tests should use variables that are in the schema. Everything still passes after the change, so Zotero have assurance that it will be safe at their end, if they move to make the change.
Oops, I take that back! Today in Jurism development we encountered an issue involving language variant fallbacks in
title-short, and one source of trouble was exactly the use of
shortTitle in Zotero’s
itemToCSLJSON. I’ve worked through the small changes needed to shift Zotero to using
title-short instead, without breaking imports of legacy data. When I get done with the Jurism end and have time to adapt the code to Zotero and prepare tests to back it up, I’ll file a pull request.
The deed is done.