forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
Subject Re: Problems with unified source directory
Date Fri, 15 Nov 2002 10:09:54 GMT
On Fri, Nov 15, 2002 at 09:12:13AM +0100, Nicola Ken Barozzi wrote:
> I've converted the Avalon Phoenix site to Forrest, and I'm trying a 
> unified dir structure, with all xdocs in src/documentation/content and 
> images in src/documentation/content/images.
> 
> I changed the two properties accordingly, and while the xdocs render 
> fine in both CLI and, the images are crawled by the CLI as html files 
> (header.gif.html) and not rendered.
...

Approaching the problem from the user's perspective..

For validation, we have a system of associating an includes and excludes
pattern with each directory:

forrest.validate.xdocs.includes=*.x*
forrest.validate.xdocs.excludes=

So how about using the same system for limiting what the xdocs-dir
contains:

forrest.xdocs-dir.includes = **/*.xml
forrest.xdocs-dir.excludes = images/**


So forrest.properties for phoenix would be:

forrest.xdocs-dir = src/documentation/content
forrest.xdocs-dir.excludes = images/**
forrest.images-dir = src/documentation/content/images

Then we have a parametrized sitemap entry which uses the includes and
excludes, so that matchers only exist for valid transformations.

<map:match type="AntMatcher"
           includes="{layout:xdocs-dir/includes}"
           excludes="{layout:xdocs-dir/excludes}"
   <map:generate src="{layout:xdocs-dir}/{0}"/>
   ...
</map:match>

That could be implemented with an XMLModule (hence {layout:..} syntax)
and a forrest.properties replacement looking like this:

<forrest-layout dir="src/documentation/content">

  <images-dir dir="images">
    <include name="*.*"/>
    <exclude name=""/>
  </images-dir>

  <xdocs-dir dir="">
    <include name="**/*.xml"/>
    <exclude name="${images-dir}"/>
  </xdocs-dir>

</forrest-layout>


As you can see I'm making stuff up as I go.. a more coherent version of
this was intended to be the topic of a "Proposed Forrest Roadmap" email.
The only thing worth salvaging from this is that the current system _can_
be evolved to support use-cases like mixed content, without turning the
sitemap into a try-handle-anything mess.


--Jeff


Mime
View raw message