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