-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Split title -> Title-main/title-sub #203
Split title -> Title-main/title-sub #203
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Note: this is an example of one of the problems having the documentation repo separate from this one. Really we need to be able to evaluation PRs that impact the spec alongside the spec language. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Perhaps we should do things the other way round? Write documentation first, schema second? |
Sure. I'll look into it, but need to understand csl-data.rnc first. How do you transform title into an array? @bwiernik hints? |
I suspect that would end introducing the same problem. I'm seriously wondering if we should move the spec files here, and simply include them in the documentation repo as a submodule. The documentation repo would then effectively be more of a publishing repo. Just mentioning it while I think about it. |
So you are proposing to turn ... "title": "Some Time: With Subtitle" ... into: "title": {"title-main": "Some Time", "title-sub": "With Subtitle"} And the first example would thus be deprecated? If yes, why not simply? "title-main": "Some Time",
"title-sub": "With Subtitle" .. and retain "title"? E.g. the split title would be optional. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@bwiernik What do you think so far? And what do you think regarding Bruce's questions? What I was also thinking of: If <title>
<main/>
<sub>
<sub/>
</sub>
<title> Note also that in the current version I'm not sure about the dashes yet, but semicolons should be normalized, therefore |
In the .rnc, make a new section that is variables.titles and move the title variables there. In the .json schema for data, specify a definition for titles like for names or dates. The slots for that would be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the CSL JSON change?
Comes next. I am just thinking if I should add "title-variable": {
"anyOf": [
{
"properties": {
"main": {
"type": "string"
},
"sub": {
"type": "string"
},
"addon": {
"type": "string"
},
"sub-delimiter": {
"type": "string"
},
"addon-delimiter": {
"type": "string"
},
"literal": {
"type": "string"
}
},
"additionalProperties": false
}
]
} Am I overthinking this? Then, what about the |
What is |
So I was thinking if we should do use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're giving this a bit of time for feedback, I just took another close close at this section.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Just a head's up that the merges I did today caused some conflict between master and v1.1 that I'm having trouble resolving. I guess the problem of trying to do development on multiple branches. What's weird is if I rebase from master, I only get problems on csl.rnc, while if I do merge, I get this. Auto-merging schemas/styles/csl.rnc
Auto-merging schemas/styles/csl-variables.rnc
CONFLICT (content): Merge conflict in schemas/styles/csl-variables.rnc
Auto-merging schemas/input/csl-data.json
CONFLICT (content): Merge conflict in schemas/input/csl-data.json
Automatic merge failed; fix conflicts and then commit the result. |
@bdarcus I can reconcile in a PR |
Thank you! |
This adds distinct variables for different parts of a title, and attributes that instruct processors how these variables can be derived from regular title variables, how titles should be re-assembled from these derived variables, and which delimiters to use for that. It also adds a new option "capitalize-subtitle" to text-case. Closes citation-style-language/csl-evolution#31
Flagging this for @jgm |
This adds distinct variables for different parts of a title, and attributes that instruct processors how these variables can be derived from regular title variables, how titles should be re-assembled from these derived variables, and which delimiters to use for that. It also adds a new option "capitalize-subtitle" to text-case. Closes citation-style-language/csl-evolution#31
This adds distinct variables for different parts of a title, and attributes that instruct processors how these variables can be derived from regular title variables, how titles should be re-assembled from these derived variables, and which delimiters to use for that. It also adds a new option "capitalize-subtitle" to text-case. Closes citation-style-language/csl-evolution#31
This adds distinct variables for different parts of a title, and attributes that instruct processors how these variables can be derived from regular title variables, how titles should be re-assembled from these derived variables, and which delimiters to use for that. It also adds a new option "capitalize-subtitle" to text-case. Closes citation-style-language/csl-evolution#31
This adds distinct variables for different parts of a title, and attributes that instruct processors how these variables can be derived from regular title variables, how titles should be re-assembled from these derived variables, and which delimiters to use for that. It also adds a new option "capitalize-subtitle" to text-case. Closes citation-style-language/csl-evolution#31
Closes citation-style-language/csl-evolution#31
Updated proposal:
Summary
Adds variables and attributes for splitting and re-assembling titles
This adds distinct variables for different parts of a title, and attributes that instruct processors how these variables can be derived from regular title variables, how titles should be re-assembled from these derived variables, and which delimiters to use for that.
It also adds a new option "capitalize-subtitle" to
text-case
.Suggestion for spec addition
To be added ...
Requirements
CSL processors currently accept titles as a single string, and CSL styles can only define formatting for the title as a whole.
This leads to the following (documented) problems regarding style agnostic data entry, which this proposal addresses:
Proposed solution
Build upon existing functionality in citeproc-js to split
title
variables intotitle-main
andtitle-sub
variables, and provide ways to configure the splitting and re-assembling mechanism, and to define delimiters.This is probably the solution that has the least impact on existing styles and reference management tools, it is consistent with existing behaviour, it does not break existing workflows.
So, we have to decide:
title
if the data providestitle-main
andtitle-sub
(what delimiters to use)title
intotitle-main
andtitle-sub
There are several variations across styles that need to accommodated:
—
, Chicago does not; Chicago splits on; or,
and, or,
but most other styles do not);
instead of:
).With these in mind, here is the proposal:
Variables: Add
title-main
andtitle-sub
variables. Create a new variable typevariables.titles
incsl-variables.rnc
Data structure: In CSL JSON, in addition to
title
allowtitle-main
andtitle-sub
. Both are flat strings. Citeprocs should parse and normalize delimiters between multiple subtitles fromtitle-sub
. Multiple subtitles can be explicitly provided by separating them with two vertical bars:First subtitle || Second subtitle
.Parsing by citeproc: If
title-main
andtitle-sub
are not supplied in the data, the citeproc will derive them fromtitle
following these rules (based on existing citeproc-js behavior):Split the title based on the inheritable attribute
title-split
. Options for this attribute are:*
"simple"
: Matches.
,:
,::
,!
,?
*
"extended"
: Matches the values for"simple"
, plus;
*
"full"
: Matches the values for"simple"
, plus—
and;
*
"chicago"
: Matches the values for"simple"
, plus;
and[;,] or[,:]
title-main
is the text before the first delimiter.title-sub
is an array of the text following each delimiter. (How such an array should be entered is still undecided.)If both
title
andtitle-main
are provided andtitle-main
matches the beginning oftitle
, only split the delimiter following thetitle-main
text if any. (This provides an override to prevent the standard splitting behavior if needed.) The same applies fortitle-sub
: If bothtitle
andtitle-sub
are provided, only split the delimiter following the first subtitle if any.Rendering title::
<text variable="title">
renderstitle-main
followed bytitle-sub
.title-delimiter
, a text string.title-sub
renders all of its elements, with the delimiter set by the inheritable attributetitle-sub-delimiter
(the same astitle-delimiter
if empty).Normalizing delimiters: Delimiters are changed to the values specified by
title-delimiter
andtitle-sub-delimiter
. Which delimiters are normalized is controlled via an inheritable attributenormalize-title-delimiters
. Options for this attribute are:"simple"
: Normalize.
,:
,::
"extended"
: Normalize the values for"simple"
, plus;
"full"
: Normalize the values for"simple"
, plus—
and;
Splitting and normalization behavior regarding dashes: As some locales prefer en to em dashes citeprocs should check against both if the "full" options are selected on
normalize-title-delimiters
and/ortitle-split
.Text casing: When calling
<text variable="title">
:text-case="title"
title casing is applied totitle-main
and each element oftitle-sub
text-case="capitalize-subtitle"
the first letter oftitle-main
and each element oftitle-sub
is capitalizedOther titles: All of the above apply to all
title
variables (container-
,collection-
,volume-
, etc.)Original proposal
I think
title-main
andtitle-sub
should be adopted. I think that the citeproc should splittitle
if that is all that is provided.With that in mind, several behaviors have to be defined:
title
if the data providestitle-main
andtitle-sub
(what delimiters to use)title
intotitle-main
andtitle-sub
There are several variations across styles that need to accommodated:
—
, Chicago does not; Chicago splits on; or,
and, or,
but most other styles do not);
instead of:
).With these in mind, here is my proposal:
title-main
andtitle-sub
as variables.title
can be provided as an array withfull
,main
, andsub
elements.sub
can be be an array with multiple subtitles.full
should always be specified totitle-main
andtitle-sub
are not supplied in the data, the citeproc will derive them fromtitle
following these rules (based on existing citeproc-js behavior):title-split
. Options for this attribute are:"simple"
: Matches.
,:
,::
,!
,?
"full"
: Matches the values for"simple"
, plus—
and;
"chicago"
: Matches the values for"simple"
, plus;
and[;,] or[,:]
;
. APA, e.g., doesn't clearly mention it, but every use a semicolon in a title I have seen is to delimit a subtitle.)"regular"
["full"
above] and"chicago"
if that would suffice.)title-main
is the text before the first delimiter.title-sub
is an array of the text following each delimiter.title
andtitle-main
are provided andtitle-main
matches the beginning oftitle
, only split the delimiter following thetitle-main
text if any. (This provides an override to prevent the standard splitting behavior if needed.)<text variable="title">
renderstitle-main
followed bytitle-sub
.title-delimiter
, a text string.title-sub
renders all of its elements, with the delimiter set by the inheritable attributetitle-sub-delimiter
(the same astitle-delimiter
if empty).<main>
and<sub>
control text styling for each part separately (e.g., ABNT rules abouttitle-main
in bold buttitle-sub
in regular face).cs:title
element sibling tocs:text
.normalize-sub-delimiter
is true,.
and:
delimiters are changed to the values specified bytitle-delimiter
andtitle-sub-delimiter
. Other delimiters are left unchanged.<text variable="title">
:text-case="title"
title casing is applied totitle-main
and each element oftitle-sub
text-case="capitalize-subtitle"
the first letter oftitle-main
and each element oftitle-sub
is capitalizedtitle
variables (container-
,collection-
,volume-
, etc.)Links to relevant citeproc-js behavior:
Originally posted by @bwiernik in citation-style-language/csl-evolution#31 (comment)