NotebookDocument
interfaceRepresents a notebook which itself is a sequence of code or markup cells. Notebook documents are created from notebook data.
Import
import { NotebookDocument } from '@modular/sdk/editor';Members11
- cellCount
numberThe number of cells in the notebook.
- isClosed
boolean`true` if the notebook has been closed. A closed notebook isn't synchronized anymore and won't be re-used when the same resource is opened again.
- isDirty
boolean`true` if there are unpersisted changes.
- isUntitled
booleanIs this notebook representing an untitled file which has not been saved yet.
- metadata
{ [key: string]: any; }Arbitrary metadata for this notebook. Can be anything but must be JSON-stringifyable.
- notebookType
stringThe type of notebook.
- uri
UriThe associated uri for this notebook. *Note* that most notebooks use the `file`-scheme, which means they are files on disk. However, **not** all notebooks are saved on disk and therefore the `scheme` must be checked before trying to access the underlying file or siblings on disk.
- version
numberThe version number of this notebook (it will strictly increase after each change, including undo/redo).
- cellAt()
(index: number) => NotebookCellReturn the cell at the specified index. The index will be adjusted to the notebook.
- getCells()
(range?: NotebookRange) => NotebookCell[]Get the cells of this notebook. A subset can be retrieved by providing a range. The range will be adjusted to the notebook.
- save()
() => Thenable<boolean>Save the document. The saving will be handled by the corresponding serializer.