-
Notifications
You must be signed in to change notification settings - Fork 1
/
manual.html
764 lines (715 loc) · 21 KB
/
manual.html
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.2.6" />
<style type="text/css">
/* Debug borders */
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
/*
border: 1px solid red;
*/
}
body {
margin: 1em 5% 1em 5%;
}
a {
color: blue;
text-decoration: underline;
}
a:visited {
color: fuchsia;
}
em {
font-style: italic;
color: navy;
}
strong {
font-weight: bold;
color: #083194;
}
tt {
color: navy;
}
h1, h2, h3, h4, h5, h6 {
color: #527bbd;
font-family: sans-serif;
margin-top: 1.2em;
margin-bottom: 0.5em;
line-height: 1.3;
}
h1, h2, h3 {
border-bottom: 2px solid silver;
}
h2 {
padding-top: 0.5em;
}
h3 {
float: left;
}
h3 + * {
clear: left;
}
div.sectionbody {
font-family: serif;
margin-left: 0;
}
hr {
border: 1px solid silver;
}
p {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
ul, ol, li > p {
margin-top: 0;
}
pre {
padding: 0;
margin: 0;
}
span#author {
color: #527bbd;
font-family: sans-serif;
font-weight: bold;
font-size: 1.1em;
}
span#email {
}
span#revision {
font-family: sans-serif;
}
div#footer {
font-family: sans-serif;
font-size: small;
border-top: 2px solid silver;
padding-top: 0.5em;
margin-top: 4.0em;
}
div#footer-text {
float: left;
padding-bottom: 0.5em;
}
div#footer-badges {
float: right;
padding-bottom: 0.5em;
}
div#preamble,
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
margin-right: 10%;
margin-top: 1.5em;
margin-bottom: 1.5em;
}
div.admonitionblock {
margin-top: 2.5em;
margin-bottom: 2.5em;
}
div.content { /* Block element content. */
padding: 0;
}
/* Block element titles. */
div.title, caption.title {
color: #527bbd;
font-family: sans-serif;
font-weight: bold;
text-align: left;
margin-top: 1.0em;
margin-bottom: 0.5em;
}
div.title + * {
margin-top: 0;
}
td div.title:first-child {
margin-top: 0.0em;
}
div.content div.title:first-child {
margin-top: 0.0em;
}
div.content + div.title {
margin-top: 0.0em;
}
div.sidebarblock > div.content {
background: #ffffee;
border: 1px solid silver;
padding: 0.5em;
}
div.listingblock {
margin-right: 0%;
}
div.listingblock > div.content {
border: 1px solid silver;
background: #f4f4f4;
padding: 0.5em;
}
div.quoteblock > div.content {
padding-left: 2.0em;
}
div.attribution {
text-align: right;
}
div.verseblock + div.attribution {
text-align: left;
}
div.admonitionblock .icon {
vertical-align: top;
font-size: 1.1em;
font-weight: bold;
text-decoration: underline;
color: #527bbd;
padding-right: 0.5em;
}
div.admonitionblock td.content {
padding-left: 0.5em;
border-left: 2px solid silver;
}
div.exampleblock > div.content {
border-left: 2px solid silver;
padding: 0.5em;
}
div.verseblock div.content {
white-space: pre;
}
div.imageblock div.content { padding-left: 0; }
div.imageblock img { border: 1px solid silver; }
span.image img { border-style: none; }
dl {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
dt {
margin-top: 0.5em;
margin-bottom: 0;
font-style: normal;
}
dd > *:first-child {
margin-top: 0.1em;
}
ul, ol {
list-style-position: outside;
}
div.olist > ol {
list-style-type: decimal;
}
div.olist2 > ol {
list-style-type: lower-alpha;
}
div.tableblock > table {
border: 3px solid #527bbd;
}
thead {
font-family: sans-serif;
font-weight: bold;
}
tfoot {
font-weight: bold;
}
div.hlist {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
div.hlist td {
padding-bottom: 15px;
}
td.hlist1 {
vertical-align: top;
font-style: normal;
padding-right: 0.8em;
}
td.hlist2 {
vertical-align: top;
}
@media print {
div#footer-badges { display: none; }
}
div#toctitle {
color: #527bbd;
font-family: sans-serif;
font-size: 1.1em;
font-weight: bold;
margin-top: 1.0em;
margin-bottom: 0.1em;
}
div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
margin-top: 0;
margin-bottom: 0;
}
div.toclevel2 {
margin-left: 2em;
font-size: 0.9em;
}
div.toclevel3 {
margin-left: 4em;
font-size: 0.9em;
}
div.toclevel4 {
margin-left: 6em;
font-size: 0.9em;
}
/* Workarounds for IE6's broken and incomplete CSS2. */
div.sidebar-content {
background: #ffffee;
border: 1px solid silver;
padding: 0.5em;
}
div.sidebar-title, div.image-title {
color: #527bbd;
font-family: sans-serif;
font-weight: bold;
margin-top: 0.0em;
margin-bottom: 0.5em;
}
div.listingblock div.content {
border: 1px solid silver;
background: #f4f4f4;
padding: 0.5em;
}
div.quoteblock-content {
padding-left: 2.0em;
}
div.exampleblock-content {
border-left: 2px solid silver;
padding-left: 0.5em;
}
/* IE6 sets dynamically generated links as visited. */
div#toc a:visited { color: blue; }
/* Because IE6 child selector is broken. */
div.olist2 ol {
list-style-type: lower-alpha;
}
div.olist2 div.olist ol {
list-style-type: decimal;
}
</style>
<title>AsciiDoc Website Builder</title>
</head>
<body>
<div id="header">
<h1>AsciiDoc Website Builder</h1>
</div>
<div id="preamble">
<div class="sectionbody">
<div class="para"><p>AsciiDoc Website Builder (awb) is a python program that allows you to write a website in almost plain text (ie AsciiDoc), plus a few simple configuration files. It exists to solve my problem of never updating my own website (which used a lot of PHP) because I couldn't quickly remember offhand all the changes and specific formatting I needed to add new pages.</p></div>
</div>
</div>
<h2 id="_features">Features</h2>
<div class="sectionbody">
<div class="ilist"><ul>
<li>
<p>
Flexible template system
</p>
</li>
<li>
<p>
Blog generation
</p>
</li>
<li>
<p>
Image gallery generation
</p>
</li>
<li>
<p>
sitemap.xml generation
</p>
</li>
<li>
<p>
All the yummy features of AsciiDoc
</p>
</li>
</ul></div>
</div>
<h2 id="_getting_started">Getting started</h2>
<div class="sectionbody">
<div class="para"><p>To start using awb you need to set up at least one website in your user awb configuration file. This is located at ~/.awb/awb.conf It could look something like this:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>[mywebsite]
siteroot: /home/me/mywebsite
baseurl: http://my.web.site
asciidoc options: -d book -b html4
tidy: true
index link local: true</tt></pre>
</div></div>
<div class="para"><p>This simply defines a website known to awb as "mywebsite". The options are:</p></div>
<div class="vlist"><dl>
<dt>
siteroot
</dt>
<dd>
<p>
The root directory of the awb website. The AsciiDoc source lives in <tt>siteroot/src</tt>, and the html output goes to <tt>siteroot/html</tt>.
</p>
</dd>
<dt>
baseurl
</dt>
<dd>
<p>
The url of the root of the website. This is used for generating sitemap.xml.
</p>
</dd>
<dt>
asciidoc options
</dt>
<dd>
<p>
Options to be passed to AsciiDoc. I use this to specify a custom html4.conf file in addition to the options shown in the example.
</p>
</dd>
<dt>
tidy
</dt>
<dd>
<p>
true/false (default: false) — whether to use HTML tidy on the output. If this is set true, you must also have a tidy-options in <tt>siteroot/src</tt>. See <a href="http://tidy.sourceforge.net/docs/quickref.html">http://tidy.sourceforge.net/docs/quickref.html</a> for details of what to put in this file.
</p>
</dd>
<dt>
index link local
</dt>
<dd>
<p>
true/false (default: false) — when generating index.html files, true generates local links (eg. page.html), false generates absolute links (eg. /docs/manuals/page.html)
</p>
</dd>
</dl></div>
<div class="para"><p>Once you have a website configured and some source files written, simply issue the command</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>% awb mywebsite</tt></pre>
</div></div>
<div class="para"><p>awb will only regenerate HTML files that have become out of date. If this doesn't work for some reason, the option -r can be used to fix it.</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>% awb -r mywebsite</tt></pre>
</div></div>
<div class="para"><p>This can be done from anywhere in the filesystem. awb knows from its configuration file where to read from and write to.</p></div>
</div>
<h2 id="_awbdir_conf">awbdir.conf</h2>
<div class="sectionbody">
<div class="para"><p>Each directory in the source tree may contain a configuration file named awbdir.conf. This file specifies directory-specific options to be used by awb.</p></div>
<h3 id="_dir_setup_section">[dir setup] section</h3><div style="clear:left"></div>
<div class="vlist"><dl>
<dt>
type
</dt>
<dd>
<p>
can be one of <em>normal</em>, <em>blog</em>, or <em>gallery</em>. <em>normal</em> is the default. The meaning of the types is explained below.
</p>
</dd>
<dt>
name
</dt>
<dd>
<p>
A descriptive name of the directory, as shown in the breadcrumb trail.
</p>
</dd>
</dl></div>
<h3 id="_awbdir_conf_blog_section">awbdir.conf [blog] section</h3><div style="clear:left"></div>
<div class="para"><p>This section defines settings used if the directory type is blog.</p></div>
<div class="vlist"><dl>
<dt>
num main posts
</dt>
<dd>
<p>
The number of posts to show on the index.html page of the blog.
</p>
</dd>
<dt>
num recent posts
</dt>
<dd>
<p>
The number of post titles to show in the "recent posts" list, and also the number of magazine titles to show in the "recent magazines" list.
</p>
</dd>
</dl></div>
<h3 id="_user_section">[user] section</h3><div style="clear:left"></div>
<div class="para"><p>Here you can define any option you like. It can be referred to in the template. This is useful when you want to use the same template across the site, but change small parts of it (eg. an image).</p></div>
<div class="para"><p>awbdir.conf options cascade from a directory to its children. This is quite convenient, as child directories need only override the parent options that do not apply. The only exception is the directory name, which does not cascade.</p></div>
</div>
<h2 id="_directory_types">Directory Types</h2>
<div class="sectionbody">
<h3 id="_normal">Normal</h3><div style="clear:left"></div>
<div class="para"><p>In a normal directory, all files ending in “.txt” have the template and subtemplate applied, and are then converted via AsciiDoc into HTML files.</p></div>
<div class="para"><p>If there is no index.txt file in the directory, one will be created, listing the subdirectories and documents in the directory (in alphabetical order according to title, directories first).</p></div>
<h3 id="_blog">Blog</h3><div style="clear:left"></div>
<div class="para"><p>awb's blog framework is quite flexible, although for obvious reasons it can't support reader comments. All you really need to do is to create your blog posts, one per file, using a logical naming structure. The index.html file (showing your most recent posts) and contents.html (listing the titles of all posts, with headings each month) are automatically generated for you.</p></div>
<div class="para"><p>awb uses the path of a post to determine its date. All the path separators are stripped out, leaving a string of digits which are interpreted as follows:</p></div>
<div class="ilist"><ul>
<li>
<p>
8 digits: yyyymmdd
</p>
</li>
<li>
<p>
10 digits: yyyymmddhh
</p>
</li>
<li>
<p>
12 digits: yyyymmddhhmm
</p>
</li>
</ul></div>
<div class="para"><p>The following paths all produce valid dates.</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>2007/10/12/13/15.txt
2007/10/121315.txt
2007/1012/1315.txt
200710121315.txt</tt></pre>
</div></div>
<div class="para"><p>This system leaves you with a lot of flexibility as to how deeply you want your directories nested.</p></div>
<div class="para"><p>The first line of the post file is taken as the title of the post. This title is used in the recent posts list and in contents.html. This is consistent with the AsciiDoc markup that you would normally use.</p></div>
<div class="para"><p>In addition to this standard blog format, awb also supports a magazine-like blog formatting feature. In this model, a collection of posts belong to a magazine, which has its own "table of contents" post which can be used to summarise and/or introduce the other posts. In addition, a magazine-like blog generates two extra insertables. A magazine-like blog also generates a magazine-contents.html file which contains a list of all magazines.</p></div>
<div class="para"><p>You define a magazine-like blog simply by including a post with a .mag.txt extension. Each .mag.txt file is a magazine "table of contents". All posts earlier than a .mag.txt post (and later than the previous .mag.txt post) belong to that magazine. Posts later than the latest .mag.txt belong to a virtual magazine entitled "News".</p></div>
<h3 id="_gallery">Gallery</h3><div style="clear:left"></div>
<div class="para"><p>When a directory is specified as a gallery, files with the extension .gal.txt are treated specially. Each .gal.txt file is a room in the gallery, and is formatted as shown in the following example:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>[room]
title: The title of the room.
intro: Some text introducing the room.
[filename.jpg]
title: The title of the photo.
caption: A caption for the photo.</tt></pre>
</div></div>
<div class="para"><p>The title, intro and caption values are optional, but if you don't use them, don't include them in your templates either.</p></div>
<div class="para"><p>If you are inserting the meta description tag, the intro is used as the room description, and the caption is used as the photo description.</p></div>
</div>
<h2 id="_templates">Templates</h2>
<div class="sectionbody">
<div class="para"><p>Each directory in the source tree may contain a configuration file named template.conf. This file contains the page templates to be used by awb. If a template is not specified, very basic defaults are provided.</p></div>
<div class="para"><p>Here is an example of template.conf:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>[main template]
This template is the first you would
typically define.
Typically you would put here some
stuff that you want to insert before
the main text of your page, like a
navigation bar.
Then you insert the page content
like this:
<?insert content?>
Then you can write your footer.
[sub template]
This template replaces
<?insert content?> from the main
template. Use this when you need to
add a little content to each page,
but not override the inherited
main template.
[post template]
When you write a blog, this
template is applied to each
blog post. It replaces
<?insert content?>
[room template]
This template is used a lot like
a sub template for a gallery room.
[room photo template]
This template is applied to each
photo in a gallery room.
[photo template]
This template is a lot like a sub
template for each large-sized photo
in a gallery.</tt></pre>
</div></div>
<div class="para"><p>awb templates are cascading. This allows templates to be defined once in the root of the website, and applied everywhere. The only exception to this is the sub template, which does not cascade.</p></div>
</div>
<h2 id="_awb_commands">awb Commands</h2>
<div class="sectionbody">
<h3 id="_global_commands">Global commands</h3><div style="clear:left"></div>
<div class="para"><p>Commands may be used anywhere in an awb source file, but the most common place to use them is in templates. <? and ?> delimit awb commands (like php). The following commands are available:</p></div>
<div class="vlist"><dl>
<dt>
insert title
</dt>
<dd>
<p>
Inserts the title of the AsciiDoc source file that is being processed.
</p>
</dd>
<dt>
insert meta description html
</dt>
<dt>
insert meta description xhtml
</dt>
<dd>
<p>
These both insert a <meta name="description" content="A description of the page"> tag. If specified as xhtml, the closing / is also included. If the document has no description, this command is replaced with nothing (rather than an empty description). In regular documents, the description must be on the fourth line, and that line must start with “//”. This makes it a comment to AsciiDoc, so your description won't appear in the main text of the page. For galleries, the intro or caption will be used (see above).
</p>
</dd>
<dt>
insert content
</dt>
<dd>
<p>
Inserts the content of the page. The meaning of content depends on the template being used, but it follows common sense and really shouldn't be confusing.
</p>
</dd>
<dt>
insert breadcrumbs
</dt>
<dd>
<p>
Inserts a breadcrumb trail as a list, complete with links for previous directories up the hierarchy.
</p>
</dd>
<dt>
insert name
</dt>
<dd>
<p>
Inserts the directory name defined in awbdir.conf
</p>
</dd>
<dt>
insert user option "option"
</dt>
<dd>
<p>
Inserts a user-defined option (described later). The double-quotes are required.
</p>
</dd>
<dt>
insert page date "strftime format string"
</dt>
<dd>
<p>
Inserts the date (file's mtime) of the page being processed. If the format string is not specified, the default %A, %B %e, %Y (eg. Monday, January 1, 2008) is used.
</p>
</dd>
</dl></div>
<h3 id="_blog_commands">Blog Commands</h3><div style="clear:left"></div>
<div class="vlist"><dl>
<dt>
insert blog root
</dt>
<dd>
<p>
Inserts the path from the website root directory to the blog root directory.
</p>
</dd>
<dt>
insert blog recent
</dt>
<dd>
<p>
Inserts a list of the most recent blog posts.
</p>
</dd>
<dt>
insert magazine recent
</dt>
<dd>
<p>
Only for magazine-like blogs. Inserts a list of recent editions of the magazine-like blog.
</p>
</dd>
<dt>
insert magazine contents
</dt>
<dd>
<p>
Only for magazine-like blogs. Inserts a list of all posts belonging to the current magazine.
</p>
</dd>
<dt>
insert magazine title
</dt>
<dd>
<p>
Only for magazine-like blogs. Inserts the title of the current magazine.
</p>
</dd>
<dt>
insert magazine date "strftime format string"
</dt>
<dd>
<p>
Only for magazine-like blogs. Inserts the date of the current magazine, or "News" if the post is later than the latest magazine contents post. If the format string is not specified, the default %A, %B %e, %Y (eg. Monday, January 1, 2008) is used.
</p>
</dd>
</dl></div>
<h3 id="_gallery_commands">Gallery Commands</h3><div style="clear:left"></div>
<div class="vlist"><dl>
<dt>
insert room title
</dt>
<dd>
<p>
Inserts the title of the gallery room, as defined in the .gal.txt file. Only applies to the room page, not to the individual photo pages.
</p>
</dd>
<dt>
insert room intro
</dt>
<dd>
<p>
Inserts the intro of the gallery room, as defined in the .gal.txt file. Only applies to the room page, not to the individual photo pages.
</p>
</dd>
<dt>
insert room filename
</dt>
<dd>
<p>
Inserts the filename (without the .gal.txt extension) of the room file. This is useful when you want photos in subdirectories, rather than the same directory as the room file.
</p>
</dd>
<dt>
insert photo filename
</dt>
<dd>
<p>
Inserts the filename of the current photo (including the extension).
</p>
</dd>
<dt>
insert photo title
</dt>
<dd>
<p>
Inserts the title of the photo.
</p>
</dd>
<dt>
insert photo caption
</dt>
<dd>
<p>
Inserts the caption of the photo.
</p>
</dd>
</dl></div>
</div>
<h2 id="_ignoring_files">Ignoring Files</h2>
<div class="sectionbody">
<div class="para"><p>You may have files in your source directory that aren't supposed to go onto the website. Or you may have a text file (like Yahoo's verification file) that shouldn't get turned into HTML. You can tell awb to ignore these files using two special files in the root of your website source.</p></div>
<h3 id="_ignore">.ignore</h3><div style="clear:left"></div>
<div class="para"><p>Files listed here are totally ignored by awb. This file is simply a list of filenames on new lines. The filename can use the unix glob syntax (* and friends).</p></div>
<h3 id="_copytxt">.copytxt</h3><div style="clear:left"></div>
<div class="para"><p>Files listed here are copied straight to the HTML output directory. As with the ignore list, this is a list of filenames on new lines, and uses the glob syntax.</p></div>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2008-05-30 13:36:25 EST
</div>
</div>
</body>
</html>