Using heist as a template engine
In this recipe, we will work with heist, a templating framework that can work with HTML or XML documents. The heist framework is also a default templating framework used for the Snap web development framework. At the same time, heist does not have any dependency on Snap and can be used independently.
In this recipe, we will create a template and bind a value to the template.
How to do it...
- Create a new project,
working-with-heist
, with asimple
stack template.
stack new working-with-heist simple
- Add a dependency on the
heist
library in thebuild-depends
sub-section of theexecutable
section:
executable working-with-heist hs-source-dirs: src main-is: Main.hs default-language: Haskell2010 build-depends: base >= 4.7 && < 5 , heist , text , bytestring , lens , xmlhtml
- The
heist
library does not exist...