[Haskell-cafe] ANN: Newt - command-line template instantiation tool & library

Rogan Creswick creswick at gmail.com
Mon May 9 01:23:59 CEST 2011

I'm happy to announce Newt: a trivial tool for creating boilerplate.

I frequently need to create projects with slight customizations -- I
have a particular layout for cabal projects, and make files for LaTeX
papers, etc...  However, there are often fields that need to be
updated in many places.  (At times, even file or directory names need
changed.)  Newt makes this trivial.  My objective was to provide a
tool that allows you to very quickly take a project, mark the portions
that must change with angle brackets, and use that as a source for
myriad derivations of that project, or share the project for others to
create their own instances.

Newt scans the input (either a file, directory or stdin) for tags
marked with "<<<tagName>>>" [1], then replaces those entries with
values specified on the command line, producing either a new file,
modifying the input template in place (--inplace), writing to stdout,
or writing to a directory.

A newt template for a cabal project is available on github:
  - http://github.com/creswick/Newt/tree/master/tests/testFiles/dirTemplates/cabalProject

Newt is available on hackage[2], and the source is hosted on github[3].

The readme provides more details and examples:
 - http://github.com/creswick/Newt/blob/master/README.md


[1] The tag syntax can be changed with command-line flags, or by
creating an instance of the Tag typeclass.  See --help.
[2] http://hackage.haskell.org/package/newt
[3] http://github.com/creswick/Newt/

More information about the Haskell-Cafe mailing list