v4.withref.json
171 lines
| 6.0 KiB
| application/json
|
JsonLexer
Jessica B. Hamrick
|
r16871 | { | ||
Jessica B. Hamrick
|
r16882 | "$schema": "http://json-schema.org/draft-03/schema#", | ||
"description": "IPython Notebook v4.0 JSON schema.", | ||||
"type": "object", | ||||
"additionalProperties": false, | ||||
"properties": { | ||||
"metadata": { | ||||
"description": "Notebook root-level metadata.", | ||||
"type": "object", | ||||
"required": true, | ||||
"additionalProperties": true, | ||||
"properties": { | ||||
"language": { | ||||
"description": "Language of the notebook's kernel.", | ||||
"type": "string", | ||||
"required": true | ||||
}, | ||||
"kernel_info": { | ||||
"description": "Other kernel information, to be determined." | ||||
"type": "object", | ||||
"required": true, | ||||
"additionalProperties": true | ||||
Jessica B. Hamrick
|
r16878 | } | ||
Jessica B. Hamrick
|
r16882 | } | ||
}, | ||||
"nbformat_minor": { | ||||
"description": "Notebook format (minor number). Incremented for slight changes to the notebook format.", | ||||
"type": "integer", | ||||
"required": true, | ||||
"minimum": 0 | ||||
}, | ||||
"nbformat": { | ||||
"description": "Notebook format (major number). Incremented between backwards incompatible changes to the notebook format.", | ||||
"type": "integer", | ||||
"required": true, | ||||
"minimum": 4 | ||||
}, | ||||
"orig_nbformat": { | ||||
"description": "Original notebook format (major number) before converting the notebook between versions.", | ||||
"type": "integer", | ||||
"required": false, | ||||
"minimum": 1 | ||||
}, | ||||
"cells": { | ||||
"description": "array of cells of the current notebook", | ||||
"type": "array", | ||||
"required": true, | ||||
"items": { | ||||
"type": [ | ||||
{"$ref": "#/definitions/text_cell"}, | ||||
{"$ref": "#/definitions/heading_cell"}, | ||||
{"$ref": "#/definitions/code_cell"} | ||||
] | ||||
Jessica B. Hamrick
|
r16871 | } | ||
} | ||||
}, | ||||
Jessica B. Hamrick
|
r16882 | "definitions": { | ||
"text_cell": { | ||||
"description": "Notebook text cell", | ||||
"type": "object", | ||||
"additionalProperties": false, | ||||
"properties": { | ||||
"cell_type": { | ||||
"description": "String identifying the type of cell", | ||||
"enum": ["markdown", "raw"], | ||||
Jessica B. Hamrick
|
r16874 | "required": true | ||
Jessica B. Hamrick
|
r16882 | }, | ||
"metadata": { | ||||
"description": "Cell-level metadata", | ||||
"type": "object", | ||||
"required": true, | ||||
"additionalProperties": true | ||||
}, | ||||
"source": { | ||||
"description": "Contents of the cell, represented as an array of lines (each terminated by \n)", | ||||
"type": "array", | ||||
"required": true, | ||||
"items": { | ||||
"type": "string", | ||||
"pattern": "^.*\n$" | ||||
} | ||||
Jessica B. Hamrick
|
r16874 | } | ||
Jessica B. Hamrick
|
r16871 | } | ||
Jessica B. Hamrick
|
r16882 | }, | ||
Jessica B. Hamrick
|
r16871 | |||
Jessica B. Hamrick
|
r16882 | "heading_cell": { | ||
"description": "Notebook heading cell", | ||||
"type": "object", | ||||
"additionalProperties": false, | ||||
"properties": { | ||||
"cell_type": { | ||||
"description": "String identifying the type of cell", | ||||
"enum": ["heading"], | ||||
Jessica B. Hamrick
|
r16874 | "required": true | ||
Jessica B. Hamrick
|
r16882 | }, | ||
"metadata": { | ||||
"description": "Cell-level metadata", | ||||
"type": "object", | ||||
"required": true, | ||||
"additionalProperties": true | ||||
}, | ||||
"source": { | ||||
"description": "Contents of the cell, represented as an array of lines (each terminated by \n)", | ||||
"type": "array", | ||||
"required": true, | ||||
"items": { | ||||
"type": "string", | ||||
"pattern": "^.*\n$" | ||||
} | ||||
}, | ||||
"level": { | ||||
"description": "Level of heading cells", | ||||
"type": "integer", | ||||
"required": false, | ||||
"minimum": 1, | ||||
"maximum": 6 | ||||
Jessica B. Hamrick
|
r16874 | } | ||
Jessica B. Hamrick
|
r16876 | } | ||
Jessica B. Hamrick
|
r16882 | }, | ||
"code_cell": { | ||||
"description": "Notebook code cell", | ||||
"type": "object", | ||||
"additionalProperties": false, | ||||
"properties": { | ||||
"cell_type": { | ||||
"description": "String identifying the type of cell", | ||||
"enum": ["code"], | ||||
"required": true | ||||
}, | ||||
"metadata": { | ||||
"description": "Cell-level metadata", | ||||
"type": "object", | ||||
"required": true, | ||||
"additionalProperties": true | ||||
}, | ||||
"source": { | ||||
"description": "Contents of the cell, represented as an array of lines (each terminated by \n)", | ||||
"type": "array", | ||||
"required": true, | ||||
"items": { | ||||
"type": "string", | ||||
"pattern": "^.*\n$" | ||||
} | ||||
} | ||||
"outputs": { | ||||
"description": "Outputs of cell, to be defined", | ||||
"type": "array", | ||||
"required": true | ||||
}, | ||||
"collapsed": { | ||||
"description": "Whether the cell is collapsed/expanded", | ||||
"type": "boolean", | ||||
"required": true | ||||
}, | ||||
"autoscroll": { | ||||
"description": "Whether the cell's output should autoscroll", | ||||
"type": "boolean", | ||||
"required": true | ||||
}, | ||||
"prompt_number": { | ||||
"type": ["integer", "null"], | ||||
"required": true, | ||||
"minimum": 0 | ||||
} | ||||
Jessica B. Hamrick
|
r16871 | } | ||
} | ||||
} | ||||
} | ||||