On Tue, 11 Jun 2002, Andy Wardley wrote: > On Sat, Jun 08, 2002 at 03:51:54PM -0700, Bryce Harrington wrote: > > Has anyone developed a listing of standard macro-names (i.e., and API) > > for common template-toolkit snippets (i.e. "widgets")? > > Kind of. > > The HTML and Splash template libraries achieve something like this. > Although it's an ad-hoc standard, it is at least a reasonably > well-defined interface to code against. >... > The TT docs (in the 'docs' directory) are an (ugly) example of this. > You can go and tweak the templates in docs/lib and build the > documentation in a different style if you like
*Nod* Okay, sounds like the direction I want to go. In fact the splash "skinning" approach has been sort of an inspiration for me on this. I guess the way I'd like to see this extended is to have a standardish "TT2 skin API" that I could make ettext (or other wiki-like converters) speak in. This way, one could write the site's contents in an arbitrary kind of structured text, convert it into this neutral templated language, and then apply the look and feel template skin atop it. Sort of CSS-by-brute-force but more flexible. I will research and try to think about how I can extract/derive a general process/mechanism for writing converters like these, and spec up a skin-neutral TT2 syntax they can output to. Looks like some really good ideas are being explored. > There are all sorts of useful widgets like this that should be part > of the HTML, Splash, or some other library, but aren't. It's easy to > add new widget templates, but we're starting to hit a complexity > barrier with the current approach. The Splash! templates, for example, > already contain way too many code-like directives that should really be > handled by a plugin, or better yet, a view. Could you elaborate on this? I saw some references in going through the mail archives about where one should draw the line between doing it in TT2 vs. Perl. Is there a pointer to something that expresses your official philosophy for TT2 with respect to what should be done in template syntax vs. what ought to be in code? > It also allows me to define all my metadata and document structure > information in one place (a <blech>XML</blech> file) and then process > this to build various index pages, navigation components, menus, etc., > automagically. This is very cool. WebMake does things similarly (tho I think TT2 is better on the extensibility front). I investigated using WebMake with TT2 as a general purpose build driver (my needs were more sophisticated than ttree could do), but ended up rolling my own cobbled together build system. Hmm, yet another area I'd like to explore further some day. Have you looked into WebMake or other existing build tools for features to add (or replace) ttree? I take it most people end up crafting something to suit their particular needs when they outgrow ttree? > Stas Bekman had taken the issue of building document sets a good few > steps further for the modperl 2 docs. > > A script then walks the directory, examining the config files, scanning > directories, processing and copying files, and doing all sorts of other > magic to build a final document system, complete with navigation, menus, > etc. Hmm, interesting, yeah I should like to look into that. I wrote up a similar system myself that we use at OSDL but it's way too kludgy to be of general use yet, and have been intending to find a more general purpose solution for quite some time now. (Our driving requirement was to be able to easily build test and development versions of the site, and be able to build the site on one machine (behind the firewall) and rsync it out to production machine.) Cool, okay thanks; this gives me lots of meat to chew on. Bryce
