Re: Learning and using aap in website project

Fredrik <aap-rLZlch/[email protected]> Tue, 29 Jun 2004 14:32:16 +0200
Newsgroups gmane.comp.tools.aap.user
Message-ID <[email protected]>
On [040629 11:30] Bram Moolenaar <[email protected]> wrote:
> 
> Fredrik wrote:
> 
> > I'm maintaining a website for an non-profit org and all the articles
> > that get submitted is written in asciidoc[1] and I have been using
> > simple shell scripts for generating and uploading the site and has
> > worked pretty okay until I stumbled on a-a-p via asciidoc's homepage
> > and found an example how to build and maintain a site with asciidoc
> > and aap, beautiful!

[...]

> 
> [...]
> 
> > This works very well when you have the main.aap *.asc files in the
> > same directory. So my question is how I should do when using subdirs
> > for generating the site? 
> > 
> > I have checked the documentation and tried but with no luck. I
> > couldn't find any good examples either so I thought I would try my
> > luck here.
> 
> There are several ways to do this, of course.  Let's assume you want to
> separate generating the html files from uploading them.  This means you
> can try them out locally first.
> 
> Create a main.aap in the toplevel directory that contains something like
> this:

[...]

Thanx for the quick reply.

When following your instructions I get the following message:
$ aap
Aap: Do not know how to build "../html/index.asc"

$ aap -v
Options:
    verbose: 1
Values:
Targets:
Aap: Reading recipe "/usr/lib/aap/default.aap"
Aap: Finished reading recipe "/usr/lib/aap/default.aap"
Aap: Reading recipe "main.aap"
Aap: Reading recipe "filelist.aap"
Aap: Finished reading recipe "filelist.aap"
Aap: Entering directory `/home/stone/new-site/source'
Aap: Reading recipe "main.aap"
Aap: Reading recipe "../filelist.aap"
Aap: Finished reading recipe "../filelist.aap"
Aap: Finished reading recipe "main.aap"
Aap: Adding default dependency for "clean"
Aap: Adding default dependency for "cleanmore"
Aap: Entering directory `/home/stone/new-site'
Aap: Finished reading recipe "main.aap"
Aap: Adding default dependency for "clean"
Aap: Adding default dependency for "cleanmore"
Aap: Building the "all" target
Aap: 1 - updating target "all"
Aap: 2 - Using dependency "all : ../html/index.html ../html/aboutsite.html
../html/about.html"
Aap: Entering directory `/home/stone/new-site/source'
Aap: 3 - updating target "../html/index.html"
Aap: 4 - Using build rule "%.html : %.asc conf/asciidoc.conf" for target
"../html/index.html"
Aap: 5 - updating target "../html/index.asc"
Aap: 5 - Do not know how to build "../html/index.asc"
Aap: 5 - updating target "html/index.asc"
Aap: 5 - Do not know how to build "html/index.asc"
Aap: Do not know how to build "../html/index.asc"


Here is my setup:

main.aap
# Include the list of files to be generated
:include filelist.aap

HTML_FILES = html/$*(ROOT).html

# where to upload the HTML files to
:attr {publish = scp://web/%file%}
$HTML_FILES

:child source/main.aap

# Rules for building the HTML files
all: $HTML_FILES

# publish target: upload the HTML files (build them too)
publish: $HTML_FILES
  :publishall

filelist.aap
ROOT =
  index
  aboutsite
  about


source/main.aap
:include ../filelist.aap
HTML_FILES = ../html/$*(ROOT).html
ASCIIDOC_FILES = $*(ROOT).asc

all: $HTML_FILES

# AsciiDoc options to generate web pages
ASCIIDOC = '/home/stone/progs/asciidoc-5.0.8/asciidoc.py'
ASCIIDOC_OPTS = -b css -f conf/asciidoc.conf -g revision=1.0

# File translation rules.
:rule %.html : %.asc conf/asciidoc.conf
  @if target == 'index.html':
    # Index has description and keywords meta tags.
    ASCIIDOC_OPTS += -g index-only -o $target
  :sys $ASCIIDOC $ASCIIDOC_OPTS -o $target $(source[0])


I'm not shure what I'm missing.

--
.Fredrik


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com