-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
input: Add experimental rich-text support (#315)
This adds an experimental csl-rich-text.yaml schema that defines a structure for rich-text formatting in JSON. Also adds a definition for rich-text variables, and title-string definitions that uses that variable, and then redefines all title and other fields to use these definitions. So it will be easy to merge the rich text support in the future. Addresses in part #278
- Loading branch information
Showing
2 changed files
with
76 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |