1 | ##################################################################### |
---|
2 | # |
---|
3 | # A-A-P file for making AsciiDoc web site. |
---|
4 | # (you can obtain A-A-P from http://www.a-a-p.org) |
---|
5 | # |
---|
6 | # Stuart Rackham <srackham@gmail.com> |
---|
7 | ##################################################################### |
---|
8 | |
---|
9 | :execute ../../common.aap |
---|
10 | |
---|
11 | WEB_NAME = asciidoc |
---|
12 | |
---|
13 | LAYOUT ?= layout2 |
---|
14 | |
---|
15 | # Various document locations. |
---|
16 | PROJ_DIR = ../.. |
---|
17 | DOCS_DIR = $PROJ_DIR/doc |
---|
18 | LOCAL_WEB = ~/tmp/asciidoc-web # Local web marshalling location. |
---|
19 | |
---|
20 | # List of web pages. |
---|
21 | WEB_ROOT = |
---|
22 | a2x.1 |
---|
23 | asciidoc-docbook-xsl |
---|
24 | asciidoc-graphviz-sample |
---|
25 | asciimathml |
---|
26 | asciidocapi |
---|
27 | CHANGELOG |
---|
28 | epub-notes |
---|
29 | faq |
---|
30 | index |
---|
31 | INSTALL |
---|
32 | latex-backend |
---|
33 | latex-bugs |
---|
34 | latexmathml |
---|
35 | manpage |
---|
36 | music-filter |
---|
37 | latex-filter |
---|
38 | publishing-ebooks-with-asciidoc |
---|
39 | README |
---|
40 | README-website |
---|
41 | source-highlight-filter |
---|
42 | support |
---|
43 | testasciidoc |
---|
44 | userguide |
---|
45 | version83 |
---|
46 | newtables |
---|
47 | newlists |
---|
48 | slidy |
---|
49 | slidy-example |
---|
50 | plugins |
---|
51 | WEB_PAGES = $*(WEB_ROOT).html |
---|
52 | WEB_SOURCE = $*(WEB_ROOT).txt |
---|
53 | |
---|
54 | # Web site specific pages to spell check. |
---|
55 | SPELL_CHECK = |
---|
56 | index.txt |
---|
57 | README-website.txt |
---|
58 | support.txt |
---|
59 | |
---|
60 | # Accompanying documents in DOCS_DIR. |
---|
61 | DOCS_ROOT = |
---|
62 | asciidoc |
---|
63 | asciidoc.1 |
---|
64 | DOCS = |
---|
65 | $*(DOCS_ROOT).txt |
---|
66 | $*(DOCS_ROOT).html |
---|
67 | $*(DOCS_ROOT).css-embedded.html |
---|
68 | asciidoc.pdf |
---|
69 | asciidoc.epub |
---|
70 | asciidoc.1 |
---|
71 | article.txt article.html article-standalone.html article-html5-toc2.html |
---|
72 | book.txt book.html |
---|
73 | book-multi.txt book-multi.html |
---|
74 | book.epub |
---|
75 | article.pdf |
---|
76 | latexmath.pdf |
---|
77 | |
---|
78 | # Client applications. |
---|
79 | @if OSTYPE == 'posix': |
---|
80 | ASPELL = `program_path("aspell")` |
---|
81 | @else: |
---|
82 | :print ERROR: Unsupported operating system $OSTYPE |
---|
83 | :exit |
---|
84 | |
---|
85 | :syseval which xmllint | :assign XMLLINT # Validates XML. |
---|
86 | |
---|
87 | ASCIIDOC = python ../../asciidoc.py |
---|
88 | # AsciiDoc options to generate documentation HTML. |
---|
89 | ASCIIDOC_HTML = |
---|
90 | $ASCIIDOC -b xhtml11 -f $(LAYOUT).conf -a icons -a badges -a revnumber=$(VERS)@ -a revdate="$(DATE)@" -a max-width=70em -a source-highlighter=highlight |
---|
91 | |
---|
92 | :rule %.html : %.txt $(LAYOUT).conf |
---|
93 | @if target in ('userguide.html','faq.html'): |
---|
94 | # User guide has author, revision, date in header. |
---|
95 | opts = -a toc -a numbered |
---|
96 | @elif target == 'index.html': |
---|
97 | # Index has description and keywords meta tags. |
---|
98 | opts = -a index-only |
---|
99 | @elif target in ('manpage.html','a2x.1.html'): |
---|
100 | opts = -d manpage |
---|
101 | @elif target == 'asciimathml.html': |
---|
102 | opts = -a asciimath |
---|
103 | @elif target == 'latexmathml.html': |
---|
104 | opts = -a latexmath |
---|
105 | @else: |
---|
106 | opts = |
---|
107 | @if target in ('index.html','INSTALL.html','asciidocapi.html','testasciidoc.html','publishing-ebooks-with-asciidoc.html'): |
---|
108 | opts += -a toc -a toclevels=1 |
---|
109 | :sys $ASCIIDOC_HTML $opts $(source[0]) |
---|
110 | @if _no.XMLLINT: |
---|
111 | :sys $XMLLINT --nonet --noout --valid $target |
---|
112 | @else: |
---|
113 | :print WARNING: xmllint(1) unavailable: skipping validation |
---|
114 | |
---|
115 | slidy.html : slidy.txt |
---|
116 | :sys $ASCIIDOC $(source[0]) |
---|
117 | |
---|
118 | slidy-example.html : slidy-example.txt |
---|
119 | :sys $ASCIIDOC $(source[0]) |
---|
120 | |
---|
121 | all: $(WEB_PAGES) |
---|
122 | |
---|
123 | copy: all |
---|
124 | # Copy to local web page. |
---|
125 | :sys rm -rf $LOCAL_WEB/* |
---|
126 | :sys mkdir -p $LOCAL_WEB/images/icons/callouts |
---|
127 | :sys cp $WEB_PAGES $LOCAL_WEB |
---|
128 | :sys cp $WEB_SOURCE $LOCAL_WEB |
---|
129 | :sys cp *.css $LOCAL_WEB |
---|
130 | :sys cp *.js $LOCAL_WEB |
---|
131 | :execute $PROJ_DIR/main.aap distribution # Make docs and tarball. |
---|
132 | :sys cp $DOCS_DIR/$*DOCS $LOCAL_WEB |
---|
133 | :sys cp $PROJ_DIR/stylesheets/docbook-xsl.css $LOCAL_WEB |
---|
134 | # Copy images. |
---|
135 | :sys cp $DOCS_DIR/images/*.png $LOCAL_WEB/images/ |
---|
136 | :sys cp $DOCS_DIR/images/icons/*.png $LOCAL_WEB/images/icons/ |
---|
137 | :sys cp $DOCS_DIR/images/icons/callouts/*.png $LOCAL_WEB/images/icons/callouts/ |
---|
138 | # Copy chunked User Guide. |
---|
139 | :sys rm -rf $LOCAL_WEB/chunked/ |
---|
140 | :sys mkdir -p $LOCAL_WEB/chunked/ |
---|
141 | :sys cp $DOCS_DIR/asciidoc.chunked/*.html $LOCAL_WEB/chunked/ |
---|
142 | :sys cp $DOCS_DIR/asciidoc.chunked/*.css $LOCAL_WEB/chunked/ |
---|
143 | :sys cp -R $DOCS_DIR/asciidoc.chunked/images $LOCAL_WEB/chunked/ |
---|
144 | :sys cp music?.* $LOCAL_WEB |
---|
145 | :sys cp sample?.png $LOCAL_WEB |
---|
146 | :sys cp latex?.png $LOCAL_WEB |
---|
147 | :sys cp *__*.png $LOCAL_WEB |
---|
148 | |
---|
149 | clean: |
---|
150 | :del {f} $WEB_PAGES |
---|
151 | :del {f} *.bak # Remove aspell backups. |
---|
152 | |
---|
153 | spell: $(SPELL_CHECK) |
---|
154 | # Interactively spell check all files. |
---|
155 | @if _no.ASPELL: |
---|
156 | @for s in source_list: |
---|
157 | :sys {i} $ASPELL check -p ./$(WEB_NAME)-website.dict $s |
---|
158 | @else: |
---|
159 | :print WARNING: aspell(1) unavailable, skipping spell checking |
---|