[Haskell-cafe] ANN: Newt - command-line template instantiation tool & library
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>>>" , 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:
Newt is available on hackage, and the source is hosted on github.
The readme provides more details and examples:
 The tag syntax can be changed with command-line flags, or by
creating an instance of the Tag typeclass. See --help.
More information about the Haskell-Cafe