1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="Stuart Rackham" />
<meta name="author-email" content="srackham@methods.co.nz" />
<link rel="stylesheet" href="main.css" type="text/css" />
<title>A-A-P Script</title>
</head>
<body>
<div id="header">
<img src="header.png" alt="Header" />
</div>
<div id="menu">
<a href="index.html">Overview</a>
<a href="webpages.html">Web Pages</a>
<a href="aap-script.html">A-A-P Script</a>
<a href="execution-environment.html">Execution Environment</a>
<a href="installation-wizard.html">Installation Wizard</a>
<a href="cdrom-creation.html">CD-ROM Creation</a>
<a href="links.html">Links</a>
<a href="feedback.html">Feedback</a>
</div>
<div id="content">
<h1>A-A-P Script</h1>
<div id="preamble">
<p>
The purpose of the A-A-P script is to orchestrate building the web
pages using <tt>asciidoc(1)</tt> and publishing (uploading) the web pages using
FTP.
</p>
<p>
The <tt>main.aap</tt> A-A-P script contains recipes to build the HTML web
pages (by running <tt>asciidoc(1)</tt>) and to publish the web pages (upload to
host website using FTP).
</p>
<ul>
<li>
<p>
You will need to edit the <tt>FTP_ROOT</tt> definition to correspond to
your upload site's FTP parameters.
</p>
</li>
<li>
<p>
Use A-A-P version 0.121 or better (there was an FTP problem under
Windows in previous versions).
</p>
</li>
</ul>
<p>
The spell checking are archiving recipes can be run if you have the
<tt>aspell(1)</tt> spell checker and <tt>tar(1)</tt> archive programs installed.
</p>
</div>
<h2>Executing the A-A-P Recipe Executive</h2>
<p>
The setup wizard installs program icons to execute the <tt>main.aap</tt>
<tt>build</tt> and <tt>publish</tt> recipes.
</p>
<p>
These program icons run A-A-P by executing the <tt>aap.bat</tt> batch file:
</p>
<div class="listingblock"><pre>
.\bin\python\python.exe ./bin/aap/Exec/aap.py %1 %2 %3 %4 %5 %6 %7 %8 %9
pause
</pre></div>
<p>
Note that the <tt>python.exe</tt> and <tt>aap.py</tt> paths are explicit and are
relative to the website development directory.
</p>
<p>
Here is the <tt>main.aap</tt> script:
</p>
<div class="listingblock"><pre>
# A-A-P file for managing example AsciiDoc generated website.
#
# Works under FreeBSD, Linux, MS Windows.
#
# IMPORTANT: When running in a Microsoft Windows environment this recipe must
# be located in a path with an assigned drive letter (not a UNC path). If
# necessary use Windows Explorer or the NET USE command to map a network drive.
WEB_NAME = asciidoc-example
VERS = 0.2
# FTP upload destination.
# Edit the following line to match your FTP account login, password,
# host.name and root/upload/directory.
FTP_ROOT = ftp://login:password@host.name//root/upload/directory
# List of web pages.
ROOT =
index
webpages
aap-script
execution-environment
installation-wizard
cdrom-creation
links
feedback
ASCIIDOC_FILES = $*(ROOT).txt
HTML_FILES = $*(ROOT).html
WEB_FILES =
$HTML_FILES
`glob("*.css")`
`glob("*.png")`
# Client applications.
@if OSTYPE == 'posix':
ASCIIDOC = `program_path("asciidoc")`
TAR = `program_path("tar")`
ASPELL = `program_path("aspell")`
@elif OSTYPE == 'mswin':
ASCIIDOC = .\bin\python\python.exe .\bin\asciidoc\asciidoc.py
TAR =
ASPELL =
@else:
:print ERROR: Unsupported operating system $OSTYPE
:exit
# AsciiDoc options to generate web pages.
ASCIIDOC_OPTS = -b css -f asciidoc.conf -a revision=$VERS -a imagesdir=.
# File translation rules.
:rule %.html : %.txt asciidoc.conf
@if target == 'index.html':
# Index has description and keywords meta tags.
ASCIIDOC_OPTS += -a index-only
:sys $ASCIIDOC $ASCIIDOC_OPTS $(source[0])
all: build
build: $HTML_FILES
publish: build
# Upload modified files to public web.
:attr {publish = $FTP_ROOT/%basename%} $WEB_FILES
:publish $WEB_FILES
clean:
:del {f} $HTML_FILES
:del {f} *.bak # Remove aspell backups.
spell: $ASCIIDOC_FILES
# Interactively spell check all files.
@if _no.ASPELL:
@for s in source_list:
:sys {i} $ASPELL check -p $(WEB_NAME)-website.dict $s
@else:
:print WARNING: aspell(1) unavailable, skipping spell checking
archive:
# Make tarball of web project directory in the ~/webs/archive.
@if _no.TAR:
ARCHIVE = $(WEB_NAME)-website-$(VERS)
:sys cd .. && ln -s $WEB_NAME $(ARCHIVE)
:sys cd .. && tar -czhf ~/webs/archive/$(ARCHIVE).tar.gz \
--exclude bin $(ARCHIVE)/*
:sys cd .. && rm -f $(ARCHIVE)
@else:
:print WARNING: tar(1) unavailable, skipping archive creation
</pre></div>
</div>
<div id="footer">
<p>
Website built using <a href="http://www.methods.co.nz/asciidoc/">AsciiDoc</a>
and <a href="http://www.a-a-p.org/">A-A-P</a><br/>
Last updated 29-Jan-2005 14:47:07 NZDT <br/>
</p>
<p><span class="ahem">This document might look funny (or very plain) to you,
since you're not using a browser which (correctly) supports CSS.</span></p>
</div>
</body>
</html>
|