Embedding something mutable like CodeMirror or Ace inside Elm would be tricky. But you can embed Elm in a page where the JS implemented editor also lives. The communication between such an editor and Elm can be done with ports. See also the interop page on elm-lang.org.
On Fri, Aug 7, 2015 at 7:52 PM, Wade McReynolds <wjmcre...@gmail.com> wrote:
So I noticed that the code for Elm's online editor here uses plain JavaScript. How difficult would it be to embed CodeMirror or Ace using just Elm using an approach like this one here? I'm asking because I'm interested in making a specialized text editor with functionality that would be messy and difficult for me to implement using those editors' language-mode facilities, but would like also to avail myself of CodeMirror's (or Ace's) vi emulation. I'd consider going with ordinary text boxes, though, should embedding an editor prove too complicated for a novice like me. Or maybe there's a better possibility that I haven't considered? Thanks for any suggestions.
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Have you seen https://github.com/rtfeldman/dreamwriter ?
type Widget model message = Widget
-- opaque; you construct this in JS
widget: Signal.Address msg -> Widget model msg -> model -> Html