Re: question: aap modules for building websites

Bram Moolenaar <[email protected]> Sun, 18 Apr 2004 16:56:06 +0200
Newsgroups gmane.comp.tools.aap.user
Message-ID <[email protected]>
Tim Hemel wrote:

> Since I thought it was about time to make a new homepage, I thought it would
> be a nice exercise to use aap for this in combination with some Python
> templating tools that I wrote. Unfortunately I keep getting confused when
> reading the manuals: which approach is the nicest one?
> 
> I lay out the source for my website as follows:
> 
> # web page generating code
> main.aap
> Templater.py
> # data for a blog like page
> data/Notes/001.html
> data/Notes/002.html
> # photo albums
> data/Photos/index.txt
> data/Photos/1.jpg
> data/Photos/2.jpg
> data/Photos/Album/index.txt
> data/Photos/Album/me.jpg
> 
> Now, of course I can make an aap recipe that works for this situation, but
> it would be so much nicer if this can be put into an aap module.
> Then, someone could for example use this:
> 
> :import blog
> :attr { filetype = blog } data/Notes
> 
> :import album
> :attr { filetype = album } data/Photos

I had not thought about assigning a filetype to a directory yet.
Interesting idea, but I don't know if it will work as expected.

> or something that is just as short and readable. However, I get
> extremely confused because I can use :route, :rule, :action, :totype,
> :produce, :import, etc. I somehow fail to see how it all interrelates.
> 
> The first question is: does anybody have a suggestion on how to best
> do this with aap?

That depends on what you want to do.  It would help if you list the
commands that need to be executed when generating and uploading
everything.

> Second question: I have of course already tried to find a solution
> myself.  In the above example I tried to give the source files a
> filetype, and I can come up with some :route commands to convert this
> type into HTML, but that does not seem to work. It complains that
> filetype blog does not exist. Reading the manual says that the
> :filetype command needs to have a certain pattern or a suffix to
> recognize the filetype, but that is the whole point, there is no such
> rule, the user has to specify that.

You can declare the filetype:

		:filetype
			declare blog

This is explained in chapter 28, Customizing Filetype Detection and
Actions.

-- 
SIGIRO -- irony detected (iron core dumped)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click