The Elm interface to the code-editor
custom element.
Inspired by Luke Westby's Elm Europe talk. The JavaScript custom element code is almost a verbatim copy.
This code won't do anything unless site/js/code-editor.js
is loaded,
and its CodeMirror files from site/lib
.
codeEditor : List (Html.Attribute msg) -> List (Html msg) -> Html msg
Create a code editor Html element.
editorValue : String -> Html.Attribute msg
This is how you set the contents of the code editor.
onEditorChanged : (String -> msg) -> Html.Attribute msg
This is how you receive changes to the contents of the code editor.