diff --git a/README.md b/README.md index e3378b4..6914a9a 100644 --- a/README.md +++ b/README.md @@ -14,24 +14,24 @@ Next, we concatenate this with the Elm JavaScript output and an app launcher sni * No event loop * Hence, no [TEA](https://guide.elm-lang.org/architecture/); the `main` function must return a static view -* The Elm app module must be called "Main" +* ~~The Elm app module must be called "Main"~~ * Nodes can only have one parent (this should always be the case) # Usage 1. Clone this repository and navigate into your local copy 2. Run `elm init`. -3. Create `src/Main.elm` with the following content: +3. Create `src/Hello.elm` with the following content: ```elm -module Main exposing(main) +module Hello exposing(main) import Html exposing (p, text) main = p [] [text "Hello World!"] ``` -4. Run `./build.sh`; this generates the corresponding HTML code: +4. Run `./build.sh src/Hello.elm`; this generates the corresponding HTML code: ```html
diff --git a/build.sh b/build.sh index ef8fab8..7c67b11 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ w1="$(mktemp out_$$_1_XXXX.js)" -elm make --optimize --output=${w1} src/Main.elm 1>&2 +elm make --optimize --output=${w1} $1 1>&2 w2="$(mktemp out_$$_XXXX.js)" diff --git a/launch.js b/launch.js index 466b46a..20c6fd8 100644 --- a/launch.js +++ b/launch.js @@ -4,7 +4,7 @@ // and the Elm app code // here we lanch the app - var app = Elm.Main.init({ node: document.getElementById("elm") }); + Elm[Object.keys(Elm)[0]].init({ node: document.getElementById("elm") }); document.children[0].dump();