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: rich text #315

Merged
merged 1 commit into from
Jul 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
34 changes: 22 additions & 12 deletions schemas/input/csl-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@
"$ref": "#/definitions/date-variable"
},
"abstract": {
"type": "string"
"$ref": "#/definitions/rich-text-string"
},
"annote": {
"type": "string"
"$ref": "#/definitions/rich-text-string"
},
"archive": {
"type": "string"
Expand Down Expand Up @@ -257,13 +257,13 @@
"type": ["string", "number"]
},
"collection-title": {
"type": "string"
"$ref": "#/definitions/title-string"
},
"container-title": {
"type": "string"
"$ref": "#/definitions/title-string"
},
"container-title-short": {
"type": "string"
"$ref": "#/definitions/title-string"
},
"dimensions": {
"type": "string"
Expand Down Expand Up @@ -344,7 +344,7 @@
"type": "string"
},
"original-title": {
"type": "string"
"$ref": "#/definitions/title-string"
},
"page": {
"type": ["string", "number"]
Expand All @@ -356,7 +356,7 @@
"type": ["string", "number"]
},
"part-title": {
"type": "string"
"$ref": "#/definitions/title-string"
},
"PMCID": {
"type": "string"
Expand All @@ -377,7 +377,7 @@
"type": "string"
},
"reviewed-title": {
"type": "string"
"$ref": "#/definitions/title-string"
},
"scale": {
"type": "string"
Expand All @@ -395,16 +395,16 @@
"type": ["string", "number"]
},
"title": {
"type": "string"
"$ref": "#/definitions/title-string"
},
"title-short": {
"type": "string"
"$ref": "#/definitions/title-string"
},
"translated-title": {
"type": "string"
"$ref": "#/definitions/title-string"
},
"translated-title-short": {
"type": "string"
"$ref": "#/definitions/title-string"
},
"URL": {
"type": "string"
Expand Down Expand Up @@ -437,6 +437,16 @@
"additionalProperties": false
},
"definitions": {
"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.",
"type": "string"
},
"title-string": {
"title": "Title String",
"description": "Titles are a primary example of rich text strings in CSL.",
"$ref": "#definitions/rich-text-string"
},
"edtf-string": {
"title": "EDTF date string",
"description": "CSL input supports EDTF, levels 0 and 1.",
Expand Down
54 changes: 54 additions & 0 deletions schemas/input/csl-rich-text.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
description: JSON schema for CSL input rich text representation
"$schema": http://json-schema.org/draft-07/schema#
"$id": https://resource.citationstyles.org/schema/latest/input/json/csl-rich-text.json
definitions:
rich-text-content:
title: Rich Text Content
description: Rich text content can be represented as an array of strings and formatted object strings.
examples:
- title:
- A title with a
- quote: quoted string.
- title:
- A title with tex math
- math-tex: x=y^2
- title:
- A title with mathml
- math-ml: x=y^2
oneOf:
- "$ref": "#/definitions/rich-text"
- type: string
rich-text:
type: array
items:
anyOf:
- title: Unformatted Sub-String
type: string
- bold:
title: Bold Text
"#ref": "#/definitions/rich-text-content"
- code:
title: Code/Verbatim Text
"#ref": "#/definitions/rich-text-content"
- italic:
title: Italicized Text
"#ref": "#/definitions/rich-text-content"
- math-ml:
title: MathML
"#ref": "#/definitions/rich-text-content"
- math-tex:
title: Math-TeX
"#ref": "#/definitions/rich-text-content"
- preserve:
title: Preserve Case Text
"#ref": "#/definitions/rich-text-content"
- quote:
title: Quote
"#ref": "#/definitions/rich-text-content"
- sc:
title: Small-Cap Text
"#ref": "#/definitions/rich-text-content"
- strike:
title: Strike-Through Text
"#ref": "#/definitions/rich-text-content"