-
Notifications
You must be signed in to change notification settings - Fork 28
/
Main.elm
49 lines (35 loc) · 885 Bytes
/
Main.elm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
port module Main exposing (main)
import Html exposing (..)
import Html
import Elchemy.Compiler as Compiler
import Markdown
type Msg
= Replace String
| String
view : String -> Html Msg
view model =
Markdown.toHtml [] <| "```elixir\n" ++ (Compiler.tree model) ++ "\n```"
init : String -> ( String, Cmd Msg )
init v =
( v, Cmd.none )
main : Program String String Msg
main =
Html.programWithFlags
{ init = init
, update = update
, view = view
, subscriptions =
(\_ ->
Sub.batch
[ updateInput Replace
]
)
}
update : Msg -> String -> ( String, Cmd Msg )
update action model =
case action of
Replace m ->
( m, Cmd.none )
String ->
( "", Cmd.none )
port updateInput : (String -> msg) -> Sub msg