on master help sign in
Correct version number for elm-server, and disable noscript generation by default. You get indexed by Google and Bing without out it. I think it is formatted poorly, so they assume it is SEO.
c3ec869evancz
elm-server/Server.hs+2−2
@@ -11,7 +11,7 @@ import qualified Language.Elm as Elm
11
11
12serve :: String -> IO ()
12serve :: String -> IO ()
13serve libLoc = do
13serve libLoc = do
14− putStrLn "Elm Server 0.3.0.1: running at <http://localhost:8000>"
14+ putStrLn "Elm Server 0.3.5: running at <http://localhost:8000>"
15 simpleHTTP nullConf $ do
15 simpleHTTP nullConf $ do
16 _ <- compressedResponseFilter
16 _ <- compressedResponseFilter
17 msum [ uriRest (serveElm libLoc)
17 msum [ uriRest (serveElm libLoc)
@@ -34,7 +34,7 @@ main = getArgs >>= parse
34
34
35parse :: [String] -> IO ()
35parse :: [String] -> IO ()
36parse ("--help":_) = putStrLn usage
36parse ("--help":_) = putStrLn usage
37−parse ("--version":_) = putStrLn "The Elm Server 0.3.0.1"
37+parse ("--version":_) = putStrLn "The Elm Server 0.3.5"
38parse [] = serve "/elm-mini.js"
38parse [] = serve "/elm-mini.js"
39parse [arg]
39parse [arg]
40 | "--runtime-location=" `isPrefixOf` arg =
40 | "--runtime-location=" `isPrefixOf` arg =
elm-server/elm-server.cabal+1−1
@@ -1,5 +1,5 @@
1Name: elm-server
1Name: elm-server
2−Version: 0.3.0.1
2+Version: 0.3.5
3Synopsis: The Elm language server.
3Synopsis: The Elm language server.
4Description: This package provides a standalone, Happstack-based Elm server.
4Description: This package provides a standalone, Happstack-based Elm server.
5
5
elm/src/Compiler.hs+7−5
@@ -21,6 +21,7 @@ data ELM =
21 , separate_js :: Bool
21 , separate_js :: Bool
22 , only_js :: Bool
22 , only_js :: Bool
23 , import_js :: [FilePath]
23 , import_js :: [FilePath]
24+ , generate_noscript :: Bool
24 }
25 }
25 deriving (Data,Typeable,Show,Eq)
26 deriving (Data,Typeable,Show,Eq)
26
27
@@ -31,6 +32,7 @@ elm = ELM { make = False &= help "automatically compile dependencies."
31 , separate_js = False &= help "Compile to separate HTML and JS files."
32 , separate_js = False &= help "Compile to separate HTML and JS files."
32 , only_js = False &= help "Compile only to JavaScript."
33 , only_js = False &= help "Compile only to JavaScript."
33 , import_js = [] &= typFile &= help "Include a JavaScript file before the body of the Elm program. Can be used many times. Files will be included in the given order."
34 , import_js = [] &= typFile &= help "Include a JavaScript file before the body of the Elm program. Can be used many times. Files will be included in the given order."
35+ , generate_noscript = False &= help "Add generated <noscript> tag to HTML output."
34 } &=
36 } &=
35 help "Compile Elm programs to HTML, CSS, and JavaScript." &=
37 help "Compile Elm programs to HTML, CSS, and JavaScript." &=
36 summary "The Elm Compiler v0.3.5, (c) Evan Czaplicki"
38 summary "The Elm Compiler v0.3.5, (c) Evan Czaplicki"
@@ -40,17 +42,17 @@ main = do
40 mini <- getDataFileName "elm-runtime-0.3.5.js"
42 mini <- getDataFileName "elm-runtime-0.3.5.js"
41 compileArgs mini args
43 compileArgs mini args
42
44
43−compileArgs mini (ELM _ [] _ _ _ _) =
45+compileArgs mini (ELM _ [] _ _ _ _ _) =
44 putStrLn "Usage: elm [OPTIONS] [FILES]\nFor more help: elm --help"
46 putStrLn "Usage: elm [OPTIONS] [FILES]\nFor more help: elm --help"
45−compileArgs mini (ELM make files rtLoc split only js) =
47+compileArgs mini (ELM make files rtLoc split only js nscrpt) =
46− mapM_ (fileTo get what js $ fromMaybe mini rtLoc) files
48+ mapM_ (fileTo get what js nscrpt $ fromMaybe mini rtLoc) files
47 where get = if make then getModules [] else getModule
49 where get = if make then getModules [] else getModule
48 what = if only then JS else
50 what = if only then JS else
49 if split then Split else HTML
51 if split then Split else HTML
50
52
51data What = JS | HTML | Split
53data What = JS | HTML | Split
52
54
53−fileTo get what jsFiles rtLoc file = do
55+fileTo get what jsFiles noscript rtLoc file = do
54 ems <- get file
56 ems <- get file
55 jss <- concat `fmap` mapM readFile jsFiles
57 jss <- concat `fmap` mapM readFile jsFiles
56 case ems of
58 case ems of
@@ -61,7 +63,7 @@ fileTo get what jsFiles rtLoc file = do
61 html = name ++ ".html"
63 html = name ++ ".html"
62 in case what of
64 in case what of
63 JS -> writeFile js $ jss ++ concatMap jsModule ms
65 JS -> writeFile js $ jss ++ concatMap jsModule ms
64− HTML -> writeFile html . renderHtml $ modulesToHtml "" rtLoc jss ms
66+ HTML -> writeFile html . renderHtml $ modulesToHtml "" rtLoc jss noscript ms
65 Split -> do
67 Split -> do
66 writeFile html . renderHtml $ linkedHtml rtLoc js ms
68 writeFile html . renderHtml $ linkedHtml rtLoc js ms
67 writeFile js $ jss ++ concatMap jsModule ms
69 writeFile js $ jss ++ concatMap jsModule ms
elm/src/Gen/GenerateHtml.hs+3−3
@@ -46,12 +46,12 @@ generateHtml :: String -- ^ Location of elm-min.js as expected by the browser
46generateHtml libLoc title source =
46generateHtml libLoc title source =
47 case initialize source of
47 case initialize source of
48 Left err -> createHtml libLoc title (Right $ showErr err) (H.noscript "")
48 Left err -> createHtml libLoc title (Right $ showErr err) (H.noscript "")
49− Right modul -> modulesToHtml title libLoc [] [modul]
49+ Right modul -> modulesToHtml title libLoc [] False [modul]
50
50
51
51
52−modulesToHtml title libLoc jss modules = createHtml libLoc title' js noscript
52+modulesToHtml title libLoc jss nscrpt modules = createHtml libLoc title' js noscript
53 where js = Right $ jss ++ concatMap jsModule modules
53 where js = Right $ jss ++ concatMap jsModule modules
54− noscript = extract $ last modules
54+ noscript = if nscrpt then extract $ last modules else ""
55 title' = if null title then altTitle else title
55 title' = if null title then altTitle else title
56 altTitle = (\(Module names _ _ _ _) -> intercalate "." names) $
56 altTitle = (\(Module names _ _ _ _) -> intercalate "." names) $
57 last modules
57 last modules