File: main.aap

package info (click to toggle)
asciidoc 6.0.3-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,604 kB
  • ctags: 367
  • sloc: xml: 8,201; python: 3,518; makefile: 13; sh: 8
file content (89 lines) | stat: -rw-r--r-- 2,588 bytes parent folder | download
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
# 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