From: Lane S. <la...@op...> - 2003-04-28 15:39:32
|
Hi Sebastian, I have come around to your thinking. Let's create a tool called Output. Much cleaner. And, Marc, this is really different than antwmcompile which is a batch processor. -Lane Sebastian Kanthak wrote: >Hi Marc, > >On Saturday 26 April 2003 14:57, Marc Palmer wrote: > > >>>I think, this should be orthogonal to the Template-Tool/Directive. We >>>could write an "OutputTool" that can write any macro to a file. If the >>>TemplateTool would return a macro (Keats, does it?) than one could write: >>> >>>#template $foo { >>>foo $x >>>} >>>#set $foo.Context.x = "bar" >>> >>>$Output.writeToFile($foo,"index.html") >>> >>>What do you think of this? >>> >>> >>If you want to easily write templates to a file, use my AntWMCompile tool. >>It just processes templates in batches, and dumps them out to an output >>tree based on the original extension of the template. >>http://www.wangjammers.org/antwmcompile >> >> > >well, I'm actually using AntWMCompile (it's great!) and added some extensions, >so that a template knows more about its location. Once I've finished this, >I'll write you another mail and explain this changes, perhaps they can be >included. > >My OutputTool proposal was a reaction on Lane's wish to include such a >possibility into the upcoming template-directive. So the requirement is to >output templates defined on the fly. I guess Lane wants to do some simple >scripting with webmacro. Personally I don't like this, because it puts too >much control into the template, in my opinion, but if Lane doesn't care... > >In my posting, I wanted to express, that I would rather see this feature not >built directly into the #template-directive, because in my opinion, >directives should be kept as simple as possible and there are so many >different possibilities, where a template should be written to: Into a file, >a database, via ftp.... > >Using a ContextTool for this task would give you this flexibility and would be >able to output every macro, not just templates. > >Sebastian > > > |