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 asimplestack template.
stack new working-with-heist simple
- Add a dependency on the
heistlibrary in thebuild-dependssub-section of theexecutablesection:
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
heistlibrary does not exist...