1 | {
|
2 | "title": "List",
|
3 | "@id": "schema:ItemList",
|
4 | "extends": "Entity",
|
5 | "category": "text",
|
6 | "role": "secondary",
|
7 | "status": "stable",
|
8 | "description": "A list of items.",
|
9 | "$comment": "This is an implementation, and renaming, of schema.org [`ItemList`](https://schema.org/ItemList).\nRenaming was done as `List` was considered a more developer friendly alternative. Similarly,\nschema.org properties `itemListElement` and `itemListOrder` were renamed to `items` and `order`.\nNote that, as with every other such renaming in Stencila Schema, a mapping between names is\ndefined and it is trivial to save Stencila Schema documents using the schema.org vocabulary if so desired.\n\nAnalogues of `List` in other schema include:\n - JATS XML [`<list>`](https://jats.nlm.nih.gov/articleauthoring/tag-library/1.2/element/list.html)\n - HTML [`<ul>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul) and [`<ol>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol)\n - MDAST [`List`](https://github.com/syntax-tree/mdast#list)\n - OpenDocument [`<text:list>`](http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415148_253892949)\n",
|
10 | "properties": {
|
11 | "type": {
|
12 | "@id": "schema:type",
|
13 | "description": "The name of the type.",
|
14 | "type": "string",
|
15 | "enum": [
|
16 | "List"
|
17 | ],
|
18 | "default": "List",
|
19 | "from": "Entity"
|
20 | },
|
21 | "id": {
|
22 | "@id": "schema:id",
|
23 | "description": "The identifier for this item.",
|
24 | "type": "string",
|
25 | "from": "Entity"
|
26 | },
|
27 | "meta": {
|
28 | "@id": "stencila:meta",
|
29 | "description": "Metadata associated with this item.",
|
30 | "type": "object",
|
31 | "from": "Entity"
|
32 | },
|
33 | "items": {
|
34 | "@id": "schema:itemListElement",
|
35 | "description": "The items in the list",
|
36 | "type": "array",
|
37 | "items": {
|
38 | "$ref": "ListItem.schema.json"
|
39 | },
|
40 | "from": "List",
|
41 | "isArray": true,
|
42 | "isPlural": true,
|
43 | "aliases": [
|
44 | "item"
|
45 | ]
|
46 | },
|
47 | "order": {
|
48 | "@id": "schema:itemListOrder",
|
49 | "description": "Type of ordering.",
|
50 | "enum": [
|
51 | "Ascending",
|
52 | "Descending",
|
53 | "Unordered"
|
54 | ],
|
55 | "default": "unordered",
|
56 | "from": "List"
|
57 | }
|
58 | },
|
59 | "required": [
|
60 | "type",
|
61 | "items"
|
62 | ],
|
63 | "examples": [
|
64 | {
|
65 | "type": "List",
|
66 | "items": [
|
67 | {
|
68 | "type": "ListItem",
|
69 | "content": [
|
70 | "Item One"
|
71 | ]
|
72 | },
|
73 | {
|
74 | "type": "ListItem",
|
75 | "content": [
|
76 | "Item Two"
|
77 | ]
|
78 | },
|
79 | {
|
80 | "type": "ListItem",
|
81 | "content": [
|
82 | "Item Three"
|
83 | ]
|
84 | }
|
85 | ]
|
86 | },
|
87 | {
|
88 | "type": "List",
|
89 | "items": [
|
90 | {
|
91 | "type": "ListItem",
|
92 | "content": "Item One"
|
93 | },
|
94 | {
|
95 | "type": "ListItem",
|
96 | "content": [
|
97 | "This is a nested item",
|
98 | {
|
99 | "type": "List",
|
100 | "order": "ordered",
|
101 | "items": [
|
102 | {
|
103 | "type": "ListItem",
|
104 | "content": [
|
105 | "Nested Item One"
|
106 | ]
|
107 | },
|
108 | {
|
109 | "type": "ListItem",
|
110 | "content": [
|
111 | "Nested Item Two"
|
112 | ]
|
113 | },
|
114 | {
|
115 | "type": "ListItem",
|
116 | "content": [
|
117 | "Nested Item Three"
|
118 | ]
|
119 | }
|
120 | ]
|
121 | }
|
122 | ]
|
123 | },
|
124 | {
|
125 | "type": "ListItem",
|
126 | "content": [
|
127 | "Item Three"
|
128 | ]
|
129 | }
|
130 | ]
|
131 | },
|
132 | {
|
133 | "type": "List",
|
134 | "items": [
|
135 | {
|
136 | "type": "ListItem",
|
137 | "checked": false,
|
138 | "content": [
|
139 | "Todo item"
|
140 | ]
|
141 | },
|
142 | {
|
143 | "type": "ListItem",
|
144 | "checked": true,
|
145 | "content": [
|
146 | "Completed todo item"
|
147 | ]
|
148 | }
|
149 | ]
|
150 | }
|
151 | ],
|
152 | "file": "List.schema.yaml",
|
153 | "children": [],
|
154 | "descendants": [],
|
155 | "$schema": "http://json-schema.org/draft-07/schema#",
|
156 | "$id": "https://schema.stenci.la/v1/List.schema.json",
|
157 | "source": "https://github.com/stencila/schema/blob/master/schema/List.schema.yaml",
|
158 | "type": "object",
|
159 | "propertyAliases": {
|
160 | "item": "items"
|
161 | },
|
162 | "additionalProperties": false
|
163 | }
|