##// END OF EJS Templates
validate codemirror_mode
Min RK -
Show More
@@ -1,331 +1,334 b''
1 1 {
2 2 "$schema": "http://json-schema.org/draft-04/schema#",
3 3 "description": "IPython Notebook v4.0 JSON schema.",
4 4 "type": "object",
5 5 "additionalProperties": false,
6 6 "required": ["metadata", "nbformat_minor", "nbformat", "cells"],
7 7 "properties": {
8 8 "metadata": {
9 9 "description": "Notebook root-level metadata.",
10 10 "type": "object",
11 11 "additionalProperties": true,
12 12 "properties": {
13 13 "kernelspec": {
14 14 "description": "Kernel information.",
15 15 "type": "object",
16 16 "required": ["name", "display_name"],
17 17 "properties": {
18 18 "name": {
19 19 "description": "Name of the kernel specification.",
20 20 "type": "string"
21 21 },
22 22 "display_name": {
23 23 "description": "Name to display in UI.",
24 24 "type": "string"
25 25 }
26 26 }
27 27 },
28 28 "language_info": {
29 29 "description": "Kernel information.",
30 30 "type": "object",
31 31 "required": ["name"],
32 32 "properties": {
33 33 "name": {
34 34 "description": "The programming language which this kernel runs.",
35 35 "type": "string"
36 36 },
37 37 "codemirror_mode": {
38 38 "description": "The codemirror mode to use for code in this language.",
39 "type": "string"
39 "oneOf": [
40 {"type": "string"},
41 {"type": "object"}
42 ]
40 43 },
41 44 "file_extension": {
42 45 "description": "The file extension for files in this language.",
43 46 "type": "string"
44 47 },
45 48 "mimetype": {
46 49 "description": "The mimetype corresponding to files in this language.",
47 50 "type": "string"
48 51 },
49 52 "pygments_lexer": {
50 53 "description": "The pygments lexer to use for code in this language.",
51 54 "type": "string"
52 55 }
53 56 }
54 57 },
55 58 "signature": {
56 59 "description": "Hash of the notebook.",
57 60 "type": "string"
58 61 },
59 62 "orig_nbformat": {
60 63 "description": "Original notebook format (major number) before converting the notebook between versions. This should never be written to a file.",
61 64 "type": "integer",
62 65 "minimum": 1
63 66 }
64 67 }
65 68 },
66 69 "nbformat_minor": {
67 70 "description": "Notebook format (minor number). Incremented for backward compatible changes to the notebook format.",
68 71 "type": "integer",
69 72 "minimum": 0
70 73 },
71 74 "nbformat": {
72 75 "description": "Notebook format (major number). Incremented between backwards incompatible changes to the notebook format.",
73 76 "type": "integer",
74 77 "minimum": 4,
75 78 "maximum": 4
76 79 },
77 80 "cells": {
78 81 "description": "Array of cells of the current notebook.",
79 82 "type": "array",
80 83 "items": {
81 84 "type": "object",
82 85 "oneOf": [
83 86 {"$ref": "#/definitions/raw_cell"},
84 87 {"$ref": "#/definitions/markdown_cell"},
85 88 {"$ref": "#/definitions/code_cell"}
86 89 ]
87 90 }
88 91 }
89 92 },
90 93
91 94 "definitions": {
92 95
93 96 "raw_cell": {
94 97 "description": "Notebook raw nbconvert cell.",
95 98 "type": "object",
96 99 "additionalProperties": false,
97 100 "required": ["cell_type", "metadata", "source"],
98 101 "properties": {
99 102 "cell_type": {
100 103 "description": "String identifying the type of cell.",
101 104 "enum": ["raw"]
102 105 },
103 106 "metadata": {
104 107 "description": "Cell-level metadata.",
105 108 "type": "object",
106 109 "additionalProperties": true,
107 110 "properties": {
108 111 "format": {
109 112 "description": "Raw cell metadata format for nbconvert.",
110 113 "type": "string"
111 114 },
112 115 "name": {"$ref": "#/definitions/misc/metadata_name"},
113 116 "tags": {"$ref": "#/definitions/misc/metadata_tags"}
114 117 }
115 118 },
116 119 "source": {"$ref": "#/definitions/misc/source"}
117 120 }
118 121 },
119 122
120 123 "markdown_cell": {
121 124 "description": "Notebook markdown cell.",
122 125 "type": "object",
123 126 "additionalProperties": false,
124 127 "required": ["cell_type", "metadata", "source"],
125 128 "properties": {
126 129 "cell_type": {
127 130 "description": "String identifying the type of cell.",
128 131 "enum": ["markdown"]
129 132 },
130 133 "metadata": {
131 134 "description": "Cell-level metadata.",
132 135 "type": "object",
133 136 "properties": {
134 137 "name": {"$ref": "#/definitions/misc/metadata_name"},
135 138 "tags": {"$ref": "#/definitions/misc/metadata_tags"}
136 139 },
137 140 "additionalProperties": true
138 141 },
139 142 "source": {"$ref": "#/definitions/misc/source"}
140 143 }
141 144 },
142 145
143 146 "code_cell": {
144 147 "description": "Notebook code cell.",
145 148 "type": "object",
146 149 "additionalProperties": false,
147 150 "required": ["cell_type", "metadata", "source", "outputs", "execution_count"],
148 151 "properties": {
149 152 "cell_type": {
150 153 "description": "String identifying the type of cell.",
151 154 "enum": ["code"]
152 155 },
153 156 "metadata": {
154 157 "description": "Cell-level metadata.",
155 158 "type": "object",
156 159 "additionalProperties": true,
157 160 "properties": {
158 161 "collapsed": {
159 162 "description": "Whether the cell is collapsed/expanded.",
160 163 "type": "boolean"
161 164 },
162 165 "autoscroll": {
163 166 "description": "Whether the cell's output is scrolled, unscrolled, or autoscrolled.",
164 167 "enum": [true, false, "auto"]
165 168 },
166 169 "name": {"$ref": "#/definitions/misc/metadata_name"},
167 170 "tags": {"$ref": "#/definitions/misc/metadata_tags"}
168 171 }
169 172 },
170 173 "source": {"$ref": "#/definitions/misc/source"},
171 174 "outputs": {
172 175 "description": "Execution, display, or stream outputs.",
173 176 "type": "array",
174 177 "items": {"$ref": "#/definitions/output"}
175 178 },
176 179 "execution_count": {
177 180 "description": "The code cell's prompt number. Will be null if the cell has not been run.",
178 181 "type": ["integer", "null"],
179 182 "minimum": 0
180 183 }
181 184 }
182 185 },
183 186 "output": {
184 187 "type": "object",
185 188 "oneOf": [
186 189 {"$ref": "#/definitions/execute_result"},
187 190 {"$ref": "#/definitions/display_data"},
188 191 {"$ref": "#/definitions/stream"},
189 192 {"$ref": "#/definitions/error"}
190 193 ]
191 194 },
192 195
193 196 "execute_result": {
194 197 "description": "Result of executing a code cell.",
195 198 "type": "object",
196 199 "additionalProperties": false,
197 200 "required": ["output_type", "data", "metadata", "execution_count"],
198 201 "properties": {
199 202 "output_type": {
200 203 "description": "Type of cell output.",
201 204 "enum": ["execute_result"]
202 205 },
203 206 "execution_count": {
204 207 "description": "A result's prompt number.",
205 208 "type": ["integer", "null"],
206 209 "minimum": 0
207 210 },
208 211 "data": {"$ref": "#/definitions/misc/mimebundle"},
209 212 "metadata": {"$ref": "#/definitions/misc/output_metadata"}
210 213 }
211 214 },
212 215
213 216 "display_data": {
214 217 "description": "Data displayed as a result of code cell execution.",
215 218 "type": "object",
216 219 "additionalProperties": false,
217 220 "required": ["output_type", "data", "metadata"],
218 221 "properties": {
219 222 "output_type": {
220 223 "description": "Type of cell output.",
221 224 "enum": ["display_data"]
222 225 },
223 226 "data": {"$ref": "#/definitions/misc/mimebundle"},
224 227 "metadata": {"$ref": "#/definitions/misc/output_metadata"}
225 228 }
226 229 },
227 230
228 231 "stream": {
229 232 "description": "Stream output from a code cell.",
230 233 "type": "object",
231 234 "additionalProperties": false,
232 235 "required": ["output_type", "name", "text"],
233 236 "properties": {
234 237 "output_type": {
235 238 "description": "Type of cell output.",
236 239 "enum": ["stream"]
237 240 },
238 241 "name": {
239 242 "description": "The name of the stream (stdout, stderr).",
240 243 "type": "string"
241 244 },
242 245 "text": {
243 246 "description": "The stream's text output, represented as an array of strings.",
244 247 "$ref": "#/definitions/misc/multiline_string"
245 248 }
246 249 }
247 250 },
248 251
249 252 "error": {
250 253 "description": "Output of an error that occurred during code cell execution.",
251 254 "type": "object",
252 255 "additionalProperties": false,
253 256 "required": ["output_type", "ename", "evalue", "traceback"],
254 257 "properties": {
255 258 "output_type": {
256 259 "description": "Type of cell output.",
257 260 "enum": ["error"]
258 261 },
259 262 "ename": {
260 263 "description": "The name of the error.",
261 264 "type": "string"
262 265 },
263 266 "evalue": {
264 267 "description": "The value, or message, of the error.",
265 268 "type": "string"
266 269 },
267 270 "traceback": {
268 271 "description": "The error's traceback, represented as an array of strings.",
269 272 "type": "array",
270 273 "items": {"type": "string"}
271 274 }
272 275 }
273 276 },
274 277
275 278 "misc": {
276 279 "metadata_name": {
277 280 "description": "The cell's name. If present, must be a non-empty string.",
278 281 "type": "string",
279 282 "pattern": "^.+$"
280 283 },
281 284 "metadata_tags": {
282 285 "description": "The cell's tags. Tags must be unique, and must not contain commas.",
283 286 "type": "array",
284 287 "uniqueItems": true,
285 288 "items": {
286 289 "type": "string",
287 290 "pattern": "^[^,]+$"
288 291 }
289 292 },
290 293 "source": {
291 294 "description": "Contents of the cell, represented as an array of lines.",
292 295 "$ref": "#/definitions/misc/multiline_string"
293 296 },
294 297 "execution_count": {
295 298 "description": "The code cell's prompt number. Will be null if the cell has not been run.",
296 299 "type": ["integer", "null"],
297 300 "minimum": 0
298 301 },
299 302 "mimebundle": {
300 303 "description": "A mime-type keyed dictionary of data",
301 304 "type": "object",
302 305 "additionalProperties": false,
303 306 "properties": {
304 307 "application/json": {
305 308 "type": "object"
306 309 }
307 310 },
308 311 "patternProperties": {
309 312 "^(?!application/json$)[a-zA-Z0-9]+/[a-zA-Z0-9\\-\\+\\.]+$": {
310 313 "description": "mimetype output (e.g. text/plain), represented as either an array of strings or a string.",
311 314 "$ref": "#/definitions/misc/multiline_string"
312 315 }
313 316 }
314 317 },
315 318 "output_metadata": {
316 319 "description": "Cell output metadata.",
317 320 "type": "object",
318 321 "additionalProperties": true
319 322 },
320 323 "multiline_string": {
321 324 "oneOf" : [
322 325 {"type": "string"},
323 326 {
324 327 "type": "array",
325 328 "items": {"type": "string"}
326 329 }
327 330 ]
328 331 }
329 332 }
330 333 }
331 334 }
General Comments 0
You need to be logged in to leave comments. Login now