thebe-core / Exports / ThebeNotebook

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new ThebeNotebook(id, config, rendermime?)

Parameters

NameType
idstring
configConfig
rendermime?IRenderMimeRegistry

Defined in

packages/core/src/notebook.ts:33

Properties

cells

cells: IThebeCell[]

Defined in

packages/core/src/notebook.ts:28


events

Protected events: EventEmitter

Defined in

packages/core/src/notebook.ts:31


id

Readonly id: string

Defined in

packages/core/src/notebook.ts:26


metadata

metadata: INotebookMetadata

Defined in

packages/core/src/notebook.ts:29


rendermime

Readonly rendermime: IRenderMimeRegistry

Defined in

packages/core/src/notebook.ts:27


session

Optional session: ThebeSession

Defined in

packages/core/src/notebook.ts:30

Accessors

last

get last(): IThebeCell

Returns

IThebeCell

Defined in

packages/core/src/notebook.ts:79


parameters

get parameters(): undefined | IThebeCell[]

Returns

undefined | IThebeCell[]

Defined in

packages/core/src/notebook.ts:68


widgets

get widgets(): IThebeCell[]

Returns

IThebeCell[]

Defined in

packages/core/src/notebook.ts:75

Methods

attachSession

attachSession(session): void

Parameters

NameType
sessionThebeSession

Returns

void

Defined in

packages/core/src/notebook.ts:122


clear

clear(): void

Returns

void

Defined in

packages/core/src/notebook.ts:145


detachSession

detachSession(): void

Returns

void

Defined in

packages/core/src/notebook.ts:135


executeAll

executeAll(stopOnError?, preprocessor?): Promise<(null | ExecuteReturn)[]>

Parameters

NameTypeDefault value
stopOnErrorbooleanfalse
preprocessor?(s: string) => stringundefined

Returns

Promise<(null | ExecuteReturn)[]>

Defined in

packages/core/src/notebook.ts:238


executeCells

executeCells(cellIds, stopOnError?, preprocessor?): Promise<(null | ExecuteReturn)[]>

Parameters

NameTypeDefault value
cellIdsstring[]undefined
stopOnErrorbooleanfalse
preprocessor?(s: string) => stringundefined

Returns

Promise<(null | ExecuteReturn)[]>

Defined in

packages/core/src/notebook.ts:195


executeOnly

executeOnly(cellId, preprocessor?): Promise<null | ExecuteReturn>

Parameters

NameType
cellIdstring
preprocessor?(s: string) => string

Returns

Promise<null | ExecuteReturn>

Defined in

packages/core/src/notebook.ts:177


executeUpTo

executeUpTo(cellId, stopOnError?, preprocessor?): Promise<(null | ExecuteReturn)[]>

Parameters

NameTypeDefault value
cellIdstringundefined
stopOnErrorbooleanfalse
preprocessor?(s: string) => stringundefined

Returns

Promise<(null | ExecuteReturn)[]>

Defined in

packages/core/src/notebook.ts:149


findCells

findCells(tag): undefined | IThebeCell[]

Parameters

NameType
tagstring

Returns

undefined | IThebeCell[]

Defined in

packages/core/src/notebook.ts:88


getCell

getCell(idx): IThebeCell

Parameters

NameType
idxnumber

Returns

IThebeCell

Defined in

packages/core/src/notebook.ts:93


getCellById

getCellById(id): undefined | IThebeCell

Parameters

NameType
idstring

Returns

undefined | IThebeCell

Defined in

packages/core/src/notebook.ts:100


lastCell

lastCell(): IThebeCell

Returns

IThebeCell

Defined in

packages/core/src/notebook.ts:105


numCells

numCells(): number

Returns

number

Defined in

packages/core/src/notebook.ts:84


updateParameters

updateParameters(newSource, interpolate?): void

Parameters

NameTypeDefault value
newSourcestringundefined
interpolatebooleanfalse

Returns

void

Defined in

packages/core/src/notebook.ts:110


waitForKernel

waitForKernel(kernel): Promise<ThebeSession>

Parameters

NameType
kernelPromise<ThebeSession>

Returns

Promise<ThebeSession>

Defined in

packages/core/src/notebook.ts:115


fromCodeBlocks

Static fromCodeBlocks(blocks, config): ThebeNotebook

Parameters

NameType
blocksCodeBlock[]
configConfig

Returns

ThebeNotebook

Defined in

packages/core/src/notebook.ts:41


fromIpynb

Static fromIpynb(ipynb, config, rendermime?): ThebeNotebook

Parameters

NameType
ipynbINotebookContent
configConfig
rendermime?IRenderMimeRegistry

Returns

ThebeNotebook

Defined in

packages/core/src/notebook.ts:54