The themplate package

[Tags: bsd3, program]

Themplate is a tool to generate projects from templates. The templating language is described at

[Skip to ReadMe]


Versions0.1, 1.1, 1.2
Change logNone available
Dependenciesbase (>=4.4 && <5), configurator, directory, either, errors (>=2), filepath, optparse-applicative (>=0.10), text, transformers (>=0.2), transformers-compat (>=0.3) [details]
CopyrightCopyright (C) 2013-2014 Benno Fünfstück
AuthorBenno Fünfstück
MaintainerBenno Fünfstück <>
CategoryApplication, Console, Development, Template
Home page
Bug tracker
Source repositoryhead: git clone
UploadedWed Jul 8 08:29:50 UTC 2015 by BennoFuenfstueck
UpdatedWed Jul 8 08:31:27 UTC 2015 by BennoFuenfstueck to revision 1
Downloads513 total (9 in last 30 days)
0 []
StatusDocs not available [build log]
Last success reported on 2015-11-13 [all 4 reports]


Maintainers' corner

For package maintainers and hackage trustees

Readme for themplate-1.2


Build Status

This is a very simple program for creating project templates.

Installing Themplate

From hackage:

$ cabal install themplate

From repository:

Checkout the source code:

$ git clone
$ cd themplate

Build in a cabal sandbox and install:

$ cabal sandbox init
$ cabal install --prefix=~/.cabal   # Install themplate executable to ~/.cabal/bin/themplate

Using Themplate

To use a exisiting template with themplate, just run:

$ themplate init <project name> <template name>

This will initialize the template with the given name in a new directory with the name of the project. To list all available templates, run:

$ themplate list

Configuration file

The configuration file is read using configurator, the syntax is described here. The options are passed to the template, so they can use patterns to include user-specific information. An example configuration file could look like this:

user { 
  name = "Benno Fünfstück"
  email = ""

github {
  user = "bennofs"

This will make the options, and github.user available to templates.

Creating templates

A template is just a subdirectory in ~/.themplate. When a new project is created with the template, the files in that directory are copied to the project directory. The files contents and the file names in the template can contain patterns. Patterns are enclosed in {{ and }}. In a pattern, the following special forms are substituted:

There is one special configuration option, This will always be set to the current project's name. ??name?? patterns are checked prior to $$name$$ patterns, so the following:


won't throw an error if github.user is unset, even if was unset.

You can find an example template at