Closed bwiernik closed 4 years ago
@fbennett does that sound clear to you?
It would be good for @cormacrelf or another implementer to take a look, to be sure that it's clear at that end---I'm too close to the problem to say much.
@jgm @inukshuk
@bdarcus Can we merge and revisit if someone finds this unclear? There was consensus that this is the desired behavior.
Consensus of whom?
Unfortunately, none of the implementers have really weighed in here.
It's clear enough to me, but a bit painful to hear -- it would have been nice to know this before I started, as it would have affected some large-scale aspects of the design that are a pain to change now!
Rintze, Cormac, Sylvester in their discussions on Discourse. This was just adding their conclusion to the spec.
@jgm What part are you finding annoying about the behavior?
It's been a long time, but if I remember correctly this was bringing the spec in line with citeproc-js and, particularly, existing examples in the test suite and styles which relied on the behavior. I'm sure citeproc-ruby already follows citeproc-js, too.
Yes, that's right.
Rintze, Cormac, Sylvester in their discussions on Discourse. This was just adding their conclusion to the spec.
Would help to have some links to that then. Is this one of them?
https://discourse.citationstyles.org/t/groups-variables-and-missing-dates/
And given @jgm's reaction, perhaps if we do merge, it shouldn't be to master/1.0?
I'll pull together some links.
To be clear, this isn't a change, but a fix to an ambiguity in the spec that ensures it aligns with the expected behavior in repository styles and with the test suite. So it should go into master/1.0--1.0 styles may depend on it.
This is the relevant discussion on cs:choose. https://discourse.citationstyles.org/t/should-if-else-blocks-use-the-delimiter-from-a-parent-group/1511
These amendments use 'rendering elements' to refer to delimit-able things, while the Delimiter section calls them 'the output of child elements'. Calling them 'rendering elements' in addition to maintaining the category of rendering elements as including 'cs:choose' is a bit confusing. Note that the Delimiter section says this:
the delimiter attribute, whose value delimits non-empty pieces of output [...] cs:group and cs:layout (delimiting the output of the child elements)
"The output of the child elements" / "pieces of output" is actually a solid conceptual and drafting device that we can use. We're simply defining how we should "delimit" the output of two particular kinds of element. So I would go for:
Rendered output of
<text macro="...">
is encapsulated: when rendering adelimiter
_ on the macro call's nearest parentcs:layout
,cs:group
, orcs:substitute
(inherited fromcs:names
) element, no delimiters are placed between the children output by the macro, and the macro's output is considered to be a single piece of output.Rendered output of
cs:choose
(i.e. the output of the matchingcs:if
,cs:else-if
, orcs:else
) is not encapsulated: if there are multiple elements output by the chosen branch, when rendering adelimiter
_ set on a the nearest parentcs:layout
,cs:group
, orcs:substitute
[inherited fromcs:names
] element, they are treated as separate pieces of output and delimiters are placed between them.
It's a bit wordy, but when am I not. If you wanted to you could also remove the "encapsulated" terminology, unless (or perhaps especially if) you thought it would be useful to make other distinctions. You could also make it a lot easier to read by defining a 'delimiting element' as one of those elements (whether or not the delimiter was supplied) in the Delimiter section and referring to it twice.
This aligns with a glossary like so:
I think that sufficiently resolves the question around "what are rendering elements?" raised in the thread(s).
There is no mention of "rendering elements" anyway. Some variables are empty, so you have to "look inside" variables to determine whether they need a delimiter. Looking inside choose
is very similar. The spec clearly contemplates that the delimiters would be placed around something other than every single XML syntactic child. But it wasn't specific about how it would delimit that output, or what "pieces of of output" are. @jgm has to change his model, and funnily enough, so do I. I do not think that makes it a breaking change.
I did have to create tests e.g. this to cover it as none existed in the suite at the time, and citeproc-rs doesn't actually pass them yet. But I believe that:
choose
which MUST be within the parent group and is always easily referable to one.Finally, if you want to tackle https://discourse.citationstyles.org/t/groups-variables-and-missing-dates/, I still stand by the 'plain'/'missing'/'important' rules I wrote down in that thread as the most clear and precise way to define it. I think we should pretty much copy it verbatim into the spec. But that's for another issue.
Thanks Cormac.
Closing in favor of #120.
@cormacrelf I think the ambiguities in https://discourse.citationstyles.org/t/groups-variables-and-missing-dates/ are pretty much resolved by your new pull request and https://github.com/bwiernik/documentation/commit/ebb11499082d177c9fea1825767af2879dd602db
I'll continue over at #106
Closes https://github.com/citation-style-language/documentation/issues/65