forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Handling raw HTML
Date Fri, 03 Jun 2005 11:46:29 GMT
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

Mime
View raw message