on master help sign in
Remove `generateHtml`, which is dead code
f72e97aEvan Czaplicki
compiler/Generate/Html.hs+1−14
@@ -1,7 +1,6 @@
1{-# LANGUAGE OverloadedStrings #-}
1{-# LANGUAGE OverloadedStrings #-}
2module Generate.Html
2module Generate.Html
3− (generateHtml,
4− createHtml,
3+ (createHtml,
5 JSSource (..)
4 JSSource (..)
6 ) where
5 ) where
7
6
@@ -9,7 +8,6 @@ import Text.Blaze (preEscapedToMarkup)
9import qualified Text.Blaze.Html5 as H
8import qualified Text.Blaze.Html5 as H
10import Text.Blaze.Html5 ((!))
9import Text.Blaze.Html5 ((!))
11import qualified Text.Blaze.Html5.Attributes as A
10import qualified Text.Blaze.Html5.Attributes as A
12−
13import qualified Data.ByteString.Lazy.Char8 as BS
11import qualified Data.ByteString.Lazy.Char8 as BS
14
12
15import Initialize (buildFromSource)
13import Initialize (buildFromSource)
@@ -26,17 +24,6 @@ makeScript source =
26 H.script ! A.type_ "text/javascript" $
24 H.script ! A.type_ "text/javascript" $
27 preEscapedToMarkup $ BS.unpack src
25 preEscapedToMarkup $ BS.unpack src
28
26
29−-- |This function compiles Elm code into simple HTML.
30−--
31−-- Usage example:
32−--
33−-- > generateHtml "/elm-min.js" "Some title" [elmFile|elm-source/somePage.elm|]
34−generateHtml :: String -- ^ Location of elm-runtime.js as expected by the browser
35− -> String -- ^ The page title
36− -> String -- ^ The elm source code.
37− -> H.Html
38−generateHtml libLoc title source = error "function 'generateHtml' is unimplemented for now"
39−
40createHtml :: FilePath -> String -> [JSSource] -> String -> String -> H.Html
27createHtml :: FilePath -> String -> [JSSource] -> String -> String -> H.Html
41createHtml libLoc title scripts moduleName noscript =
28createHtml libLoc title scripts moduleName noscript =
42 H.docTypeHtml $ do
29 H.docTypeHtml $ do
compiler/Language/Elm.hs+2−10
@@ -1,5 +1,5 @@
1−{- | This module exports the functions necessary for compiling Elm code into the
1+{- | This module exports the functions necessary for compiling Elm to JS,
2− respective HTML, CSS, and JS code.
2+ and some utilities for making it easier to find some Elm-related files.
3
3
4 The documentation for the Elm language is available at
4 The documentation for the Elm language is available at
5 <http://elm-lang.org/Documentation.elm>, and many interactive examples are
5 <http://elm-lang.org/Documentation.elm>, and many interactive examples are
@@ -11,7 +11,6 @@ import qualified Data.List as List
11import qualified Data.Map as Map
11import qualified Data.Map as Map
12import Data.Version (showVersion)
12import Data.Version (showVersion)
13import Generate.JavaScript (jsModule)
13import Generate.JavaScript (jsModule)
14−import Generate.Html (generateHtml)
15import Initialize (buildFromSource)
14import Initialize (buildFromSource)
16import Parse.Module (getModuleName)
15import Parse.Module (getModuleName)
17import SourceSyntax.Module
16import SourceSyntax.Module
@@ -32,13 +31,6 @@ compile source =
32moduleName :: String -> Maybe String
31moduleName :: String -> Maybe String
33moduleName = getModuleName
32moduleName = getModuleName
34
33
35−-- |This function compiles Elm code into a full HTML page.
36−toHtml :: String -- ^ Location of elm-min.js as expected by the browser
37− -> String -- ^ The page title
38− -> String -- ^ The elm source code
39− -> Html
40−toHtml = generateHtml
41−
42-- |The absolute path to Elm's runtime system.
34-- |The absolute path to Elm's runtime system.
43runtime :: IO FilePath
35runtime :: IO FilePath
44runtime = getDataFileName "elm-runtime.js"
36runtime = getDataFileName "elm-runtime.js"