The yesod-static-generators package has an example application using this preprocessor.
First, configure Karma to use the preprocessor similar to the html2js preprocessor, i.e. inside karma.js.conf
The preprocessor works by executing
runghc with a short script which calls
yesod-static-angular package. This
package must either be installed globally, installed inside a cabal sandbox which is located in some
ancestor of the current directory, or runghc must be configured explicitly below.
Configuration options can be specified inside
karma.conf.js inside a
The following configuration options are supported:
runghc(string) path to custom runghc executable. Defaults to searching for runghc on the path.
packageDb(string) path to a Haskell package database (which should contain the yesod-static-generators package). If this option is not given, the current directory and then successive parent directories are searched for a
cabal.sandbox.configfile. If a sandbox config file is found, it is parsed for the package database. If no sandbox config file is found, no package database is used.
extraGhcArgs(array of strings) list of extra arguments to pass to runghc. These arguments are used in addition to the package database options.
hsProg(string) the Haskell program to be given to runghc with
%sin place of the Hamlet filename. The program should read the hamlet from the given file and print the output onto standard output. The primary intent of overriding this is if the Hamlet template uses variable/type safe route interpolation so that you need to define custom variables or setup before calling hamletTestTemplate. The default program is the following: