Safe Haskell | Safe-Infered |
---|
This module exports the functions necessary for compiling Elm code into the respective HTML, JS and CSS code.
The type class
requires an instance for all types that the Elm compiler
understands. The provided instances for String, Text and QuasiQuoted Elm source code
should be sufficient.
ElmSource
The documentation for the Elm language is available at http://elm-lang.org/Documentation.elm, and many interactive examples are available at http://elm-lang.org/Examples.elm
Example implementations using Yesod and Happstack are available at https://github.com/tazjin/Elm/tree/master/Examples
Documentation
toParts :: a -> (Html, Html, String)Source
This function compiles Elm code to three separate parts: HTML, CSS, and JavaScript. The HTML is only the contents of the body, so the three parts must be combined in a basic HTML skeleton.
:: String | Location of elm-min.js as expected by the browser |
-> String | The page title |
-> a | The elm source code |
-> Html |
This function compiles Elm code into a full HTML page.