@@ -1,5 +1,10 @@
1{-# LANGUAGE QuasiQuotes, TemplateHaskell #-}
1{-# LANGUAGE QuasiQuotes, TemplateHaskell #-}
2+{- | This module re-exports the modules necessary for compiling Elm code into the
3+ respective HTML, JS and CSS code.
5+ It also provides a predefined generateHtml function for use with the Blaze markup library
6+ as well as a simple QuasiQuoter for embedding literal elm code in a Haskell file.
3module Language.Elm (
8module Language.Elm (
4 module Language.Elm.Initialize,
9 module Language.Elm.Initialize,
5 module Language.Elm.CompileToJS,
10 module Language.Elm.CompileToJS,
@@ -15,8 +20,32 @@ import Language.Elm.GenerateHtml
15import Language.Haskell.TH
20import Language.Haskell.TH
16import Language.Haskell.TH.Quote
21import Language.Haskell.TH.Quote
23+{- | This QuasiQuoter allows for literal embedding of elm source code within
24+ Haskell files. It is not responsible for the actual compilation Process.
29+ main = image \"someImage.jpg\"
33+ How the elm code is compiled depends on how you intend to use it.
34+ Example uses are the included 'generateHtml' function as well as the
35+ "Language.Elm.Yesod" module.
18elm :: QuasiQuoter
37elm :: QuasiQuoter
19elm = QuasiQuoter {quoteExp = \s -> [|s|] }
38elm = QuasiQuoter {quoteExp = \s -> [|s|] }
40+{- | elmFile is a quoteFile wrapper around the 'elm' QuasiQuoter and allows for
41+ external elm source files to be embedded.
45+ [elmFile|elm-source/page.elm|]
48+ Please note that no spaces should be added before and after the filename.
21elmFile :: QuasiQuoter
50elmFile :: QuasiQuoter
22elmFile = quoteFile elm
51elmFile = quoteFile elm