diff --git a/elm/core-js/Element.js b/core-js/Element.js similarity index 100% rename from elm/core-js/Element.js rename to core-js/Element.js diff --git a/elm/core-js/Everything.js b/core-js/Everything.js similarity index 100% rename from elm/core-js/Everything.js rename to core-js/Everything.js diff --git a/elm/core-js/Guid.js b/core-js/Guid.js similarity index 100% rename from elm/core-js/Guid.js rename to core-js/Guid.js diff --git a/elm/core-js/List.js b/core-js/List.js similarity index 100% rename from elm/core-js/List.js rename to core-js/List.js diff --git a/elm/core-js/String.js b/core-js/String.js similarity index 100% rename from elm/core-js/String.js rename to core-js/String.js diff --git a/elm/core-js/Text.js b/core-js/Text.js similarity index 100% rename from elm/core-js/Text.js rename to core-js/Text.js diff --git a/elm/core-js/Value.js b/core-js/Value.js similarity index 100% rename from elm/core-js/Value.js rename to core-js/Value.js diff --git a/elm/core-js/cat-js.sh b/core-js/cat-js.sh similarity index 100% rename from elm/core-js/cat-js.sh rename to core-js/cat-js.sh diff --git a/elm/core-js/collage/Color.js b/core-js/collage/Color.js similarity index 100% rename from elm/core-js/collage/Color.js rename to core-js/collage/Color.js diff --git a/elm/core-js/collage/Form.js b/core-js/collage/Form.js similarity index 100% rename from elm/core-js/collage/Form.js rename to core-js/collage/Form.js diff --git a/elm/core-js/collage/Image.js b/core-js/collage/Image.js similarity index 100% rename from elm/core-js/collage/Image.js rename to core-js/collage/Image.js diff --git a/elm/core-js/collage/Line.js b/core-js/collage/Line.js similarity index 100% rename from elm/core-js/collage/Line.js rename to core-js/collage/Line.js diff --git a/elm/core-js/collage/Shape.js b/core-js/collage/Shape.js similarity index 100% rename from elm/core-js/collage/Shape.js rename to core-js/collage/Shape.js diff --git a/elm/core-js/runtime/Dispatcher.js b/core-js/runtime/Dispatcher.js similarity index 100% rename from elm/core-js/runtime/Dispatcher.js rename to core-js/runtime/Dispatcher.js diff --git a/elm/core-js/runtime/Signal.js b/core-js/runtime/Signal.js similarity index 100% rename from elm/core-js/runtime/Signal.js rename to core-js/runtime/Signal.js diff --git a/elm-blaze/GenerateHtml.hs b/elm-blaze/GenerateHtml.hs deleted file mode 100644 index bee82481..00000000 --- a/elm-blaze/GenerateHtml.hs +++ /dev/null @@ -1,42 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} -module GenerateHtml (generateHtml) where - -import Text.Blaze (preEscapedToMarkup) -import qualified Text.Blaze.Html5 as H -import Text.Blaze.Html5 ((!)) -import qualified Text.Blaze.Html5.Attributes as A - -import Initialize -import CompileToJS -import ExtractNoscript - -css = preEscapedToMarkup $ - ("* { padding:0; margin:0; \ - \hyphens: auto; -moz-hyphens: auto;\ - \ -webkit-hyphens: auto; -ms-hyphens: auto; }\ - \body { font-family: Arial; }\ - \a:link {text-decoration: none}\ - \a:visited {text-decoration: none}\ - \a:active {text-decoration: none}\ - \a:hover {text-decoration: underline; color: #ff8f12;}" :: String) - -makeScript :: String -> H.Html -makeScript s = H.script ! A.type_ "text/javascript" ! A.src (H.toValue s) $ "" - -generateHtml libLoc title source = - let expr = initialize source - js = compileToJS expr - noscript = either id extract expr - in - H.docTypeHtml $ do - H.head $ do - H.meta ! A.charset "UTF-8" - H.title . H.toHtml $ title - makeScript libLoc - H.script ! A.type_ "text/javascript" $ preEscapedToMarkup js - H.style ! A.type_ "text/css" $ css - H.body $ do - H.div ! A.id "widthChecker" ! A.style "width:100%; height:1px; position:absolute; top:-1px;" $ "" - H.span ! A.id "content" $ "" - H.script ! A.type_ "text/javascript" $ "Dispatcher.initialize()" - H.noscript $ preEscapedToMarkup noscript diff --git a/elm-blaze/elm-blaze.cabal b/elm-blaze/elm-blaze.cabal deleted file mode 100644 index e69de29b..00000000 diff --git a/elm-server/LICENSE b/elm-server/LICENSE new file mode 100644 index 00000000..35ef3af1 --- /dev/null +++ b/elm-server/LICENSE @@ -0,0 +1,30 @@ +Copyright (c)2012, Evan Czaplicki + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Evan Czaplicki nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/elm-server/Server.hs b/elm-server/Server.hs index 2c711e0c..14fa317e 100644 --- a/elm-server/Server.hs +++ b/elm-server/Server.hs @@ -11,7 +11,7 @@ import Language.Elm serve :: String -> IO () serve libLoc = do - putStrLn "Elm Server 0.1.1.7: running at " + putStrLn "Elm Server 0.1.1.8: running at " simpleHTTP nullConf $ do compressedResponseFilter msum [ uriRest (serveElm libLoc) @@ -25,7 +25,7 @@ serveElm libLoc fp = do let ('/':path) = fp guard (".elm" `isSuffixOf` path) content <- liftIO (readFile path) - ok . toResponse $ compileToHtml libLoc (pageTitle path) content + ok . toResponse $ generateHtml libLoc (pageTitle path) content main = getArgs >>= parse diff --git a/elm/elm-mini.js b/elm-server/elm-mini.js similarity index 100% rename from elm/elm-mini.js rename to elm-server/elm-mini.js diff --git a/elm-server/elm-server.cabal b/elm-server/elm-server.cabal index 4e895b21..aeefb5af 100644 --- a/elm-server/elm-server.cabal +++ b/elm-server/elm-server.cabal @@ -1,13 +1,38 @@ +Name: Elm-server +Version: 0.1.1.8 +Synopsis: The Elm language module. +Description: This package provides a standalone, Happstack-based Elm server. + +Homepage: http://elm-lang.org + +License: BSD3 +License-file: LICENSE + +Author: Evan Czaplicki +Maintainer: info@elm-lang.org +Copyright: Copyright: (c) 2011-2012 Evan Czaplicki + +Category: Compiler, Language + +Build-type: Simple + +Extra-source-files: README.md +Cabal-version: >=1.6 + +source-repository head + type: git + location: git://github.com/evancz/Elm.git + Executable elm-server Main-is: Server.hs - Hs-Source-Dirs: src, src/Parse, src/Types - other-modules: Ast, CompileToJS, GenerateHtml, Guid, Initialize, - Rename, Language.Elm, Binop, Combinators, Lexer, - ParsePatterns, Parser, ParserLib, ParseTypes, Tokens, - Types, Constrain, Hints, Types, Unify, ExtractNoscript - ghc-options: -O3 - Build-depends: base >=4.2 && <5, containers >= 0.3, transformers >= 0.2, - mtl >= 2, parsec >= 3.1.1, blaze-html == 0.5.0.*, - HTTP >= 4000, happstack-server == 7.0.2, - deepseq, yesod-core, shakespeare-css, shakespeare-js, hamlet, - + ghc-options: -O2 + Build-depends: base >=4.2 && <5, + containers >= 0.3, + transformers >= 0.2, + mtl >= 2, + parsec >= 3.1.1, + blaze-html == 0.5.0.*, + HTTP >= 4000, + happstack-server == 7.0.2, + deepseq, + Elm >= 0.1.1.8 \ No newline at end of file diff --git a/elm/Elm.cabal b/elm/Elm.cabal index be750790..ddf0dfd4 100644 --- a/elm/Elm.cabal +++ b/elm/Elm.cabal @@ -63,7 +63,8 @@ Library exposed-modules: Language.Elm, Language.Elm.CompileToJS, Language.Elm.ExtractNoscript, - Language.Elm.Initialize + Language.Elm.Initialize, + Language.Elm.GenerateHtml Hs-Source-Dirs: src, src/Parse, src/Types other-modules: Ast, Guid,