jxxcarlson/scripta-compiler-v2/1.3.0

ScriptaV2.APISimple

Use ScriptaV2.APISimple.compile to transform source text to elm-ui HTML for the given markup language. You will need the following imports in your Elm file:

import ScriptaV2.APISimple
import ScriptaV2.Msg exposing (MarkupMsg)
import ScriptaV2.Language exposing (Language)
import Element exposing (Element)

Your Msg type definition should read:

type Msg
    =  ...
    | Render MarkupMsg

The choice of language is made from

type Language
    = MicroLaTeXLang
    | EnclosureLang
    | SMarkdownLang

in ScriptaV2.Language

compile : CompilerParameters -> String -> List (Element MarkupMsg)

Compile source text to elm-ui HTML. The width of the rendered text in pixels is defined by docWidth. The editCount should be 0 for a static document. For documents in a live editing context, the editCount should be increment after each edit. This ensures that the rendered text is properly updated.