From 5756885fa9340f087a168d40c8d0d10a3a8fe4d5 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 25 Jun 2021 17:24:29 -0400 Subject: Structured content updates (#1753) * Update schema * Update content generation * Update styles * Update test data * Update style names --- .../schemas/dictionary-term-bank-v3-schema.json | 107 ++++++++++++++++++++- 1 file changed, 106 insertions(+), 1 deletion(-) (limited to 'ext/data') diff --git a/ext/data/schemas/dictionary-term-bank-v3-schema.json b/ext/data/schemas/dictionary-term-bank-v3-schema.json index fd3f3844..af4494ff 100644 --- a/ext/data/schemas/dictionary-term-bank-v3-schema.json +++ b/ext/data/schemas/dictionary-term-bank-v3-schema.json @@ -17,6 +17,20 @@ { "type": "object", "oneOf": [ + { + "type": "object", + "description": "Empty tags.", + "required": [ + "tag" + ], + "additionalProperties": false, + "properties": { + "tag": { + "type": "string", + "enum": ["br"] + } + } + }, { "type": "object", "description": "Generic container tags.", @@ -27,10 +41,58 @@ "properties": { "tag": { "type": "string", - "enum": ["ruby", "rt", "rp"] + "enum": ["ruby", "rt", "rp", "table", "thead", "tbody", "tfoot", "tr"] + }, + "content": { + "$ref": "#/definitions/structuredContent" + } + } + }, + { + "type": "object", + "description": "Table tags.", + "required": [ + "tag" + ], + "additionalProperties": false, + "properties": { + "tag": { + "type": "string", + "enum": ["td", "th"] + }, + "content": { + "$ref": "#/definitions/structuredContent" + }, + "colSpan": { + "type": "integer", + "minimum": 1 + }, + "rowSpan": { + "type": "integer", + "minimum": 1 + }, + "style": { + "$ref": "#/definitions/structuredContentStyle" + } + } + }, + { + "type": "object", + "description": "Container tags supporting configurable styles.", + "required": [ + "tag" + ], + "additionalProperties": false, + "properties": { + "tag": { + "type": "string", + "enum": ["span", "div"] }, "content": { "$ref": "#/definitions/structuredContent" + }, + "style": { + "$ref": "#/definitions/structuredContentStyle" } } }, @@ -112,6 +174,49 @@ ] } ] + }, + "structuredContentStyle": { + "type": "object", + "additionalProperties": false, + "properties": { + "fontStyle": { + "type": "string", + "enum": ["normal", "italic"], + "default": "normal" + }, + "fontWeight": { + "type": "string", + "enum": ["normal", "bold"], + "default": "normal" + }, + "fontSize": { + "type": "string", + "enum": ["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "xxx-large"], + "default": "medium" + }, + "textDecorationLine": { + "oneOf": [ + { + "type": "string", + "enum": ["none", "underline", "overline", "line-through"], + "default": "none" + }, + { + "type": "array", + "items": { + "type": "string", + "enum": ["underline", "overline", "line-through"], + "default": "none" + } + } + ] + }, + "verticalAlign": { + "type": "string", + "enum": ["baseline", "sub", "super", "text-top", "text-bottom", "middle", "top", "bottom"], + "default": "baseline" + } + } } }, "type": "array", -- cgit v1.2.3