You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Miles Egan <mi...@caddr.com> on 2003/03/04 02:18:21 UTC

Matching file extensions with the DirectoryGenerator

I'm using the DirectoryGenerator to build index pages for directories. 
Everything's working well but I want to only display files with a 
limited set of file extensions.  This seems impossible to do with the 
current include/exclude flags because an include that specifically 
includes the extensions won't match directories and an exclude would 
have to include every possible filetype that might appear.  Am I just 
missing something?

If I'm right and this can't currently be done, I'm thinking of fixing it 
in one of two ways:

1. Add new includeExtensions / excludeExtensions properties which are 
space or comma separated lists of file extensions to include or exclude.

2. Add new fileInclude and fileExclude regexes which only operate on files.

Any thoughts?  Would either of these approaches be likely to make it 
into an accepted patch or should I just keep this to myself?

miles


Re: Matching file extensions with the DirectoryGenerator

Posted by Upayavira <uv...@upaya.co.uk>.
> 1. Add new includeExtensions / excludeExtensions properties which are
> space or comma separated lists of file extensions to include or
> exclude.
> 
> 2. Add new fileInclude and fileExclude regexes which only operate on
> files.

And:

3. Add new dirInclude and dirExclude regexes which only operate on directories.

for completeness.

I have struggled with this myself in the past, so something like this would have 
been extremely useful.

Regards, Upayavira