on master help sign in
Remove `generateHtml`, which is dead code
commitf72e97ab7dcfd622670b22a0b2ca78e79a535e70 authorEvan Czaplicki <info@elm-lang.org> dateSat 28 Sep 2013, 15:39 (13 years ago) parent66c288e
2 files changed+3−24
compiler/Generate/Html.hs+1−14 compiler/Language/Elm.hs+2−10
compiler/Generate/Html.hs+1−14
@@ -1,7 +1,6 @@
11{-# LANGUAGE OverloadedStrings #-}
22module Generate.Html
3− (generateHtml,
4− createHtml,
3+ (createHtml,
54 JSSource (..)
65 ) where
76
@@ -9,7 +8,6 @@ import Text.Blaze (preEscapedToMarkup)
98import qualified Text.Blaze.Html5 as H
109import Text.Blaze.Html5 ((!))
1110import qualified Text.Blaze.Html5.Attributes as A
12−
1311import qualified Data.ByteString.Lazy.Char8 as BS
1412
1513import Initialize (buildFromSource)
@@ -26,17 +24,6 @@ makeScript source =
2624 H.script ! A.type_ "text/javascript" $
2725 preEscapedToMarkup $ BS.unpack src
2826
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−
4027createHtml :: FilePath -> String -> [JSSource] -> String -> String -> H.Html
4128createHtml libLoc title scripts moduleName noscript =
4229 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
2− respective HTML, CSS, and JS code.
1+{- | This module exports the functions necessary for compiling Elm to JS,
2+ and some utilities for making it easier to find some Elm-related files.
33
44 The documentation for the Elm language is available at
55 <http://elm-lang.org/Documentation.elm>, and many interactive examples are
@@ -11,7 +11,6 @@ import qualified Data.List as List
1111import qualified Data.Map as Map
1212import Data.Version (showVersion)
1313import Generate.JavaScript (jsModule)
14−import Generate.Html (generateHtml)
1514import Initialize (buildFromSource)
1615import Parse.Module (getModuleName)
1716import SourceSyntax.Module
@@ -32,13 +31,6 @@ compile source =
3231moduleName :: String -> Maybe String
3332moduleName = getModuleName
3433
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−
4234-- |The absolute path to Elm's runtime system.
4335runtime :: IO FilePath
4436runtime = getDataFileName "elm-runtime.js"