Spyral.Notebook()

A helper for working with the Voyant Notebook app.

Methods

static getPromise() → {Promise}

Returns a new promise

Returns:
Promise -

A promise

static getTarget() → {element}

Returns the first DIV element that's a child of the document body. If none exists then one will be created.

Returns:
element

async, static import(url, cellIndexopt)

Fetch and return the content of a notebook or a particular cell in a notebook. All code and data cells from the imported notebook will have their functions and variables available for use. One specific cell can be imported by providing the cellIndex, or by including the cellId in the URL, e.g. "learnspyral@gh/terms/#kwu44vrk".

Parameters:
Name Type Attributes Description
url string

The URL of the notebook to import. Can either be the full URL or a shortened version, e.g. "learnspyral@gh/terms"

cellIndex number <optional>

The index of the cell to import

static show(contents, config)

Parameters:
Name Type Description
contents *
config *