Skip to content
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

input: Change titles to objects #323

Merged
merged 5 commits into from
Jul 22, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 71 additions & 14 deletions schemas/input/csl-data.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"title": "CSL JSON/YAML",
"description": "JSON schema for CSL input data",
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://resource.citationstyles.org/schema/latest/input/json/csl-data.json",
Expand All @@ -7,6 +8,71 @@
"$ref": "#/definitions/refitem"
},
"definitions": {
"title-variable": {
"title": "Title variable",
"description": "Titles are represented as an object.",
"$ref": "#definitions/title-object"
},
"title-object": {
"title": "Title Object",
"type": "object",
"examples": [
{
"full": "Finis Coronat Opus: A Curious Reciprocity; Shelley’s “When the Lamp Is Shattered”",
"main": "Finis Coronat Opus",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where have settled on regarding punctuation? Shouldn't we include the colon in "main"?
"main": "Finis Coronat Opus: "
(Of course only if the colon appears in the original...)

Copy link
Member Author

@bdarcus bdarcus Jul 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping with the "let's keep simple things simple" approach, I think there should be a convention, for styles that require "original punctuation", to add a default delimiter if one doesn't exist, so that adding colons and such (by FAR the most common convention) shouldn't be necessary.

I think this should still work elegantly if someone wants to maintain their bibliographic database in CSL YAML.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. That might mean we will want to add an option normalize-delimiters="false". Then you could still add title-delimiter=": " to a style, which will then add a colon if no punctuation is present, but it will not override an existing period. (Exclamation marks and question marks will be protected anyway.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should title delimiters also be defined in locales?

Like, in English, would be a colon.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better not do this. If I use Chicago, I'll always want to have colons as title-subtitle-delimiter, even when writing in German. But a institutional style from a German university will perhaps use periods.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can allow it in a locale, but in one locale only so that there really is one standard delimiter (bit one per locale). Styles that require a different delimiter can still override this.

Copy link
Member Author

@bdarcus bdarcus Jul 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, we can just define colon as the default delimeter, and semi-colon as the default sub delimiter.

Copy link
Member

@denismaier denismaier Jul 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@georgd What do you think about this? I remember you've had doubts regarding localizing punctuation...

Copy link
Member Author

@bdarcus bdarcus Jul 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems his concern was about user experience; unexpected behavior.

I'd agree that should be an important consideration, but that this (default delimiters) should be a part of it.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@georgd What do you think about this? I remember you've had doubts regarding localizing punctuation...

My impression is that the delimiter is a locale-independent property of the style – at least I’ve never come across anything else. A style that requires colon in English will be used with colon in a German document as well, as @denismaier said. Localisation for special typographical conventions (like the space before colon in French) is not restricted to this case, likewise script specific localisation (e.g. ano teleia instead of colon in Greek script). That’s why I thought that a simple global property would be enough.

But what do you expect to do with non-latin titles? I suppose they’re currently not normalised?

"sub": "A Curious Reciprocity",
"sub-sub": "Shelley’s “When the Lamp Is Shattered”"
},
{
"main": "Whose Music?",
"sub": "A Sociology of Musical Language"
},
{
"main": "Pardon the Interruption",
"sub": "Goal Proximity, Perceived Spare Time, and Impatience"
},
{
"main": "England’s Monitor",
"alt": "The History of the Separation"
bdarcus marked this conversation as resolved.
Show resolved Hide resolved
},
{
"main": "Kriegstagebuch des Oberkommandos der Wehrmacht, 1940–1945",
"short": "Kriegstagebuch"
}
],
"properties": {
"full": {
"title": "Full Title",
"description": "The full title string for the item; should generally be redundant, as it's simply the main + the sub titles and/or alternate title.",
"$ref": "#definitions/rich-text-string"
},
"main": {
"title": "Main Title",
"description": "The primary title component for the item.",
"$ref": "#definitions/rich-text-string"
},
"sub": {
"title": "Sub-Title",
"description": "The sub-title component for the item.",
"$ref": "#definitions/rich-text-string"
},
"sub-sub": {
"title": "Sub-Sub Title",
"description": "The secondary subtitle component for the item. This is rarely used in practice, but see https://style.mla.org/punctuation-with-titles/.",
"$ref": "#definitions/rich-text-string"
},
"alternate": {
"title": "Alternate Title",
"description": "An alternative variant title. This is rarely used in practice, but see https://style.mla.org/punctuation-with-titles/.",
"$ref": "#definitions/rich-text-string"
},
"short": {
"title": "Short Title",
"description": "A short variant title component for the item.",
"$ref": "#definitions/rich-text-string"
}
}
},
"rich-text-string": {
"title": "Rich Text String",
"description": "A string that may include sub-string formatting for bold, italic, subscript, superscript, math, etc. The accompanying `csl-rich-text.yaml` schema defines experimental support for this in CSL JSON input.",
Expand Down Expand Up @@ -446,13 +512,10 @@
"type": ["string", "number"]
},
"collection-title": {
"type": "string"
"$ref": "#definitions/title-variable"
},
"container-title": {
"type": "string"
},
"container-title-short": {
"type": "string"
"$ref": "#definitions/title-variable"
},
"dimensions": {
"type": "string"
Expand Down Expand Up @@ -540,7 +603,7 @@
},
"original-title": {
"description": "[Deprecated - Use `original` related `title` property instead]",
"type": "string"
"$ref": "#definitions/title-variable"
},
"page": {
"type": ["string", "number"]
Expand Down Expand Up @@ -596,16 +659,10 @@
"type": ["string", "number"]
},
"title": {
"type": "string"
},
"title-short": {
"type": "string"
"$ref": "#definitions/title-variable"
},
"translated-title": {
"type": "string"
},
"translated-title-short": {
"type": "string"
"$ref": "#definitions/title-variable"
},
"URL": {
"type": "string"
Expand Down