Project templates for stack new
Haskell
Clone or download
Latest commit 879f95d Jul 4, 2018
Permalink
Failed to load latest commit information.
.travis.yml add travis CI Apr 1, 2016
LICENSE Bump copyright years to 2018 Jan 1, 2018
README.md Bump copyright years to 2018 Jan 1, 2018
STACK_HELP.md PR link Jul 4, 2018
chrisdone.hsfiles Bump copyright years to 2018 Jan 1, 2018
foundation.hsfiles Bump copyright years to 2018 Jan 1, 2018
franklinchen.hsfiles Bump copyright years to 2018 Jan 1, 2018
ghcjs-old-base.hsfiles Bump copyright years to 2018 Jan 1, 2018
ghcjs.hsfiles Bump copyright years to 2018 Jan 1, 2018
hakyll-template.hsfiles Bump copyright years to 2018 Jan 1, 2018
haskeleton.hsfiles defend the commons Jan 3, 2018
hspec.hsfiles Bump copyright years to 2018 Jan 1, 2018
new-template.hsfiles Change "Github" to "GitHub" (#125) Apr 28, 2018
protolude.hsfiles Bump copyright years to 2018 Jan 1, 2018
quickcheck-test-framework.hsfiles Bump copyright years to 2018 Jan 1, 2018
readme-lhs.hsfiles Bump copyright years to 2018 Jan 1, 2018
rio.hsfiles Fix rio template May 2, 2018
rubik.hsfiles Bump copyright years to 2018 Jan 1, 2018
scotty-hello-world.hsfiles Update template files so that build passes. Feb 23, 2017
scotty-hspec-wai.hsfiles Bump copyright years to 2018 Jan 1, 2018
servant-docker.hsfiles issue-126: update haskell docker image (#127) Jun 5, 2018
servant.hsfiles Bump copyright years to 2018 Jan 1, 2018
simple-hpack.hsfiles Bump copyright years to 2018 Jan 1, 2018
simple-library.hsfiles Bump copyright years to 2018 Jan 1, 2018
simple.hsfiles Bump copyright years to 2018 Jan 1, 2018
spock.hsfiles Bump copyright years to 2018 Jan 1, 2018
tasty-discover.hsfiles Bump copyright years to 2018 Jan 1, 2018
tasty-travis.hsfiles Bump copyright years to 2018 Jan 1, 2018
template-info.yaml Attempt to fix travis Jun 14, 2018
test-templates.hs Attempt to fix travis error involving -Wall -Werror Jun 14, 2018
unicode-syntax-exe.hsfiles Bump copyright years to 2018 Jan 1, 2018
unicode-syntax-lib.hsfiles Bump copyright years to 2018 Jan 1, 2018
yesod-minimal.hsfiles Yesod scaffold updates: DevelMain, newer aeson May 24, 2018
yesod-mongo.hsfiles Yesod template updates Jun 17, 2018
yesod-mysql.hsfiles Yesod template updates Jun 17, 2018
yesod-postgres.hsfiles Yesod template updates Jun 17, 2018
yesod-simple.hsfiles Yesod template updates Jun 17, 2018
yesod-sqlite.hsfiles Yesod template updates Jun 17, 2018

README.md

Status

There are plans to change the way Stack templates are done in the near future. Therefore, the project is not accepting new templates at this moment.

A repository for templates used by stack new. See: http://haskellstack.org

Build Status

Introduction

Project templates are written in hsfiles format, using mustache. Each file is specified with START_FILE, like this:

{-# START_FILE {{name}}.cabal #-}
name:                {{name}}
version:             0.1.0.0
...

Parameters to the template are written {{foo}}. They are provided by users via their ~/.stack/config.yaml file, like this:

templates:
  params:
    author-email: chrisdone@gmail.com
    author-name: Chris Done
    copyright: 2018 Chris Done
    github-username: chrisdone
    category: Development

When the user runs stack new myproject yourtemplate and they do not have the parameters provided in, it will warn the user that such parameters were missing, like this:

$ stack new foo new-template
Downloading template "new-template" to create project "foo" in foo/ ...
The following parameters were needed by the template but not provided: author-email, author-name
You can provide them in /home/chris/.stack/stack.yaml, like this:
templates:
  params:
    author-email: value
    author-name: value
Or you can pass each one as parameters like this:
stack new foo new-template -p "author-email:value" -p "author-name:value"

The output of the template will yield a blank space where your parameter was. If you want to provide default values for your template parameters, use this Mustache syntax:

author:              {{author-name}}{{^author-name}}Author name here{{/author-name}}

template-info.yaml

When contributing a new template, please remember to add a corresponding entry to template-info.yaml. Additional descriptive information for the template may be provided, but is not required.

Yesod templates

NOTE: The Yesod templates are generated from the yesod-scaffold repo. Please send pull requests for those templates to that repo instead.