mustache2hs: Utility to generate Haskell code from Mustache templates

[ program, utility ] [ Propose Tags ]

This utility take in Haskell records (single data constructor only) and a list of mustache template and record name pairs, and generates Haskell code for functions that take an escape function and one of the records, and returns a Builder.

This allows most records to be used as context for rendering a template, and gives GHC the ability to typecheck the template's use of record fields at compile time. It also means your application does not need to be reading template files off disk in production.

Usage example:

mustache2hs -m Records.hs main.mustache SomeRec sub.mustache OtherRec

A full example is in the git repository.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1, 0.1.1, 0.2, 0.2.1, 0.2.1.1, 0.2.2, 0.3
Dependencies base (>=4 && <5), blaze-builder, bytestring, filepath, haskell-src, parsec (>=3.1.2), text, transformers, utf8-string [details]
License LicenseRef-OtherLicense
Copyright © 2012 Stephen Paul Weber
Author Stephen Paul Weber <singpolyma@singpolyma.net>
Maintainer Stephen Paul Weber <singpolyma@singpolyma.net>
Category Utility
Home page http://github.com/singpolyma/mustache2hs
Bug tracker http://github.com/singpolyma/mustache2hs/issues
Source repo head: git clone git://github.com/singpolyma/mustache2hs.git
Uploaded by StephenWeber at 2012-10-09T14:31:26Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Executables mustache2hs
Downloads 4898 total (18 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2015-06-05 [all 7 reports]

Readme for mustache2hs-0.1.1

[back to package description]
This utility take in Haskell records (single data constructor only)
and a list of mustache template and record name pairs, and generates
Haskell code for functions that take an escape function and one of
the records, and returns a 'Builder'.

This allows most records to be used as context for rendering a
template, and gives GHC the ability to typecheck the template's use of
record fields at compile time.  It also means your application does
not need to be reading template files off disk in production.

Usage example:

> mustache2hs -m Records.hs main.mustache SomeRec sub.mustache OtherRec

A full example is in the git repository.