kontrakcja-templates-0.12: Utilities for working with many HStringTemplate templates from files.

Safe HaskellNone
LanguageHaskell2010

Text.StringTemplates.Files

Description

module for reading many template definitions from files

Synopsis

Documentation

getTemplates Source #

Arguments

:: FilePath

file path of a file with template definitions

-> IO [(String, String)] 

parses template definitions read from the file path (using utf8) definitions are separated by >=1 lines starting with # if first line of definition looks like foo=bar or foo=*bar, then it returns (foo, bar ++ rest of the lines (from definition) concatenated) broken definitons are skipped

Templates created with =* will be cleaned from spaces and eol chars.

Example template file:

foo=
<html>
  <body>
    <h1> hello </h1>
  </body>
</html>
###
bar=<b>BAR</b>