GithubHelp home page GithubHelp logo

rikvdkleij / stack-templates Goto Github PK

View Code? Open in Web Editor NEW

This project forked from commercialhaskell/stack-templates

1.0 1.0 0.0 567 KB

Project templates for stack new

Home Page: http://haskellstack.org

License: MIT License

Haskell 100.00%

stack-templates's Introduction

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: [email protected]
    author-name: Chris Done
    copyright: 2016 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.

stack-templates's People

Contributors

adituv avatar alexanderkjeldaas avatar beerendlauwers avatar bitemyapp avatar chrisdone avatar danburton avatar decentral1se avatar eriknstevenson avatar franklinchen avatar jpvillaisaza avatar jturner avatar k0kubun avatar kerscher avatar kyleondy avatar mgsloan avatar mihaimaruseac avatar noelmarkham avatar nrolland avatar phadej avatar psibi avatar reinh avatar rikvdkleij avatar rubik avatar seanhess avatar silky avatar snoyberg avatar soenkehahn avatar tfausak avatar thibauddauce avatar tonyday567 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.