Matthew Weier OPhinney wrote:
> I was introduced to A-A-P via an interview with Bram Moolenaar I read
> several weeks ago. As a freelance web designer/programmer, I was
> intrigued by the possibilities it might give me vis-a-vis developing a
> website for multiple environments (development, customer test, and
> production), eliminating the need for server-side processing (SSI, Perl,
> and PHP) by allowing me to "compile in" relatively static content, and
> being able to focus on content and layout as separate issues, while
> still building static pages.
> I've come up with an algorithm that I'm in the middle of implementing
> with A-A-P that I'm very excited about. I have a perl script that is
> used to "compile" what I'm terming "htaap" pages. They utilize markup
> to separate "scripting" elements similar to php -- <?aap ?> -- and allow
> me to manipulate variables and include files in what finally becomes a
> valid HTML document.
Wow, there's an idea. I hadn't thought of going in that direction yet.
But it sounds like a nice combination, using a recipe to produce HTML in
a PHP-like way. Please keep us informed about your "htaap"
> One snag, however: I very typically create a fairly rigid and purposeful
> directory hierarchy, and I like to keep it somewhat fluid during the
> development stages. I'd rather not have to do something like this:
> FILES = `glob("src/html/*.html")`
> ad infinitum. Is there a function I can use to do a recursive glob from
> a starting directory? I don't know python, and the searches I've done
> all end up with creating new classes that you invoke, and I'm not sure
> how I would do this. The better possiblity for me would be for me to
> create a shell or perl script that I could then execute that would
> return the list of files -- but in looking through the A-A-P
> documentation, I don't see how I can do that (I see the ability to
> execute python code, but I don't know how to get python to execute a
> system program, for instance).
> Any ideas or solutions?
There is no native A-A-P solution for this yet. You can use Python, but
the os.path.walk() function isn't that simple to use.
I have two solutions in mind:
1. Add an "aapglob()" function that understands "**". This stands for
an arbitrary number of directories. Example:
FILES = `aapglob("src/html/**/*.html")`
2. A command similar to the Unix "find" command that takes a regexp for
the name. Should probably also allow selection of files and/or
directories. Could also use a filetype selection, so that you can
find files by their contents instead of only by name. I need this
when installing Vim: Set the mode for a file to executable if it's a
We should probably implement both. Which one first? I don't think I
have time for this soon (holidays coming up), thus if someone wants to
give it a shot, please do so.
CVS sux, men don't like commitment
/// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
/// Creator of Vim - Vi IMproved -- http://www.vim.org \\\
\\\ Project leader for A-A-P -- http://www.a-a-p.org ///
\\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///