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