I have some theories. I’ve written a lot of software over the years that generates HTML, and usually the process is modular: build a block here, a block there, based on templates which can have their formatting set or not. Freeway works at a more atomic level, building individual tags and stitching them together into a DOM (document object model). This reminds me of the XSLT transform process, which is building a tree of tags, and then transforming it into a plain text representation as the last step. But some leaves of that DOM “tree” may already be text – in the case of Action output, that’s sometimes the only way to get what you need done. If those leaves are output in the same process as the full-figured tag nodes, then any refinements possible during the output process are going to be skipped, because the text node doesn’t understand its contents – it’s just “dumb” text.
One thing I have used over and over is the idea of a post–process with a code-aware pretty printer (usually Tidy). This system ingests the raw HTML in any state of validity, and corrects it and outputs it in beautiful hand-coder style. I was inspired by Rails’s beautifully formatted source code: no matter how many layers of template nesting you perform, the output is always properly indented.
This carries with it a certain risk, because the process can be “lossy”. Just as invalid code may render differently in one browser than another, a “correcting” system like this must make certain guesses when it encounters something that is not according to the spec (actually wrong, not just messy). While Freeway doesn’t write incorrect code, you are certainly free to do so in the HTML Markup and Extended interfaces, and Actions can always be badly written, too (I’m certainly guilty of this from time to time). So you could end up with beautifully-formatted code that didn’t match your layout in some regard.
Walter
On Oct 11, 2013, at 10:12 AM, Ernie Simpson wrote:
To be fair FWP tidies the code to a large extent - but that is what I find
most hard to understand, is why does it behave so partially measured… with
so many things.
It’s as if part of the development group is searching about for direction
and the other part keeps stopping them at half measures.
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options