Permalink
Browse files

Completed migration

  • Loading branch information...
1 parent 3a14b5a commit c22e8c97ed841a7b5dac963ff5ef39b034a2108a Alfredo committed Sep 26, 2012
View
6 snap-website.cabal
@@ -1,5 +1,5 @@
Name: snap-website
-Version: 0.8
+Version: 0.10
Synopsis: The Snap Framework Website
Homepage: http://snapframework.com
License: BSD3
@@ -23,11 +23,11 @@ Executable snap-website
data-lens-template >= 2.1 && < 2.2,
directory,
filepath,
- heist >= 0.7 && < 0.9,
+ heist >= 0.10 && < 0.11,
MonadCatchIO-transformers >= 0.2 && < 0.4,
mtl >= 2 && <3,
process,
- snap >= 0.9 && <0.10,
+ snap >= 0.10 && <0.11,
snap-core >= 0.9 && <0.10,
snap-blaze >= 0.2.1 && <0.3,
snap-server >= 0.9 && <0.10,
View
6 snaplets/heist/templates/docs/tutorials/snaplets-tutorial.lhs
@@ -103,7 +103,7 @@ The next thing we need to do is define an initializer.
> , ("/barname", with bar namePage)
> , ("/company", companyHandler)
> ]
-> wrapHandlers (<|> heistServe)
+> wrapSite (<|> heistServe)
> ref <- liftIO $ newIORef "fooCorp"
> return $ App hs fs bs ref
@@ -167,10 +167,10 @@ monad. It has a `MonadState` instance that lets you access and modify the
current snaplet's state, and a `MonadSnap` instance providing the
request-processing functions defined in Snap.Types.
-wrapHandlers
+wrapSite
------------
-`wrapHandlers` allows you to apply an arbitrary `Handler` transformation to
+`wrapSite` allows you to apply an arbitrary `Handler` transformation to
the top-level handler. This is useful if you want to do some generic
processing at the beginning or end of every request. For instance, a session
snaplet might use it to touch a session activity token before routing happens.
View
2 snaplets/heist/templates/page.tpl
@@ -4,7 +4,7 @@
<div class="inner-page">
<div class="newspaper">
- <content/>
+ <apply-content/>
</div>
</div>
View
2 snaplets/heist/templates/wrap.tpl
@@ -4,7 +4,7 @@
<body>
<div id="main">
<apply template="nav"/>
- <content />
+ <apply-content />
</div><!--end main-->
<div id="footer">
<p class="part-1">Powered by <b>Snap <snap-version/></b></p> <p class="part-2">Snap is <a rel="license" href="http://creativecommons.org/licenses/BSD/">BSD
View
11 src/Main.hs
@@ -28,7 +28,8 @@ import Snap.Util.FileServe
import Snap.Util.GZip
import Text.Blaze.Html5 (toHtml)
import qualified Text.Blaze.Html5 as H
-import Text.Templating.Heist
+import Heist
+import Heist.Interpreted
data App = App
{ _heist :: Snaplet (Heist App)
@@ -58,9 +59,9 @@ appInit = makeSnaplet "snap-website" description Nothing $ do
hs <- nestSnaplet "" heist $ heistInit "templates"
bs <- nestSnaplet "blog" blog $ staticPagesInit "blogdata"
addSplices [ ("snap-version", serverVersion)
- , ("feed-autodiscovery-link", liftHeist $ textSplice "")
+ , ("feed-autodiscovery-link", textSplice "")
]
- wrapHandlers (\h -> catch500 $ withCompression $
+ wrapSite (\h -> catch500 $ withCompression $
undirify >> h <|> setCache (serveDirectory "static"))
return $ App hs bs
where
@@ -98,8 +99,8 @@ catch500 m = (m >> return ()) `catch` \(e::SomeException) -> do
setResponseStatus 500 "Internal Server Error" emptyResponse
-serverVersion :: SnapletSplice b v
-serverVersion = liftHeist $ textSplice $ decodeUtf8 snapServerVersion
+serverVersion :: SnapletISplice b
+serverVersion = textSplice $ decodeUtf8 snapServerVersion
main :: IO ()

0 comments on commit c22e8c9

Please sign in to comment.