create new tag
, view all tags

Feature Proposal: Easing into readable template files


The current template files are hard to understand, let alone edit.

Description and Documentation

Using make(1), rcs(1), and some Perl scripts, we could transition to an extended format for template files, without breaking existing installations.

Let's say that I need to work on template x. Unfortunately, the *.x.tmpl files are all but incomprehensible, due to the lack of white space (e.g., newlines, indentation). And, not being a Template Wizard, I'm not sure what white space I can safely add.

So, I create a few helper scripts:

  • tmpl_expand - expand template files
  • tmpl_check - check template files
  • tmpl_update - update template files

tmpl_expand reads *.x.tmpl, making copies of the originals (*.x.tmpl_o) for safety. It then expands the files, placing the results in *.x.tmpl_e. tmpl_check processes the expanded files back into condensed format (*.x.tmpl_c), checking the results for consistency with *.x.tmpl_o.

Assuming that all goes well, I now have a set of editable files (*.x.tmpl_e). I perform my edits, then use tmpl_update to produce new *.x.tmpl files. A bit of make(1) and rcs(1) eases the process and provides a safety net.

I'm told that an extended format has been proposed and even implemented, but that it hasn't been brought into production, due to concerns over breaking existing installations. Might (something like) this approach provide a safe way to make a transition?


Impact and Available Solutions


-- Contributors: RichMorin


-- RichMorin - 14 Nov 2006

Topic revision: r1 - 2006-11-14 - RichMorin
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.