[Templates] tgen 1.00 release (was Re: EtText 2 TT2?)

Bryce Harrington bryce@osdl.org
Fri, 27 Sep 2002 10:36:10 -0700 (PDT)


On Mon, 10 Jun 2002, Bryce Harrington wrote:
> > > > Along the same vein, has anyone linked TT2 with a structured-text
> > > > processor like STX or EtText?
> > >
> > > > What I'm thinking of is a system where an end user can submit content in
> > > > lightly-formatted plain text and instead of converting it directly to
> > > > HTML (via ettext2html), runs it through one of a set of processors that
> > > > can convert it to a standardish TT2 syntax, and then use template
> > > > toolkit to render the HTML using a site-specific TT2-based style macro
> > > > library.
[ Snip some very helpful discussions ]
>
> Thanks guys, I think I'll try to hack together something and post back
> here when ready, in case anyone else can make use of such a thing.
>
> Bryce

Hi All,

Okay, hacking complete.  :-)

I've released 'tgen' version 1.00 for use.  tgen is a tool for
processing files from one form (such as EtText) to another (such as
Template-Toolkit).  This scheme allows leveraging the simplicity of
EtText syntax with the flexibility and power of TT2, all controllable
from the commandline or shell scripts.

It is designed to be used in conjunction with Template-Toolkit's 'ttree'
command, serving as a pre-processor.

It is not limited to EtText only; it uses the source file's extension
and a config file to determine how to treat the files.  *.man pages can
be run through the man2html converter and *.pod through pod2html, as
illustrated in the included example.  This could also be used in
conjunction with Sodipodi, LaTeX, DocBook, code2html, autodia, and
countless other such tools for automating generation of web viewable
content from the appropriate source files.  It also allows chaining of
converters just like you'd do on the commandline; for example:

   foo:  cat FILE | grep bar | sort | ettext2html | stripheadfoot

This will convert files named "*.foo" into template-toolkit-ready HTML.

The included filters (named *2hts) currently only use template-toolkit
for appending the header and footer, though the example should make it
clear how to extend this further.  I hope to continue exploration of
development of a general purpose TT2 syntax that could be emitted by
autoformatters like EtText and Text::WikiFormat, as we'd touched on in
the earlier discussions.

The homepage for tgen is at the Open Source Development Lab:

    http://www.osdl.org/projects/tgen/

and has a page at Freshmeat:

    http://www.freshmeat.net/projects/tgen/

------------------------------------------------------------------------
Bryce Harrington                                       bryce@neptune.net
Sr. Performance Engineer                                  bryce@osdl.org
Open Source Development Lab                         http://www.osdl.org/