File tree Expand file tree Collapse file tree
snaplets/heist/templates/docs/tutorials Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ buildbot. So first we need to get some boilerplate and imports out of the way.
2828> import Heist.Tutorial.Imports
2929
3030> import Control.Applicative
31+ > import Control.Lens
32+ > import Data.Map.Syntax
3133> import qualified Data.Text as T
3234> import Data.Text.Encoding
3335> import qualified Heist.Compiled.LowLevel as C
@@ -113,9 +115,12 @@ directory with compiled splices.
113115> -> IO (HeistState n )
114116> load baseDir splices = do
115117> tmap <- runEitherT $ do
116- > let hc = HeistConfig mempty defaultLoadTimeSplices splices mempty
117- > [loadTemplates baseDir]
118- > initHeist hc
118+ > let sc = mempty & scLoadTimeSplices .~ defaultLoadTimeSplices
119+ > & scCompiledSplices .~ splices
120+ > & scTemplateLocations .~ [loadTemplates baseDir]
121+ > initHeist $ emptyHeistConfig & hcNamespace .~ " "
122+ > & hcErrorNotBound .~ False
123+ > & hcSpliceConfig .~ sc
119124> either (error . concat ) return tmap
120125
121126Here's a function demonstrating all of this in action.
You can’t perform that action at this time.
0 commit comments