You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Ross Gardler <rg...@apache.org> on 2005/06/03 13:46:29 UTC

Handling raw HTML

I've been putting some thought into how to handle raw HTML. There are 
quite a few solutions to this, but somehow they all seem wrong for 
various reasons.

The suggested attribute in skinconf feels like a hack

The include/exclude patterns in site.xml is very powerful but is quite 
complex to implement and I think there may be a better solution when we 
switch to views because that will provide per directory configs.

The locationmap provides a good place to mark raw content, but that is 
not ready yet and won't be until 0.8.

I would like to suggest yet another alternative for 0.7 for the issue of 
raw HTML. This would be one in the form of a FAQ, a link to the FAQ from 
the upgrade doc and a demo in fresh-site - in other words there is no 
complex implementation to hold 0.7 up further.

The FAQ would give the following sitemap match which should be placed in 
the project sitemap in order to duplicate the 0.6 behaviour.

<map:match pattern="**.html">
   <map:select type="exists">
     <map:when test="{project:content}{0}">
       <map:read src="{project:content}/{0}" mime-type="text/html"/>
       <!--
         Use this instead if you want JTidy to clean up your HTML
         <map:generate type="html" src="{project:content}/{0}" />
         <map:serialize type="html"/>
       -->
     </map:when>
   </map:select>
</map:match>

An advantage of doing it this way is that we can have the same kind of 
functionality that is proposed with the include/exclude behaviour but 
without any additional implementation. For example:

<map:match pattern="old_site/**.html">
   <map:read src="{project:content.xdocs}/{0}" mime-type="text/html"/>
   <!--
     Use this instead if you want JTidy to clean up your HTML
     <map:generate type="html" src="{project:content.xdocs}/{0}" />
     <map:serialize type="html"/>
   -->
</map:match>

I'm going to implement this unless someone spots a fatal flaw in my plan 
(lazy consensus is in operation)

Ross

Re: Handling raw HTML

Posted by Ross Gardler <rg...@apache.org>.
David Crossley wrote:
> Ross Gardler wrote:

...

>>In the meantime I would appreciate it if some could test I have 
>>correctly emulated the 0.6 behaviour and see if the docs in fresh-site 
>>are clear. I still have to do the FAQ and the update document.
> 
> 
> It seems to work as described.
> 
> However there is a huge problem. The fix should remain as an FAQ only.
> Because you have added the match to the default sitemap for a fresh-site,
> then everyone who generates a 'forrest seed site' will have this workaround
> for 0.6 behaviour, rather than the new 0.7 behaviour.  In fact, this has
> also broken the demonstrations of the 0.7 behaviour e.g. the "Emembedded HTML"
> sample.

Ah, yes, good catch.

I'll fix it later today. Rather than remove it completely from
fresh-site I will modify the example to do what Ferdinand was talking
about - the inclusion of an old legacy site. This way the match will become:

<map:match pattern="old-site/**.html">

Ross


Re: Handling raw HTML

Posted by David Crossley <cr...@apache.org>.
Ross Gardler wrote:
> Ross Gardler wrote:
> 
> >I would like to suggest yet another alternative for 0.7 for the issue of 
> >raw HTML. This would be one in the form of a FAQ, a link to the FAQ from 
> >the upgrade doc and a demo in fresh-site - in other words there is no 
> >complex implementation to hold 0.7 up further.
> >
> >The FAQ would give the following sitemap match which should be placed in 
> >the project sitemap in order to duplicate the 0.6 behaviour.
> >
> ><map:match pattern="**.html">
> >  <map:select type="exists">
> >    <map:when test="{project:content}{0}">
> >      <map:read src="{project:content}/{0}" mime-type="text/html"/>
> >      <!--
> >        Use this instead if you want JTidy to clean up your HTML
> >        <map:generate type="html" src="{project:content}/{0}" />
> >        <map:serialize type="html"/>
> >      -->
> >    </map:when>
> >  </map:select>
> ></map:match>
> 
> ...
> 
> >I'm going to implement this unless someone spots a fatal flaw in my plan 
> >(lazy consensus is in operation)
> 
> I know I have only let a day go by, but I am truly convinced this is the 
> best solution for 0.7 so I've gone ahead an implemented it. If anyone 
> does object or find a problem I will take the responsibility to revert 
> the changes.
> 
> In the meantime I would appreciate it if some could test I have 
> correctly emulated the 0.6 behaviour and see if the docs in fresh-site 
> are clear. I still have to do the FAQ and the update document.

It seems to work as described.

However there is a huge problem. The fix should remain as an FAQ only.
Because you have added the match to the default sitemap for a fresh-site,
then everyone who generates a 'forrest seed site' will have this workaround
for 0.6 behaviour, rather than the new 0.7 behaviour. In fact, this has
also broken the demonstrations of the 0.7 behaviour e.g. the "Emembedded HTML"
sample.

--David

Re: Handling raw HTML

Posted by Ross Gardler <rg...@apache.org>.
Ross Gardler wrote:

...

> I would like to suggest yet another alternative for 0.7 for the issue of 
> raw HTML. This would be one in the form of a FAQ, a link to the FAQ from 
> the upgrade doc and a demo in fresh-site - in other words there is no 
> complex implementation to hold 0.7 up further.
> 
> The FAQ would give the following sitemap match which should be placed in 
> the project sitemap in order to duplicate the 0.6 behaviour.
> 
> <map:match pattern="**.html">
>   <map:select type="exists">
>     <map:when test="{project:content}{0}">
>       <map:read src="{project:content}/{0}" mime-type="text/html"/>
>       <!--
>         Use this instead if you want JTidy to clean up your HTML
>         <map:generate type="html" src="{project:content}/{0}" />
>         <map:serialize type="html"/>
>       -->
>     </map:when>
>   </map:select>
> </map:match>

...

> I'm going to implement this unless someone spots a fatal flaw in my plan 
> (lazy consensus is in operation)

I know I have only let a day go by, but I am truly convinced this is the 
best solution for 0.7 so I've gone ahead an implemented it. If anyone 
does object or find a problem I will take the responsibility to revert 
the changes.

In the meantime I would appreciate it if some could test I have 
correctly emulated the 0.6 behaviour and see if the docs in fresh-site 
are clear. I still have to do the FAQ and the update document.

Ross