edit

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	Kind     CellKind       `json:"kind"`
	Value    string         `json:"value"`
	LangID   string         `json:"languageId"`
	Metadata map[string]any `json:"metadata,omitempty"`
}

Cell resembles NotebookCellData from VS Code. https://github.com/microsoft/vscode/blob/085c409898bbc89c83409f6a394e73130b932add/src/vscode-dts/vscode.d.ts#L13715

type CellKind

type CellKind int
const (
	MarkupKind CellKind = iota + 1
	CodeKind
)

type Editor

type Editor struct{}

func New

func New() *Editor

func (*Editor) Deserialize

func (e *Editor) Deserialize(data []byte) (*Notebook, error)

func (*Editor) Serialize

func (e *Editor) Serialize(notebook *Notebook) ([]byte, error)

type Notebook

type Notebook struct {
	Cells    []*Cell        `json:"cells"`
	Metadata map[string]any `json:"metadata,omitempty"`
}

Notebook resembles NotebookData form VS Code. https://github.com/microsoft/vscode/blob/085c409898bbc89c83409f6a394e73130b932add/src/vscode-dts/vscode.d.ts#L13767

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL