Strapped templates for Wheb
https://github.com/hansonkd/Wheb-Framework
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
Implements basic functionality for:
StrappedTemplates
Wheb
In action:
Use with language extensions OverloadedStrings, FlexibleInstances, MultiParamTypeClasses
import Control.Monad.Except import Web.Wheb import Web.Wheb.Plugins.Strapped import Text.Strapped type MyApp = WhebT MyGlobalCtx () IO data MyGlobalCtx = MyGlobalCtx (StrappedContainer MyApp) instance StrappedApp MyGlobalCtx MyApp where getStrappedContainer (MyGlobalCtx g) = g main :: IO () main = do opts <- generateOptions $ do sc <- initStrapped "examples/resources" ".html" addGET "." rootPat $ renderTemplate "index.html" (emptyBucket) return (MyGlobalCtx sc, ()) runWhebServer opts