Skip to content

Commit 1c372ca

Browse files
committed
Merge pull request #1199 from sfilipov/patch-1
yaml_configuration.md: Add information about template parameters
2 parents 8346914 + a05bb8f commit 1c372ca

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

doc/yaml_configuration.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,3 +346,33 @@ apply-ghc-options: locals # all local packages, the default
346346
```
347347

348348
Note that `everything` is a slightly dangerous value, as it can break invariants about your snapshot database.
349+
350+
### templates
351+
352+
Templates used with `stack new` have a number of parameters that affect the generated code. These can be set for all new projects you create. The result of them can be observed in the generated LICENSE and cabal files.
353+
354+
The 5 parameters are: `author-email`, `author-name`, `category`, `copyright` and `github-username`.
355+
356+
* _author-email_ - sets the `maintainer` property in cabal
357+
* _author-name_ - sets the `author` property in cabal and the name used in LICENSE
358+
* _category_ - sets the `category` property in cabal. This is used in Hackage. For examples of categories see [Packages by category](https://hackage.haskell.org/packages/). It makes sense for `category` to be set on a per project basis because it is uncommon for all projects a user creates to belong to the same category. The category can be set per project by passing `-p "category:value"` to the `stack new` command.
359+
* _copyright_ - sets the `copyright` property in cabal. It is typically the name of the holder of the copyright on the package and the year(s) from which copyright is claimed. For example: `Copyright: (c) 2006-2007 Joe Bloggs`
360+
* _github-username_ - used to generate `homepage` and `source-repository` in cabal. For instance `github-username: myusername` and `stack new my-project new-template` would result:
361+
```yaml
362+
homepage: http://github.com/myusername/my-project#readme
363+
364+
source-repository head
365+
type: git
366+
location: https://github.com/myusername/my-project
367+
```
368+
369+
These properties can be set in `config.yaml` as follows:
370+
```yaml
371+
templates:
372+
params:
373+
author-name: Your Name
374+
author-email: [email protected]
375+
category: Your Projects Category
376+
copyright: Copyright: (c) 2015 Your Name
377+
github-username: yourusername
378+
```

0 commit comments

Comments
 (0)