On Mar 26, 2004, at 11:04, Michael Davis wrote:

> What you do think about changing the relationship between RDoc and the 
> template?  I seems like having the template be a module that RDoc 
> mixes in may provide simpler templates and offer the template more 
> flexibility in generating output.  This could involve having RDoc 
> build containers (possibly arrays) for each of the sections and then 
> passing each container to a method in the template that returns a 
> string containing the formatted HTML for that section.

That's actually how it works now: the HTML generator builds a container 
(actually a hash) and then invokes the templating engine, passing in 
the values in the hash and the name of the actual template.


> It would nice to be able to view and alter the container before it is 
> processed, this could be accomplished by calling a method and passing 
> in the container just after the container is built.  I would actually 
> prefer two methods for each section, one method that iterates over the 
> content of the container and a second method that processes each 
> element in the container.
>

That would be possible: could you give an example of what you'd do with 
this?

> This could also pave the way for easily creating different kinds of 
> outputers.  If the template contained all of the output methods, a 
> different outputer could be created just by creating a new template.

That's pretty much achievable right now: you just add a new generator 
to the generator/ directory.
You then invoke it from the command line using the --fmt xxx  directive.


Cheers

Dave