David Crossley wrote: > 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.
Thorsten wrote in the previous thread: > We are using the XHTML serializer and *not* the html one David gave the > link for. Please see the internal.xmap of the structurer. Du'oh of course. I forgot that the discussion started with the new dispatcher stuff. However, the problem is the same in both cases. > 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