Skip to content

LiveExampleOptions

type LiveExampleOptions =
    {
        Presets: LiveExamplePreset list
        Highlighting: LiveExampleHighlighting
        Fable: FableRelease
        Tab: LiveExampleTab option
        Target: LiveExampleTarget option
        Css: string option
        Template: string option
        Stats: bool
        FableTool: string option
        OutputGrammars: TreeSitterGrammar list
    }
AssemblyNacara.Plugin.LiveExample

Options for LiveExample.

Fields

Presets: LiveExamplePreset list

The presets a fence can name.

Highlighting: LiveExampleHighlighting

The preset used by a fence that names none.

Unset, a bare snippet compiles on its own.

Fable: FableRelease

Which build of the Fable compiler snippets are compiled by.

Tab: LiveExampleTab option

Which tab a snippet opens on once it has run.

Unset, it opens on the console, or on the result when the snippet drew something and printed nothing. A snippet that failed to compile always opens on the console, whatever this says: the errors are there.

Target: LiveExampleTarget option

What a snippet is compiled to when its fence does not say.

Unset means JavaScript, the one target a reader's browser can run.

Css: string option

A stylesheet for what snippets draw, for presets that name none.

Template: string option

The page snippets are run inside, for presets that name none.

Stats: bool

Whether a snippet shows what its compiles cost.

A tab of timings, one row per run, kept so a change can be compared with the run before it.

FableTool: string option

The Fable CLI used to precompile a preset's packages.

Unset, a package is compiled with every snippet, which costs the reader a second or two on the first run of a page.

OutputGrammars: TreeSitterGrammar list

Grammars for colouring output this site's targets produce.

Name a grammar and the output tab for that target is coloured; name none and it is shown as plain text.