Re: [Haskell-cafe] ANN: Newt - command-line template instantiation tool library
On Mon, May 9, 2011 at 8:25 AM, Rogan Creswick cresw...@gmail.com wrote: Indeed :) The tag syntax is controlled by two command-line flags: --prefix=... and --suffix=... It can be difficult to get the desired strings past both the shell and the regular expression compiler (although that last bit is changing... Josh Hoyt sent a patch that switches to basic string inspection, which should make this much simpler to use.) I've just released newt-0.0.3.0, which has the patch from Josh (It also uses a much nicer command-line syntaxt - it's backwards compatible, but you can leave off the --source / --dest specifiers now.) With Josh's patch, things like this just work: $ newt --prefix=*** --suffix=*** You can also look at the configuration structure with --verbose to help debug problems with these flags: $ newt --list some input file --prefix=*** --suffix=*** --verbose Using configuration: Config {source = Just tests/testFiles/simpleTest/alternate1.txt, dest = Nothing, rawTable = [], list = True, inplace = False, prefix = Just ***, suffix = Just ***, verb = Loud} This release also fixes a pretty important bug relating to binary files... you couldn't have any binary content in your templates -- 0.0.3.0 doesn't try to perform template replacements on binary files now (which failed immediately in hGetContents in the previous version). Feedback / suggestions are always appreciated :) Thanks! --Rogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANN: Newt - command-line template instantiation tool library
2011/5/9 bri...@aracnet.com: On Sun, 8 May 2011 16:23:59 -0700 Rogan Creswick cresw...@gmail.com wrote: 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. This is a useful tool ! I would like to suggest allowing customization of the syntax to indicate a tag, e.g. {# #} instead of (You just knew someone was going to say that, right ? :-) Hello, Did you see his [1] footnote in his mail? Cheers, Thu ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANN: Newt - command-line template instantiation tool library
On Sun, May 8, 2011 at 10:38 PM, bri...@aracnet.com wrote: This is a useful tool ! I'm glad you think so too! I would like to suggest allowing customization of the syntax to indicate a tag, e.g. {# #} instead of (You just knew someone was going to say that, right ? :-) Indeed :) The tag syntax is controlled by two command-line flags: --prefix=... and --suffix=... It can be difficult to get the desired strings past both the shell and the regular expression compiler (although that last bit is changing... Josh Hoyt sent a patch that switches to basic string inspection, which should make this much simpler to use.) --Rogan I only mention this in the hopes that it still early enough for you to write the code in such a way to allow this even if you don't implement it right away. Brian ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANN: Newt - command-line template instantiation tool library
On Sun, 8 May 2011 16:23:59 -0700 Rogan Creswick cresw...@gmail.com wrote: 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. This is a useful tool ! I would like to suggest allowing customization of the syntax to indicate a tag, e.g. {# #} instead of (You just knew someone was going to say that, right ? :-) I only mention this in the hopes that it still early enough for you to write the code in such a way to allow this even if you don't implement it right away. Brian ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe