##// END OF EJS Templates
refactor to improve cell switching in edit mode...
refactor to improve cell switching in edit mode This code was repeated in both CodeCell and TextCell, both of which are extensions of Cell, so this just unifies the logic in Cell. TextCell had logic here to check if the cell was rendered or not, but I don't believe it is possible to end up triggering such a code path. (Should that be required, I can always just add back these methods to TextCell, performing the .rendered==True check, and calling the Cell prior to this, code mirror at_top would only return true on if the cursor was at the first character of the top line. Now, pressing up arrow on any character on the top line will take you to the cell above. The same applies for the bottom line. Pressing down arrow would only go to the next cell if the cursor was at a location *after* the last character (something that is only possible to achieve in vim mode if the last line is empty, for example). Now, down arrow on any character of the last line will go to the next cell.

File last commit:

r8525:61ef7793
r15754:d60e793e
Show More
v3.withref.json
171 lines | 4.7 KiB | application/json | JsonLexer
{
"description": "custom json structure with references to generate notebook schema",
"notebook":{
"type": "object",
"description": "notebook v3.0 root schema",
"$schema": "http://json-schema.org/draft-03/schema",
"id": "#notebook",
"required": true,
"additionalProperties": false,
"properties":{
"metadata": {
"type": "object",
"id": "metadata",
"required": true,
"description": "the metadata atribute can contain any additionnal information",
"additionalProperties": true,
"properties":{
"name": {
"id": "name",
"description": "the title of the notebook",
"type": "string",
"id": "name",
"required": true
}
}
},
"nbformat_minor": {
"description": "Notebook format, minor number. Incremented for slight variation of notebook format.",
"type": "integer",
"minimum": 0,
"id": "nbformat_minor",
"required": true
},
"nbformat": {
"description": "Notebook format, major number. Incremented between backward incompatible change is introduced.",
"type": "integer",
"minimum": 3,
"id": "nbformat",
"required": true
},
"worksheets": {
"description": "Array of worksheet, not used by the current implementation of ipython yet",
"type": "array",
"id": "worksheets",
"required": true,
"items": {"$ref": "/worksheet"}
}
}
},
"worksheet": {
"additionalProperties": false,
"properties":{
"cells": {
"type": "array",
"$schema": "http://json-schema.org/draft-03/schema",
"description": "array of cells of the current worksheet",
"id": "#cells",
"required": true,
"items": {"$ref": "/any_cell"}
},
"metadata": {
"type": "object",
"description": "metadata of the current worksheet",
"id": "metadata",
"required": true
}
}
},
"text_cell": {
"type": "object",
"description": "scheme for text cel and childrenm (level only optionnal argument for HEader cell)",
"$schema": "http://json-schema.org/draft-03/schema",
"id": "#cell",
"required": true,
"additionalProperties": false,
"properties":{
"cell_type": {
"type": "string",
"id": "cell_type",
"required": true
},
"level": {
"type": "integer",
"minimum": 1,
"maximum": 6,
"id": "level",
"required": false
},
"metadata": {
"type": "object",
"id": "metadata",
"required": true
},
"source": {
"description": "for code cell, the source code",
"type": "array",
"id": "source",
"required": true,
"items":
{
"type": "string",
"description": "each item represent one line of the source code written, terminated by \n",
"id": "0",
"required": true
}
}
}
},
"any_cell": {
"description": "Meta cell type that match any cell type",
"type": [{"$ref": "/text_cell"},{"$ref":"/code_cell"}],
"$schema": "http://json-schema.org/draft-03/schema"
},
"code_cell":{
"type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
"description": "Cell used to execute code",
"id": "#cell",
"required": true,
"additionalProperties": false,
"properties":{
"cell_type": {
"type": "string",
"id": "cell_type",
"required": true
},
"metadata": {
"type": "object",
"id": "metadata",
"required": true
},
"collapsed": {
"type": "boolean",
"required": true
},
"input": {
"description": "user input for text cells",
"type": "array",
"id": "input",
"required": true,
"items":
{
"type": "string",
"id": "input",
"required": true
}
},
"outputs": {
"description": "output for code cell, to be definied",
"required": true,
"type": "array"
},
"prompt_number": {
"type": ["integer","null"],
"required": true,
"minimum": 0
},
"language": {
"type": "string",
"required": true
}
}
}
}