##// END OF EJS Templates
Flesh out output types
Flesh out output types

File last commit:

r16889:95a25aae
r16889:95a25aae
Show More
v4.withref.json
307 lines | 11.2 KiB | application/json | JsonLexer
{
"$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
},
"signature": {
"description": "SHA256 hash of the notebook.",
"type": "string",
"required": true,
"pattern": "^sha256:[0-9a-f]{64}$"
}
}
},
"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/raw_cell"},
{"$ref": "/definitions/markdown_cell"},
{"$ref": "/definitions/heading_cell"},
{"$ref": "/definitions/code_cell"}
]
}
}
},
"definitions": {
"raw_cell": {
"description": "Notebook raw nbconvert cell.",
"type": "object",
"additionalProperties": false,
"properties": {
"cell_type": {
"description": "String identifying the type of cell.",
"enum": ["raw"],
"required": true
},
"metadata": {
"description": "Cell-level metadata.",
"type": "object",
"required": true,
"additionalProperties": true,
"properties": {
"format": {
"description": "Raw cell format, to be determined.",
"type": "string",
"required": false
}
}
},
"source": {
"description": "Contents of the cell, represented as an array of lines.",
"type": "array",
"required": true,
"items": {"type": "string"}
}
}
},
"markdown_cell": {
"description": "Notebook markdown cell.",
"type": "object",
"additionalProperties": false,
"properties": {
"cell_type": {
"description": "String identifying the type of cell.",
"enum": ["markdown"],
"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.",
"type": "array",
"required": true,
"items": {"type": "string"}
}
}
},
"heading_cell": {
"description": "Notebook heading cell.",
"type": "object",
"additionalProperties": false,
"properties": {
"cell_type": {
"description": "String identifying the type of cell.",
"enum": ["heading"],
"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.",
"type": "array",
"required": true,
"items": {"type": "string"}
},
"level": {
"description": "Level of heading cells.",
"type": "integer",
"required": true,
"minimum": 1,
"maximum": 6
}
}
},
"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.",
"type": "array",
"required": true,
"items": {"type": "string"}
},
"outputs": {
"description": "Outputs of cell, to be defined.",
"type": "array",
"required": true,
"items": [
{"$ref": "/definitions/pyout_output"}
{"$ref": "/definitions/display_data_output"}
{"$ref": "/definitions/stream_output"}
]
},
"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": {
"description": "The code cell's prompt number. Will be null if the cell has not been run.",
"type": ["integer", "null"],
"required": true,
"minimum": 0
}
}
},
"pyout_output": {
"description": "Result of executing a code cell.",
"type": "object",
"properties": {
"output_type": {
"description": "Type of cell output.",
"enum": ["pyout"],
"required": true
},
"metadata": {
"description": "Cell output metadata.",
"type": "object",
"required": true,
"additionalProperties": true
},
"prompt_number": {
"description": "The code cell's prompt number. Will be null if the cell has not been run.",
"type": ["integer", "null"],
"required": true,
"minimum": 0
}
"text": {
"description": "The cell's text output, represented as an array of strings.",
"type": "array",
"required": false,
"items": {"type": "string"}
},
"html": {
"description": "The cell's html output, represented as an array of strings.",
"type": "array",
"required": false,
"items": {"type": "string"}
},
"png": {
"description": "The cell's png output.",
"type": "string",
"required": false,
}
}
},
"display_data_output": {
"description": "Display data output from a code cell.",
"type": "object",
"properties": {
"output_type": {
"description": "Type of cell output.",
"enum": ["display_data"],
"required": true
},
"metadata": {
"description": "Cell output metadata.",
"type": "object",
"required": true,
"additionalProperties": true
},
"text": {
"description": "The display data text output, represented as an array of strings.",
"type": "array",
"required": false,
"items": {"type": "string"}
},
"javascript": {
"description": "The cell's javascript output, represented as an array of strings.",
"type": "array",
"required": false,
"items": {"type": "string"}
},
}
},
"stream_output": {
"description": "Stream output from a code cell.",
"type": "object",
"properties": {
"output_type": {
"description": "Type of cell output.",
"enum": ["stream"],
"required": true
},
"metadata": {
"description": "Cell output metadata.",
"type": "object",
"required": true,
"additionalProperties": true
},
"stream": {
"description": "The stream type/destination.",
"type": "string",
"required": true
},
"text": {
"description": "The stream's text output, represented as an array of strings.",
"type": "array",
"required": false,
"items": {"type": "string"}
}
}
}
}
}