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.
commitc3ec869afbf19933c71902c5a61b5ef4593c378c authorevancz <info@elm-lang.org> dateFri 29 Jun 2012, 16:19 (14 years ago) parent8f97ed7
4 files changed+13−11
elm-server/Server.hs+2−2 elm-server/elm-server.cabal+1−1 elm/src/Compiler.hs+7−5 elm/src/Gen/GenerateHtml.hs+3−3
elm-server/Server.hs+2−2
@@ -11,7 +11,7 @@ import qualified Language.Elm as Elm
1111
1212serve :: String -> IO ()
1313serve 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>"
1515 simpleHTTP nullConf $ do
1616 _ <- compressedResponseFilter
1717 msum [ uriRest (serveElm libLoc)
@@ -34,7 +34,7 @@ main = getArgs >>= parse
3434
3535parse :: [String] -> IO ()
3636parse ("--help":_) = putStrLn usage
37−parse ("--version":_) = putStrLn "The Elm Server 0.3.0.1"
37+parse ("--version":_) = putStrLn "The Elm Server 0.3.5"
3838parse [] = serve "/elm-mini.js"
3939parse [arg]
4040 | "--runtime-location=" `isPrefixOf` arg =
elm-server/elm-server.cabal+1−1
@@ -1,5 +1,5 @@
11Name: elm-server
2−Version: 0.3.0.1
2+Version: 0.3.5
33Synopsis: The Elm language server.
44Description: This package provides a standalone, Happstack-based Elm server.
55
elm/src/Compiler.hs+7−5
@@ -21,6 +21,7 @@ data ELM =
2121 , separate_js :: Bool
2222 , only_js :: Bool
2323 , import_js :: [FilePath]
24+ , generate_noscript :: Bool
2425 }
2526 deriving (Data,Typeable,Show,Eq)
2627
@@ -31,6 +32,7 @@ elm = ELM { make = False &= help "automatically compile dependencies."
3132 , separate_js = False &= help "Compile to separate HTML and JS files."
3233 , only_js = False &= help "Compile only to JavaScript."
3334 , 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."
3436 } &=
3537 help "Compile Elm programs to HTML, CSS, and JavaScript." &=
3638 summary "The Elm Compiler v0.3.5, (c) Evan Czaplicki"
@@ -40,17 +42,17 @@ main = do
4042 mini <- getDataFileName "elm-runtime-0.3.5.js"
4143 compileArgs mini args
4244
43−compileArgs mini (ELM _ [] _ _ _ _) =
45+compileArgs mini (ELM _ [] _ _ _ _ _) =
4446 putStrLn "Usage: elm [OPTIONS] [FILES]\nFor more help: elm --help"
45−compileArgs mini (ELM make files rtLoc split only js) =
46− mapM_ (fileTo get what js $ fromMaybe mini rtLoc) files
47+compileArgs mini (ELM make files rtLoc split only js nscrpt) =
48+ mapM_ (fileTo get what js nscrpt $ fromMaybe mini rtLoc) files
4749 where get = if make then getModules [] else getModule
4850 what = if only then JS else
4951 if split then Split else HTML
5052
5153data What = JS | HTML | Split
5254
53−fileTo get what jsFiles rtLoc file = do
55+fileTo get what jsFiles noscript rtLoc file = do
5456 ems <- get file
5557 jss <- concat `fmap` mapM readFile jsFiles
5658 case ems of
@@ -61,7 +63,7 @@ fileTo get what jsFiles rtLoc file = do
6163 html = name ++ ".html"
6264 in case what of
6365 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
6567 Split -> do
6668 writeFile html . renderHtml $ linkedHtml rtLoc js ms
6769 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
4646generateHtml libLoc title source =
4747 case initialize source of
4848 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]
5050
5151
52−modulesToHtml title libLoc jss modules = createHtml libLoc title' js noscript
52+modulesToHtml title libLoc jss nscrpt modules = createHtml libLoc title' js noscript
5353 where js = Right $ jss ++ concatMap jsModule modules
54− noscript = extract $ last modules
54+ noscript = if nscrpt then extract $ last modules else ""
5555 title' = if null title then altTitle else title
5656 altTitle = (\(Module names _ _ _ _) -> intercalate "." names) $
5757 last modules