forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Crossley <cross...@apache.org>
Subject tidy html output (Was: Views)
Date Mon, 05 Dec 2005 22:30:13 GMT
Cyriaque Dupoirieux wrote:
> David Crossley a ?crit :
> >Diwaker Gupta wrote:
> >>Paul Bolger wrote:
> >>
> >>>[indent html]  Where would one put the indent="yes" attribute to get
> >>>Forrest to output indented html?
> >>>
> >>I'm unable to recall any such attribute in views right now. It _is_ 
> >>possible to use JTidy to indent the generated HTML -- but the last time I 
> >>tried it, I ran into some problems. More details on this later. For now, 
> >>I'd say you are better off just running tidy on your own, after Forrest 
> >>is done generated the HTML.
> >
> >This is the job of the HTML Serializer.
> >http://cocoon.apache.org/2.1/userdocs/default/html-serializer.html
> >I see that there is an "indent" parameter.
> >
> >Try adding that to your sitemap components declaration
> >main/webapp/sitemap.xmap line 191
> >
> I tried to add :
>       * <indent>yes</indent>*
>      </map:serializer>
> But it's not indenting anything :-( ...

Yeah, i realised later that "yes" is the default.
Reading the docs, it says that line-breaks are placed
only after certain elements.

One should try indent=no and do a diff.

I wonder if the serializer just passes through any
whitespace and the indent parameter does not do
very much.

If so, then it must be up to our various transformers
to add bits of indenting along-the-way.

Our pelt skin is doing reasonable indentation in this
way, but the new dispatcher-based sites are not.

Perhaps we should add JTidy as the last transformer
in our pipeline. Even better would be the option
to completely collapse whitespace or pretty print.

> I think this point is important because the generated HTML is nearly 
> unreadable and the HTML Tidy always gives the same line for warnings - 
> because the code is nearly generated in one line...

That is definitely a problem.

-David

Mime
View raw message