Skip to content

Instantly share code, notes, and snippets.

@robertknight
Created November 14, 2015 07:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertknight/969002c9235c498c7251 to your computer and use it in GitHub Desktop.
Save robertknight/969002c9235c498c7251 to your computer and use it in GitHub Desktop.
Elm setup notes

Elm Tutorial Notes

  1. Went to elm-lang hopepage, skimmed the initial instructions, went for the Install option so I could develop in my preferred editor (Atom).
  2. Not obvious where to go next after that, went to the Docs link at the top. Was expecting to find an 'Intro to Elm' guide. In lieu of that, picked the next most obvious thing which was walking through the Quick Start links.
  3. Skimmed the For JS users documentation. OK, I can follow what is going on in the Elm column. I have a feeling that important details are being glossed over quickly but that's fine.
  4. Next link is Make an HTML app tutorial which bounces me off to a GitHub project page. Near the top is a block of code without much explanation and some instructions on how to run it in the online editor but nothing about how to run it locally.
  5. Ran elm make --help and saw that it expected an input file
  6. Tried adding the example code to hello.elm and ran elm make hello.elm. This produced an error about an unknown HTML import. I look in the directory where I ran elm make and see an elm-package.json file. That sounds similar to package.json so I presume I need to add dependencies to that file.
  7. Went back to the documentation, skimmed the links and tried the Community packages link. That page has an example for installing elm-html under Reliable Versioning. This sounds like the package I want, so I follow the example and install it via elm-package install evancz/elm-html, guessing that I don't need to specify an exact version. This turns out to be correct, elm-package tells me that it will add what is (presumably) the latest version of the dependency and I confirm.
  8. The initial install fails with a FailedConnectionException error. I guess that this could be related to the hotel WiFi connection that I'm using. I retry and the second attempt succeeds.
  9. I retry elm make hello.elm, this time it tells me that I'm missing the StartApp.Simple module.
  10. I search the list of community packages and find evancz/start-app which I install via elm-package
  11. I try elm make hello.elm again and this successfully compiles and produces elm.js.
  12. I'm not immediately sure what to do with elm.js - I skim through it briefly to see if it has what looks like an init function that I need to invoke but don't see it immediately at the top or bottom of the file.
  13. Going back to the docs, I skim down the list and at the bottom a section labeled Interop and follow the HTML Embedding link. This provides me with instructions to use Elm.embed() or Elm.fullscreen() which I add to a trivial index.html page after a <script src="elm.js"> tag.
  14. It works. Hurrah!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment