Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface LanguagePlugin

A plugin that implements language specific functionality such as creating an editor for the language, parsing code, creating dependency graph, evaluation, etc.

Hierarchy

  • LanguagePlugin

Index

Properties

editor

editor: Editor<EditorState, any>

Returns a language-specific editor that handles the UI in a notebook

iconClassName

iconClassName: string

CSS class for a Font Awesome icon to be used for this language. For example, the value "fab fa-js-square" is used for JavaScript.

language

language: string

Identifier of the language that this plugin implements

Methods

bind

  • Given a parsed block and a dictionary that tracks variables that are in scope, construct a dependency graph for the given block. Returns a node representing the code block and a list of exported variables (to be added to the scope)

    Parameters

    Returns Promise<BindingResult>

evaluate

getDefaultCode

  • getDefaultCode(id: number): string
  • Given a numerical ID of a newly created block, return default source code that should appear in a newly created cells. This can be empty string or something to guide the user.

    Parameters

    • id: number

    Returns string

parse

  • parse(code: string): Block
  • Parse source code and construct a language-specific Block object that keeps the result of the parsing (this can just store the source, but it could build an AST too)

    Parameters

    • code: string

    Returns Block

save

  • save(block: Block): string
  • Given a code cell, return string of source to be used for saving document in Markdown file.

    Parameters

    Returns string

Generated using TypeDoc