in reply to RFC : Abstraction Markup

 

"Does it start to make any sort of sense yet? What I'm talking about here is not a framework, altho I have built a framework out of it (it's too slow using my naive methods)

This abstraction method along with just another couple of quirks makes me able to build very complex sites out of completely reusable code blocks, and the abstract xmlesque code is completely operating system and even implementation language agnostic!

Come on someone out there must get it!"


Regardless of how useful/popular this module becomes for others it's clear you're excited and getting a lot out of the process. That's great. :)

I do however see problems with what you have so far if this is to be used by content managers, designers etc.

  1. Having an 'xmlesque' type syntax that is not actually xml or html may get very confusing very quickly.
  2. Also, how would I incorporate something like CSS (inline or imported ie: <div style="header"></div>) with your system? By what I've seen so far, I get the sense the code would become pretty unwieldy.

I am admittedly new to Tempalte::Toolkit (currently on page 49 of the 500+ page Perl Template Toolkit) but it's easy to see how I could send a file to a client and feel confident they would be able to understand it without much instruction.

Take one of your first examples. I would feel more comfortable sending the following to a client or fellow designer:

[% a = 'HELLO' b = 'WORLD' c = '!!' %] <html> <head></head> <body> [% a %] [% b %][% c %] </body> </html>

Then to process this simple template and output to a new html page from the command line:
$ tpage hello.tt > hello.html

Creates and writes to hello.html:
<html> <head></head> <body> HELLO WORLD!! </body> </html>

You may not be concerned about the same audience I am but consider how confusing looking at a file filled with html/xml style tags three, six or twelve months after you write the template would be.

My feeling is that if abstraction is your goal, it's not abstract enough. Look at Template for a very nice system that achieves abstraction. In contrast, I think it would also be beneficial to look at Text::Template for an anti-templating perspective. The documentation in particular (Check the Philosophy section) is a good description of the template creation process and why it fails many times.

Good luck and keep having fun!


"...the adversities born of well-placed thoughts should be considered mercies rather than misfortunes." — Don Quixote