mizuho 0.9.10 → 0.9.11
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +18 -2
- data/asciidoc/BUGS +3 -6
- data/asciidoc/BUGS.txt +0 -3
- data/asciidoc/CHANGELOG +660 -397
- data/asciidoc/CHANGELOG.txt +237 -2
- data/asciidoc/INSTALL +14 -14
- data/asciidoc/MANIFEST +2 -0
- data/asciidoc/Makefile.in +9 -1
- data/asciidoc/README +2 -2
- data/asciidoc/a2x.py +101 -43
- data/asciidoc/asciidoc.conf +18 -11
- data/asciidoc/asciidoc.py +615 -260
- data/asciidoc/common.aap +2 -2
- data/asciidoc/configure +9 -9
- data/asciidoc/configure.ac +1 -1
- data/asciidoc/doc/a2x.1 +34 -4
- data/asciidoc/doc/a2x.1.txt +12 -0
- data/asciidoc/doc/article.pdf +0 -0
- data/asciidoc/doc/asciidoc.1 +73 -29
- data/asciidoc/doc/asciidoc.1.txt +56 -30
- data/asciidoc/doc/asciidoc.dict +23 -2
- data/asciidoc/doc/asciidoc.txt +468 -327
- data/asciidoc/doc/book.epub +0 -0
- data/asciidoc/doc/faq.txt +201 -25
- data/asciidoc/doc/latex-filter.pdf +0 -0
- data/asciidoc/doc/music-filter.pdf +0 -0
- data/asciidoc/doc/publishing-ebooks-with-asciidoc.txt +1 -1
- data/asciidoc/doc/source-highlight-filter.pdf +0 -0
- data/asciidoc/doc/source-highlight-filter.txt +48 -37
- data/asciidoc/docbook45.conf +4 -4
- data/asciidoc/examples/website/ASCIIMathML.js +938 -0
- data/asciidoc/examples/website/CHANGELOG.txt +3056 -0
- data/asciidoc/examples/website/INSTALL.txt +227 -0
- data/asciidoc/examples/website/LaTeXMathML.js +1223 -0
- data/asciidoc/examples/website/README-website.txt +29 -0
- data/asciidoc/examples/website/README.txt +35 -0
- data/asciidoc/examples/website/a2x.1.txt +358 -0
- data/asciidoc/examples/website/asciidoc-docbook-xsl.txt +65 -0
- data/asciidoc/examples/website/asciidoc-graphviz-sample.txt +170 -0
- data/asciidoc/examples/website/asciidoc.css +533 -0
- data/asciidoc/examples/website/asciidoc.js +189 -0
- data/asciidoc/examples/website/asciidocapi.txt +189 -0
- data/asciidoc/examples/website/asciimathml.txt +61 -0
- data/asciidoc/examples/website/build-website.sh +25 -0
- data/asciidoc/examples/website/customers.csv +18 -0
- data/asciidoc/examples/website/epub-notes.txt +210 -0
- data/asciidoc/examples/website/faq.txt +1298 -0
- data/asciidoc/examples/website/index.txt +502 -0
- data/asciidoc/examples/website/latex-backend.txt +192 -0
- data/asciidoc/examples/website/latex-bugs.txt +134 -0
- data/asciidoc/examples/website/latex-filter.txt +196 -0
- data/asciidoc/examples/website/latexmathml.txt +41 -0
- data/asciidoc/examples/website/layout1.conf +153 -0
- data/asciidoc/examples/website/layout1.css +65 -0
- data/asciidoc/examples/website/layout2.conf +153 -0
- data/asciidoc/examples/website/layout2.css +83 -0
- data/asciidoc/examples/website/main.aap +159 -0
- data/asciidoc/examples/website/manpage.txt +197 -0
- data/asciidoc/examples/website/music-filter.txt +148 -0
- data/asciidoc/examples/website/newlists.txt +40 -0
- data/asciidoc/examples/website/newtables.txt +743 -0
- data/asciidoc/examples/website/plugins.txt +91 -0
- data/asciidoc/examples/website/publishing-ebooks-with-asciidoc.txt +398 -0
- data/asciidoc/examples/website/slidy-example.txt +167 -0
- data/asciidoc/examples/website/slidy.txt +113 -0
- data/asciidoc/examples/website/source-highlight-filter.txt +239 -0
- data/asciidoc/examples/website/support.txt +5 -0
- data/asciidoc/examples/website/testasciidoc.txt +231 -0
- data/asciidoc/examples/website/userguide.txt +5991 -0
- data/asciidoc/examples/website/version83.txt +37 -0
- data/asciidoc/examples/website/xhtml11-quirks.css +43 -0
- data/asciidoc/filters/latex/latex2png.py +28 -12
- data/asciidoc/filters/music/music2png.py +22 -6
- data/asciidoc/filters/source/source-highlight-filter.conf +7 -5
- data/asciidoc/help.conf +147 -131
- data/asciidoc/html4.conf +1 -0
- data/asciidoc/html5.conf +37 -39
- data/asciidoc/javascripts/asciidoc.js +3 -3
- data/asciidoc/lang-de.conf +4 -0
- data/asciidoc/lang-es.conf +2 -0
- data/asciidoc/lang-fr.conf +1 -1
- data/asciidoc/lang-hu.conf +2 -0
- data/asciidoc/lang-it.conf +2 -0
- data/asciidoc/lang-nl.conf +5 -0
- data/asciidoc/lang-pt-BR.conf +2 -0
- data/asciidoc/lang-ru.conf +2 -3
- data/asciidoc/latex.conf +2 -2
- data/asciidoc/slidy.conf +4 -2
- data/asciidoc/stylesheets/asciidoc.css +29 -4
- data/asciidoc/stylesheets/docbook-xsl.css +12 -5
- data/asciidoc/stylesheets/toc2.css +1 -0
- data/asciidoc/stylesheets/xhtml11-quirks.css +1 -1
- data/asciidoc/tests/data/lang-de-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-en-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-es-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-fr-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-hu-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-it-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-it-test.txt +106 -0
- data/asciidoc/tests/data/lang-nl-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-pt-BR-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-ru-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-uk-man-test.txt +21 -0
- data/asciidoc/tests/data/testcases.conf +10 -0
- data/asciidoc/tests/data/testcases.txt +40 -0
- data/asciidoc/tests/testasciidoc.conf +143 -17
- data/asciidoc/tests/testasciidoc.py +11 -2
- data/asciidoc/{stylesheets → themes/flask}/flask.css +0 -0
- data/asciidoc/{stylesheets → themes/volnitsky}/volnitsky.css +1 -1
- data/asciidoc/vim/ftdetect/asciidoc_filetype.vim +1 -1
- data/asciidoc/vim/syntax/asciidoc.vim +1 -1
- data/asciidoc/xhtml11-quirks.conf +2 -2
- data/asciidoc/xhtml11.conf +35 -37
- data/lib/mizuho.rb +1 -1
- data/lib/mizuho/generator.rb +3 -1
- data/source-highlight/darwin/source-highlight +0 -0
- data/templates/juvia.js +30 -5
- metadata +58 -9
- data/asciidoc/stylesheets/asciidoc-manpage.css +0 -18
- data/asciidoc/stylesheets/flask-manpage.css +0 -1
- data/asciidoc/stylesheets/volnitsky-manpage.css +0 -1
@@ -0,0 +1,18 @@
|
|
1
|
+
"AROUT","Around the Horn","Thomas Hardy","120 Hanover Sq.
|
2
|
+
London","(171) 555-7788"
|
3
|
+
"BERGS","Berglunds snabbkop","Christina Berglund","Berguvsvagen 8
|
4
|
+
Lulea","0921-12 34 65"
|
5
|
+
"BLAUS","Blauer See Delikatessen","Hanna Moos","Forsterstr. 57
|
6
|
+
Mannheim","0621-08460"
|
7
|
+
"BLONP","Blondel pere et fils","Frederique Citeaux","24, place Kleber
|
8
|
+
Strasbourg","88.60.15.31"
|
9
|
+
"BOLID","Bolido Comidas preparadas","Martin Sommer","C/ Araquil, 67
|
10
|
+
Madrid","(91) 555 22 82"
|
11
|
+
"BONAP","Bon app'","Laurence Lebihan","12, rue des Bouchers
|
12
|
+
Marseille","91.24.45.40"
|
13
|
+
"BOTTM","Bottom-Dollar Markets","Elizabeth Lincoln","23 Tsawassen Blvd.
|
14
|
+
Tsawassen","(604) 555-4729"
|
15
|
+
"BSBEV","B's Beverages","Victoria Ashworth","Fauntleroy Circus
|
16
|
+
London","(171) 555-1212"
|
17
|
+
"CACTU","Cactus Comidas para llevar","Patricio Simpson","Cerrito 333
|
18
|
+
Buenos Aires","(1) 135-5555"
|
@@ -0,0 +1,210 @@
|
|
1
|
+
AsciiDoc EPUB Notes
|
2
|
+
===================
|
3
|
+
|
4
|
+
|
5
|
+
Restrictions
|
6
|
+
------------
|
7
|
+
- If the date format of the DocBook 'data' element is not formatted like
|
8
|
+
`YYYY[-MM[-DD]]` you will get an error like the following one when
|
9
|
+
validating with `epubcheck(1)`:
|
10
|
+
|
11
|
+
ERROR: doc/article.epub/OEBPS/content.opf(6): date value 'Dec 2003'
|
12
|
+
is not valid, YYYY[-MM[-DD]] expected
|
13
|
+
|
14
|
+
- Navigation headers are suppressed by `docbook-xsl/epub.xsl` (see
|
15
|
+
<<X3,bug report>>).
|
16
|
+
|
17
|
+
|
18
|
+
DocBook XSL Stylesheets related limitations and bugs
|
19
|
+
----------------------------------------------------
|
20
|
+
|
21
|
+
=== epub: toc.section.depth parameter ignored
|
22
|
+
https://sourceforge.net/tracker/?func=detail&aid=3043393&group_id=21935&atid=373747
|
23
|
+
|
24
|
+
epub outputs include every section in the table of contents regardless of the
|
25
|
+
toc.section.depth XSL Stylesheets parameter
|
26
|
+
(http://docbook.sourceforge.net/release/xsl/current/doc/html/toc.section.depth.html).
|
27
|
+
This behavior is specific to epub (xhtml and fo outputs honor
|
28
|
+
toc.section.depth).
|
29
|
+
|
30
|
+
Environment: DocBook XSL 1.75.2; Xubuntu 10.04
|
31
|
+
|
32
|
+
Also epub/docbook.xsl has written a hard-coded illegal dtb:depth value of -1
|
33
|
+
into the toc.ncx navigation control file:
|
34
|
+
|
35
|
+
<ncx:meta name="dtb:depth" content="-1"/>
|
36
|
+
|
37
|
+
Shouldn't it be a positive integer equal to the depth navPoint nesting in the
|
38
|
+
navMap element (see
|
39
|
+
http://www.niso.org/workrooms/daisy/Z39-86-2005.html#NavMeta)? Though epubcheck 1.05 doesn't flag it as invalid -- are they both wrong?
|
40
|
+
|
41
|
+
|
42
|
+
[[X1]]
|
43
|
+
=== epub: untitled DocBook sidebar emits invalid XHTML
|
44
|
+
https://sourceforge.net/tracker/index.php?func=detail&aid=2840768&group_id=21935&atid=373747
|
45
|
+
|
46
|
+
I get the same problem, but is confined to EPUB outputs (not XHTML)
|
47
|
+
and results in the sidebar and all subsequent text on the page
|
48
|
+
displayed in bold text in both Firefox 3.6.8 and Google Chrome
|
49
|
+
5.0.375.125 (I haven't checked other browsers).
|
50
|
+
|
51
|
+
Environment: DocBook XSL 1.75.2; Xubuntu 10.04
|
52
|
+
|
53
|
+
If a DocBook sidebar element does not have a title then the emitted
|
54
|
+
title is (I haven't checked other browsers).
|
55
|
+
set to <b/> instead of <b></b>, for example this DocBook markup:
|
56
|
+
|
57
|
+
<sidebar>
|
58
|
+
<simpara>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</simpara>
|
59
|
+
</sidebar>
|
60
|
+
|
61
|
+
Generates this EPUB XHTML:
|
62
|
+
|
63
|
+
<div class="sidebar"><p class="title"><b/></p><p>Lorem ipsum dolor
|
64
|
+
sit amet, consectetuer adipiscing elit.</p></div>
|
65
|
+
|
66
|
+
This problem is not picked up by either the epubcheck or the W3C
|
67
|
+
validators.
|
68
|
+
|
69
|
+
The problem does not occur generating XHTML which emits the following
|
70
|
+
for the above example:
|
71
|
+
|
72
|
+
<div class="sidebar"><p class="title"><b></b></p><p>Lorem ipsum
|
73
|
+
dolor sit amet, consectetuer adipiscing elit.</p></div>
|
74
|
+
|
75
|
+
|
76
|
+
=== epub: Unreferenced callout icons in OPF
|
77
|
+
NOTE: A workaround for this problem was added in `a2x(1)` version
|
78
|
+
8.6.5.
|
79
|
+
|
80
|
+
https://sourceforge.net/tracker/?func=detail&aid=2854075&group_id=21935&atid=373747
|
81
|
+
|
82
|
+
Environment: DocBook XSL 1.75.2; Xubuntu 8.04
|
83
|
+
|
84
|
+
When callouts are used in a document and callout graphics are disabled
|
85
|
+
(callout.graphics=0) the generated 'contents.opf' still contains
|
86
|
+
references to all the callout icons even though none are not
|
87
|
+
referenced in the generated XHTML content. This results in 10
|
88
|
+
epubcheck validation errors like:
|
89
|
+
|
90
|
+
image file OEBPS/images/icons/callouts/1.png is missing
|
91
|
+
|
92
|
+
It appears that epub is adding the icons to the OPF without
|
93
|
+
first checking the callout.graphics parameter.
|
94
|
+
|
95
|
+
|
96
|
+
=== epub: Table grids not generated
|
97
|
+
https://sourceforge.net/tracker/?func=detail&aid=2849647&group_id=21935&atid=373747
|
98
|
+
|
99
|
+
Environment: DocBook XSL 1.75.2; Xubuntu 8.04
|
100
|
+
|
101
|
+
DocBook XSL epub does not appear to process the DocBook table element rowsep
|
102
|
+
and colsep attributes -- table grids are not displayed. The DocBook
|
103
|
+
<table rowsep="1" colsep="1"> results in:
|
104
|
+
|
105
|
+
epub DocBook XSL generates:
|
106
|
+
|
107
|
+
<td style="text-align: left" valign="top">
|
108
|
+
|
109
|
+
i.e. epub is not generating CSS borders (same for generated th elements).
|
110
|
+
|
111
|
+
Compare this with the (correct) xhtml DocBook XSL generates the correct border
|
112
|
+
styles:
|
113
|
+
|
114
|
+
<td style="border-right: 1px solid ; border-bottom: 1px solid ; " align="left" valign="top">
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
=== epub: htmltoc is not generated
|
119
|
+
https://sourceforge.net/tracker/?func=detail&aid=2849686&group_id=21935&atid=373747
|
120
|
+
|
121
|
+
Environment: DocBook XSL 1.75.2; Xubuntu 8.04
|
122
|
+
|
123
|
+
If DocBook XSL TOC generation is specified the generated
|
124
|
+
'contents.opf' contains an 'htmltoc' element but the referenced TOC file
|
125
|
+
is not generated by DocBook XSL. For example the contents.opf contains:
|
126
|
+
|
127
|
+
<item id="htmltoc" media-type="application/xhtml+xml" href="ar01-toc.html"/>
|
128
|
+
|
129
|
+
but the actual TOC file `OEBPS/ar01-toc.html` is missing and epubcheck
|
130
|
+
generates validation errors like:
|
131
|
+
|
132
|
+
ERROR: doc/article.epub: OPS/XHTML file OEBPS/ar01-toc.html is missing
|
133
|
+
|
134
|
+
|
135
|
+
=== epub: leading dot in directory name error
|
136
|
+
https://sourceforge.net/tracker/?func=detail&aid=2849683&group_id=21935&atid=373747
|
137
|
+
|
138
|
+
Environment: DocBook XSL 1.75.2; Xubuntu 8.04
|
139
|
+
|
140
|
+
Specifying paths with a leading dot causes problems, for example:
|
141
|
+
|
142
|
+
<xsl:param name="html.stylesheet" select="'./docbook-xsl.css'"/>
|
143
|
+
|
144
|
+
This generates validation errors like:
|
145
|
+
|
146
|
+
ERROR: article.epub/OEBPS/index.html(4):
|
147
|
+
'OEBPS/./docbook-xsl.css': referenced resource missing in the package
|
148
|
+
|
149
|
+
The file is in the archive at the correct location, just doesn't
|
150
|
+
seem to like './' in the path name -- the path needs to be normalized
|
151
|
+
before being written to the contents.opf.
|
152
|
+
|
153
|
+
It's not just the validator, the file is missing when the EPUB is viewed
|
154
|
+
(in bookworm).
|
155
|
+
|
156
|
+
This works fine:
|
157
|
+
|
158
|
+
<xsl:param name="html.stylesheet" select="'docbook-xsl.css'"/>
|
159
|
+
|
160
|
+
|
161
|
+
[[X2]]
|
162
|
+
=== epub: admonition icon images missing from contents.opf
|
163
|
+
NOTE: A workaround for this problem was added in `a2x(1)` version
|
164
|
+
8.6.5.
|
165
|
+
|
166
|
+
https://sourceforge.net/tracker/?func=detail&aid=2849681&group_id=21935&atid=373747
|
167
|
+
|
168
|
+
Environment: DocBook XSL 1.75.2; Xubuntu 8.04
|
169
|
+
|
170
|
+
When admonition icons are specified epubcheck generates validation
|
171
|
+
errors like:
|
172
|
+
|
173
|
+
ERROR: article.epub/OEBPS/index.html(4):
|
174
|
+
'OEBPS/images/icons/note.png': referenced resource exists,
|
175
|
+
but not declared in the OPF file
|
176
|
+
|
177
|
+
i.e. The admonition icon is in the EPUB file but DocBook XSL has not
|
178
|
+
been added to the content.opf manifest. Compare this with callout icons
|
179
|
+
which are processed correctly.
|
180
|
+
|
181
|
+
|
182
|
+
[[X3]]
|
183
|
+
=== Table width attribute validation error
|
184
|
+
https://sourceforge.net/tracker/?func=detail&aid=2848734&group_id=21935&atid=373747
|
185
|
+
|
186
|
+
Environment: DocBook XSL 1.75.2; Xubuntu 8.04
|
187
|
+
|
188
|
+
I get the following validation errors when navigation headers are in
|
189
|
+
included in the generated XHTML:
|
190
|
+
|
191
|
+
ERROR: article.epub/OEBPS/ix01.html(3): attribute "width" not allowed
|
192
|
+
at this point; ignored
|
193
|
+
|
194
|
+
This is because DocBook XSL has emitted invalid XHTML 1.1: tables
|
195
|
+
using the 'width' element are generated automatically in navigation
|
196
|
+
headers.
|
197
|
+
|
198
|
+
Though, admittedly, navigation is redundant if you're reading with an
|
199
|
+
EPUB reader. Suppress by setting the suppress.navigation param to 1.
|
200
|
+
|
201
|
+
Is this a DocBook XSL bug?
|
202
|
+
|
203
|
+
|
204
|
+
The Linux zip(1) command
|
205
|
+
------------------------
|
206
|
+
If you use the Linux `zip(1)` command to update or create EPUB files
|
207
|
+
you must use the `-X`, `--no-extra` command-line option, if you do not
|
208
|
+
the platform dependent extra fields will confuse `epubcheck(1)` which
|
209
|
+
will emit errors like ``extra field length for first filename must be
|
210
|
+
0, but was 28''.
|
@@ -0,0 +1,1298 @@
|
|
1
|
+
AsciiDoc Frequently Asked Questions
|
2
|
+
===================================
|
3
|
+
|
4
|
+
|
5
|
+
NOTE: New FAQs are appended to the bottom of this document.
|
6
|
+
|
7
|
+
/////////////////////////////////////////////////////////////////
|
8
|
+
ADD NEW FAQS TO THE BOTTOM OF THIS DOCUMENT TO MAINTAIN NUMBERING
|
9
|
+
/////////////////////////////////////////////////////////////////
|
10
|
+
|
11
|
+
== How do you handle spaces in included file names?
|
12
|
+
Spaces are not allowed in macro targets so this include macro will not
|
13
|
+
be processed:
|
14
|
+
|
15
|
+
include::my document.txt[]
|
16
|
+
|
17
|
+
The work-around is to replace the spaces with the `{sp}` (space
|
18
|
+
character) attribute, for example:
|
19
|
+
|
20
|
+
include::my{sp}document.txt[]
|
21
|
+
|
22
|
+
|
23
|
+
== How do I number all paragraphs?
|
24
|
+
Some documents such as specifications and legalese require all
|
25
|
+
paragraphs to be sequentially numbered through the document, and to be
|
26
|
+
able to reference these numbers.
|
27
|
+
|
28
|
+
This can be achieved by using the DocBook toolchain but numbering the
|
29
|
+
paragraphs with AsciiDoc using a custom config file containing the
|
30
|
+
following (see http://www.methods.co.nz/asciidoc/userguide.html#X27
|
31
|
+
for ways to include such a file):
|
32
|
+
|
33
|
+
---------------------------------------------------------------------
|
34
|
+
[paragraph]
|
35
|
+
<formalpara{id? id="{id}"}{role? role="{role}"}{id? xreflabel="{paracounter}"}><title>{title}</title><para>
|
36
|
+
{title%}<simpara{id? id="{id}"}{role? role="{role}"}{id? xreflabel="{paracounter}"}>
|
37
|
+
{paracounter} |
|
38
|
+
{title%}</simpara>
|
39
|
+
{title#}</para></formalpara>
|
40
|
+
{counter2:paracounter}
|
41
|
+
{empty}
|
42
|
+
---------------------------------------------------------------------
|
43
|
+
|
44
|
+
References to the paragraphs operate in the normal way, you label the
|
45
|
+
paragraph:
|
46
|
+
|
47
|
+
-----------------------------
|
48
|
+
[[some_label_you_understand]]
|
49
|
+
paragraph contents
|
50
|
+
-----------------------------
|
51
|
+
|
52
|
+
and reference it in the normal manner:
|
53
|
+
|
54
|
+
-----------------------------
|
55
|
+
<<some_label_you_understand>>
|
56
|
+
-----------------------------
|
57
|
+
|
58
|
+
The text of the reference will be the paragraph number.
|
59
|
+
|
60
|
+
For this to work for HTML you have to generate it via the DocBook
|
61
|
+
toolchain.
|
62
|
+
|
63
|
+
|
64
|
+
== Sources of information on configuring DocBook toolchains
|
65
|
+
DocBook is a content and structure markup language, therefore
|
66
|
+
AsciiDoc generated DocBook markup is also limited to content and
|
67
|
+
structure. Layout and formatting definition is specific to the
|
68
|
+
DocBook toolchain.
|
69
|
+
|
70
|
+
The dblatex toolchain can be configured by setting parameters defined
|
71
|
+
at http://dblatex.sourceforge.net/doc/manual/sec-params.html or for
|
72
|
+
more complex styling by custom Latex stylesheets described at
|
73
|
+
http://dblatex.sourceforge.net/doc/manual/sec-custom-latex.html.
|
74
|
+
|
75
|
+
Similarly FOP can be configured by parameters described at
|
76
|
+
http://sagehill.net/docbookxsl/OptionsPart.html and with custom xsl
|
77
|
+
stylesheets generating formatting objects as described at
|
78
|
+
http://sagehill.net/docbookxsl/CustomizingPart.html.
|
79
|
+
|
80
|
+
|
81
|
+
[[X5]]
|
82
|
+
== How can I include embedded fonts in an EPUB document?
|
83
|
+
This is a two step process:
|
84
|
+
|
85
|
+
1. Declare the font files and their use in your document's CSS
|
86
|
+
stylesheet. For example:
|
87
|
+
+
|
88
|
+
[listing]
|
89
|
+
.........................................
|
90
|
+
@font-face {
|
91
|
+
font-family : LiberationSerif-Regular;
|
92
|
+
font-weight : normal;
|
93
|
+
font-style: normal;
|
94
|
+
src : url(LiberationSerif-Regular.ttf);
|
95
|
+
}
|
96
|
+
|
97
|
+
body {
|
98
|
+
font-family: LiberationSerif-Regular, serif;
|
99
|
+
}
|
100
|
+
.........................................
|
101
|
+
|
102
|
+
2. Declare the font file as resource when you use `a2x(1)` to
|
103
|
+
compile the EPUB. For example:
|
104
|
+
|
105
|
+
a2x -f epub -d book --epubcheck --stylesheet epubtest.css --resource .ttf=application/x-font-ttf --resource LiberationSerif-Regular.ttf epubtest.txt
|
106
|
+
|
107
|
+
[NOTE]
|
108
|
+
======
|
109
|
+
- Requires AsciiDoc 8.6.5 or better.
|
110
|
+
- The True Type Font mimetype had to be declared explicitly with the
|
111
|
+
`--resource .ttf=application/x-font-ttf` option because it wasn't
|
112
|
+
registered on my Linux system.
|
113
|
+
- In the above example the font file is in the same directory as the
|
114
|
+
AsciiDoc source file and is installed to the same relative location
|
115
|
+
in the EPUB archive OEBPS directory -- if your font file resides in
|
116
|
+
a different location you'll need to adjust the `--resource` option
|
117
|
+
accordingly (see the 'RESOURCES' section in the `a2x(1)` man page
|
118
|
+
for details).
|
119
|
+
- The URL value of the CSS 'src' property is set to the destination
|
120
|
+
font file relative to the CSS file.
|
121
|
+
- The `--resource` option allows you to inject any file (not just font
|
122
|
+
files) into the EPUB output document.
|
123
|
+
- Using the CSS '@font-face' rule is a complex subject and is outside
|
124
|
+
the scope of this FAQ.
|
125
|
+
- Many EPUB readers do not process embedded fonts.
|
126
|
+
======
|
127
|
+
|
128
|
+
|
129
|
+
== What's the difference between + quoted text and ` quoted monospaced text?
|
130
|
+
`+` (plus) quoted text is implemented as an AsciiDoc 'quotes' whereas
|
131
|
+
+`+ (grave accent or backtick) quoted text is implemented as an
|
132
|
+
AsciiDoc 'inline literal' passthrough macro. The semantics are
|
133
|
+
different:
|
134
|
+
|
135
|
+
1. Inline passthrough macros are processed before any other inline
|
136
|
+
substitutions e.g. all of the following line will be processed as a
|
137
|
+
single inline passthrough and rendered as monospaced text (which is
|
138
|
+
not the intended result):
|
139
|
+
+
|
140
|
+
--
|
141
|
+
`single quoted text' and `monospaced quoted text`
|
142
|
+
|
143
|
+
This line works as expected:
|
144
|
+
|
145
|
+
`single quoted text' and +monospaced quoted text+
|
146
|
+
--
|
147
|
+
|
148
|
+
2. Backtick quoted text is rendered literally i.e. no substitutions
|
149
|
+
are performed on the enclosed text. Here are some examples that
|
150
|
+
would have to be escaped if plus quoting were used (<<X4,see
|
151
|
+
also>>):
|
152
|
+
|
153
|
+
The `++i` and `++j` auto-increments.
|
154
|
+
Paths `~/.vim` and `~/docs`.
|
155
|
+
The `__init__` method.
|
156
|
+
The `{id}` attribute.
|
157
|
+
|
158
|
+
|
159
|
+
== Why is the generated HTML title element text invalid?
|
160
|
+
Probably because your document title contains formatting that has
|
161
|
+
generated HTML title markup. You can resolve this by explicitly
|
162
|
+
defining the 'title' attribute in your document's header.
|
163
|
+
|
164
|
+
|
165
|
+
== AsciiDoc sometimes generates invalid output markup, why?
|
166
|
+
AsciiDoc is backend agnostic, the 'asciidoc' command has no knowledge
|
167
|
+
of the syntax or structure of the backend format that it generates.
|
168
|
+
Output document validation (syntactic and structural) should be
|
169
|
+
performed separately by external validation tools. For example,
|
170
|
+
AsciiDoc's 'a2x' toolchain command automatically performs validation
|
171
|
+
checks using 'xmllint'.
|
172
|
+
|
173
|
+
|
174
|
+
== The AsciiDoc toclevels attribute does not work with DocBook outputs, why?
|
175
|
+
DocBook has no provision for specifying table of contents levels but
|
176
|
+
you can set the TOC level further down the toolchain by passing the
|
177
|
+
DocBook XSL Stylesheets
|
178
|
+
http://docbook.sourceforge.net/release/xsl/current/doc/html/toc.section.depth.html[toc.section.depth]
|
179
|
+
parameter to 'dblatex' (using the `--param` option) or 'xsltproc'
|
180
|
+
(using the `--stringparam` option). For example to show only chapter
|
181
|
+
titles in the TOC of a 'book' document set 'toc.section.depth' to '0'.
|
182
|
+
Increment the 'toc.section.depth' value to show more sub-section
|
183
|
+
titles. If you are using 'a2x' you can set the options in the source
|
184
|
+
file, for example:
|
185
|
+
|
186
|
+
// a2x: --xsltproc-opts "--stringparam toc.section.depth 0"
|
187
|
+
// a2x: --dblatex-opts "--param toc.section.depth=0"
|
188
|
+
|
189
|
+
If the document is of type 'article' use the value '1' to show only
|
190
|
+
top level section titles in the TOC, use the value '2' for two levels
|
191
|
+
etc.
|
192
|
+
|
193
|
+
|
194
|
+
== How can I include chapter and section tables of contents?
|
195
|
+
DocBook outputs processed by DocBook XSL Stylesheets (either manually
|
196
|
+
or via 'a2x') can generate additional separate section and chapter
|
197
|
+
tables of contents using combinations of the
|
198
|
+
http://www.sagehill.net/docbookxsl/TOCcontrol.html[TOC parameters].
|
199
|
+
Here are some examples using combinations of the
|
200
|
+
`generate.section.toc.level` and `toc.section.depth` DocBook XSL
|
201
|
+
Stylesheets parameters:
|
202
|
+
|
203
|
+
[cols="2*l,4",width="90%",frame="topbot",options="header"]
|
204
|
+
|======================================================
|
205
|
+
|generate.section.toc.level |toc.section.depth |
|
206
|
+
|1 |
|
207
|
+
|Single level book chapter TOCs or article section TOCs
|
208
|
+
|
209
|
+
|1 | 3
|
210
|
+
|Article section TOCs with two levels
|
211
|
+
|
212
|
+
|1 | 2
|
213
|
+
|Book chapter TOCs with two levels
|
214
|
+
|======================================================
|
215
|
+
|
216
|
+
|
217
|
+
== How can I customize the appearance of XHTML and EPUB documents generated by a2x?
|
218
|
+
You can customize the appearance of an EPUB document with CSS. See
|
219
|
+
the link:publishing-ebooks-with-asciidoc.html[Sherlock Holmes eBook
|
220
|
+
example] on the AsciiDoc website.
|
221
|
+
|
222
|
+
|
223
|
+
== DocBook has many elements for document meta-data -- how can I use them from AsciiDoc?
|
224
|
+
The 'docinfo', 'docinfo1' and 'docinfo2' attributes allow you include
|
225
|
+
link:userguide.html#X97[document information files] containing DocBook
|
226
|
+
XML into the header of the output file.
|
227
|
+
|
228
|
+
|
229
|
+
== Do element titles automatically generate link captions?
|
230
|
+
If you go the DocBook route then yes -- just omit the caption from the
|
231
|
+
AsciiDoc 'xref' (`<<...>>`) macro. Both dblatex and DocBook XSL will
|
232
|
+
use the target element's title text. Examples:
|
233
|
+
|
234
|
+
[listing]
|
235
|
+
..................................................................
|
236
|
+
[[X1]]
|
237
|
+
Section One
|
238
|
+
-----------
|
239
|
+
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas
|
240
|
+
ultrices justo porttitor augue. Vestibulum pretium. Donec porta
|
241
|
+
|
242
|
+
See also <<X3>> (this link displays the text 'A titled paragraph').
|
243
|
+
|
244
|
+
[id="X2",reftext="2nd section"]
|
245
|
+
Section Two
|
246
|
+
-----------
|
247
|
+
See also <<X1>> (this link displays the text 'Section One').
|
248
|
+
|
249
|
+
[[X3]]
|
250
|
+
.A titled paragraph
|
251
|
+
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
|
252
|
+
|
253
|
+
See also <<X2>> (this link displays the text '2nd section').
|
254
|
+
..................................................................
|
255
|
+
|
256
|
+
The AsciiDoc 'reftext' attribute has been used to explicitly set the
|
257
|
+
link text to '2nd section' for 'Section Two'.
|
258
|
+
|
259
|
+
|
260
|
+
== Can I define my own table styles?
|
261
|
+
In addition to the built-in styles you can define your own. This
|
262
|
+
(simplified) example for HTML backends defines a table style called
|
263
|
+
'red' which sets the background cell color to red. First put the
|
264
|
+
definition in a configuration file:
|
265
|
+
|
266
|
+
[listing]
|
267
|
+
.........................................
|
268
|
+
[tabledef-default]
|
269
|
+
red-style=tags="red"
|
270
|
+
|
271
|
+
[tabletags-red]
|
272
|
+
bodydata=<td style="background-color:red;">|</td>
|
273
|
+
.........................................
|
274
|
+
|
275
|
+
Now you can use the style name to style cells or columns (in this
|
276
|
+
example we use an unambiguous shortened abbreviation 'r'):
|
277
|
+
|
278
|
+
[listing]
|
279
|
+
.........................................
|
280
|
+
|==================================
|
281
|
+
|Normal cell r|Red cell
|
282
|
+
|==================================
|
283
|
+
.........................................
|
284
|
+
|
285
|
+
|
286
|
+
== How can I add highlighted editorial comments to an AsciiDoc document?
|
287
|
+
Both block and inline link:userguide.html#X25[comment lines] are
|
288
|
+
displayed on the output if the 'showcomments' attribute is defined.
|
289
|
+
Example:
|
290
|
+
|
291
|
+
[listing]
|
292
|
+
.........................................
|
293
|
+
:showcomments:
|
294
|
+
// A block comment line.
|
295
|
+
|
296
|
+
Qui in magna commodo, est labitur dolorum an. Est ne magna primis
|
297
|
+
// An inline comment line.
|
298
|
+
adolescens.
|
299
|
+
.........................................
|
300
|
+
|
301
|
+
Is rendered as:
|
302
|
+
|
303
|
+
:showcomments:
|
304
|
+
// A block comment line.
|
305
|
+
|
306
|
+
Qui in magna commodo, est labitur dolorum an. Est ne magna primis
|
307
|
+
// An inline comment line.
|
308
|
+
adolescens.
|
309
|
+
|
310
|
+
NOTE: link:userguide.html#X26[Comment blocks] are never displayed.
|
311
|
+
|
312
|
+
|
313
|
+
== What is the preferred file name extension for AsciiDoc files?
|
314
|
+
The `.txt` http://en.wikipedia.org/wiki/Text_file[text file] extension
|
315
|
+
is preferred, but it's just a convention and it's not enforced by the
|
316
|
+
software.
|
317
|
+
|
318
|
+
AsciiDoc source files are human readable
|
319
|
+
http://en.wikipedia.org/wiki/Plain_text[plain text] files which is
|
320
|
+
what the `.txt` extension is for. All text editors recognize and open
|
321
|
+
files with a `.txt` extension. The `.txt` extension is universally
|
322
|
+
recognized and unambiguous -- you are not left asking questions like
|
323
|
+
``What on earth is this file with the funny extension?'', ``How do I
|
324
|
+
open it?'' and ``Is it safe to open?''.
|
325
|
+
|
326
|
+
|
327
|
+
== How can I generate numbered bibliographic entries?
|
328
|
+
If your outputs are DocBook generated then adding the following inline
|
329
|
+
macro to a custom configuration file will result in auto-incrementing
|
330
|
+
bibliography entry numbers (instead of displaying the bibliographic
|
331
|
+
identifiers):
|
332
|
+
|
333
|
+
[anchor3-inlinemacro]
|
334
|
+
<anchor id="{1}" xreflabel="[{counter:bibliography1}]"/>[{counter:bibliography2}]
|
335
|
+
|
336
|
+
This FAQ submitted by Bela Hausmann.
|
337
|
+
|
338
|
+
|
339
|
+
== How can I include lines of dashes inside a listing block?
|
340
|
+
A line of four or more dashes will be mistaken for the ListingBlock
|
341
|
+
terminator, one way round this problem is to use a LiteralBlock styled
|
342
|
+
as a listing block. For example:
|
343
|
+
|
344
|
+
[listing]
|
345
|
+
...........................
|
346
|
+
Lorum ipsum
|
347
|
+
-----------
|
348
|
+
...........................
|
349
|
+
|
350
|
+
|
351
|
+
== How can I customize PDF files generated by dblatex?
|
352
|
+
|
353
|
+
There are a number of dblatex XSL parameters that can be used to
|
354
|
+
customize PDF output. You can set them globally in the AsciiDoc
|
355
|
+
`./dblatex/asciidoc-dblatex.xsl` configuration file or you can also
|
356
|
+
pass them on the a2x(1) command-line. Here are some examples:
|
357
|
+
|
358
|
+
The
|
359
|
+
http://dblatex.sourceforge.net/doc/manual/latex.output.revhistory.html[latex.output.revhistory]
|
360
|
+
parameter is used to suppress the revision history:
|
361
|
+
|
362
|
+
a2x -f pdf --dblatex-opts "-P latex.output.revhistory=0" doc/article.txt
|
363
|
+
|
364
|
+
The
|
365
|
+
http://dblatex.sourceforge.net/doc/manual/doc.layout.html[doc.layout]
|
366
|
+
parameter is used to include the cover page and document body (i.e. excludes
|
367
|
+
table of contents and index), the
|
368
|
+
http://dblatex.sourceforge.net/doc/manual/doc.publisher.show.html[doc.publisher.show]
|
369
|
+
parameter is used to exclude the cover page logo:
|
370
|
+
|
371
|
+
a2x -f pdf --dblatex-opts " -P doc.layout=\"coverpage mainmatter\" -P doc.publisher.show=0" doc/article.txt
|
372
|
+
|
373
|
+
See also the
|
374
|
+
http://dblatex.sourceforge.net/doc/manual/sec-params.html[dblatex XSL
|
375
|
+
parameter reference].
|
376
|
+
|
377
|
+
|
378
|
+
== How can I add lists of figures and tables to PDFs created by dblatex?
|
379
|
+
Set the
|
380
|
+
http://dblatex.sourceforge.net/doc/sec-custom.html[doc.lot.show XSL
|
381
|
+
parameter] -- you can set it using the dblatex `--param` command-line
|
382
|
+
option, for example:
|
383
|
+
|
384
|
+
a2x --dblatex-opts="--param=doc.lot.show=figure,table" doc/article.txt
|
385
|
+
|
386
|
+
|
387
|
+
== How can I stop the document title being displayed?
|
388
|
+
You could simply omit the document title, but this will result in a
|
389
|
+
blank 'title' element in HTML outputs. If you want the HTML 'title'
|
390
|
+
element to contain the document title then define the 'notitle'
|
391
|
+
attribute (this will just suppress displaying the title), for example:
|
392
|
+
|
393
|
+
My document title
|
394
|
+
=================
|
395
|
+
:no title:
|
396
|
+
|
397
|
+
|
398
|
+
== Why am I having trouble getting nested macros to work?
|
399
|
+
The following example expands the 'image' inline macro, but the
|
400
|
+
expansion contains double-quote characters which confuses the ensuing
|
401
|
+
'footnoteref' macro expansion:
|
402
|
+
|
403
|
+
footnoteref:["F1","A footnote, with an image image:smallnew.png[]"]
|
404
|
+
|
405
|
+
The solution is to use unquoted attribute values, replacing embedded
|
406
|
+
commas with the comma character entity (`,`):
|
407
|
+
|
408
|
+
footnoteref:[F1,A footnote, with an image image:smallnew.png[]]
|
409
|
+
|
410
|
+
Similarly, you can embed double-quote characters in unquoted attribute
|
411
|
+
values using the `"` character entity.
|
412
|
+
|
413
|
+
|
414
|
+
== Why am I getting DocBook validation errors?
|
415
|
+
Not all valid AsciiDoc source generates valid DocBook, for example
|
416
|
+
'special sections' (abstract, preface, colophon, dedication,
|
417
|
+
bibliography, glossary, appendix, index, synopsis) have different
|
418
|
+
DocBook schema's to normal document sections. For example, a paragraph
|
419
|
+
is illegal in a bibliography.
|
420
|
+
|
421
|
+
Don't forget if your document is a book you need to specify the
|
422
|
+
asciidoc `-d book` command option, if you don't an article DocBook
|
423
|
+
document will be generated, possibly containing book specific
|
424
|
+
sections, resulting in validation errors.
|
425
|
+
|
426
|
+
|
427
|
+
== How can I disable special section titles?
|
428
|
+
For example, you want to use 'References' as a normal section name but
|
429
|
+
AsciiDoc is auto-magically generating a DocBook 'bibliography'
|
430
|
+
section. All you need to do is explicitly specify the section template
|
431
|
+
name, for example:
|
432
|
+
|
433
|
+
[sect1]
|
434
|
+
References
|
435
|
+
----------
|
436
|
+
|
437
|
+
|
438
|
+
== How can I insert XML processing instructions into output documents?
|
439
|
+
Use an inline or block passthrough macros. This example inserts
|
440
|
+
`<?dblatex bgcolor="#cceeff"?>` into the DocBook output generated by
|
441
|
+
AsciiDoc:
|
442
|
+
|
443
|
+
pass::[<?dblatex bgcolor="#cceeff"?>]
|
444
|
+
|
445
|
+
NOTE: XML processing instructions are specific to the application that
|
446
|
+
processes the XML (the previous `dblatex` processing instruction is
|
447
|
+
recognized by `dblatex(1)` when it processes the DocBook XML generated
|
448
|
+
by Asciidoc).
|
449
|
+
|
450
|
+
|
451
|
+
[[X4]]
|
452
|
+
== How do I prevent double-quoted text being mistaken for an inline literal?
|
453
|
+
Mixing doubled-quoted text with inline literal passthroughs can
|
454
|
+
produce undesired results, for example, all of the following line is
|
455
|
+
interpreted as an inline literal passthrough:
|
456
|
+
|
457
|
+
``XXX'' `YYY`
|
458
|
+
|
459
|
+
In this case the solution is to use monospace quoting instead of the
|
460
|
+
inline literal:
|
461
|
+
|
462
|
+
``XXX'' +YYY+
|
463
|
+
|
464
|
+
Use the +\pass:[]+ macro if it's necessary to suppress
|
465
|
+
substitutions in the monospaced text, for example:
|
466
|
+
|
467
|
+
``XXX'' +pass:[don't `quote` me]+
|
468
|
+
|
469
|
+
|
470
|
+
== How can I generate a single HTML document file containing images and CSS styles?
|
471
|
+
With the advent of Internet Explorer 8 all major web browsers now
|
472
|
+
support the
|
473
|
+
http://en.wikipedia.org/wiki/Data:_URI_scheme[data URI scheme] for
|
474
|
+
embedded images. The AsciiDoc 'xhtml11' and 'html5' backends supports
|
475
|
+
the data URI scheme for embedded images and by default it embeds the
|
476
|
+
CSS stylesheet. For example the following command will generate a
|
477
|
+
single `article.html` file containing embedded images, admonition
|
478
|
+
icons and the CSS stylesheet:
|
479
|
+
|
480
|
+
asciidoc -a data-uri -a icons article.txt
|
481
|
+
|
482
|
+
|
483
|
+
== Are there any tools to help me understand what's going on inside AsciiDoc?
|
484
|
+
|
485
|
+
AsciiDoc has a built-in trace mechanism which is controlled by the
|
486
|
+
'trace' attribute; there is also the `--verbose` command-line option.
|
487
|
+
These features are detailed in
|
488
|
+
http://www.methods.co.nz/asciidoc/userguide.html#X82[Appendix G of the
|
489
|
+
User Guide].
|
490
|
+
|
491
|
+
|
492
|
+
== One-liner ifdef::[]'s are disproportionately verbose can they shortened?
|
493
|
+
|
494
|
+
This is the response to a question posted on the AsciiDoc discussion
|
495
|
+
list, it illustrates a number of useful techniques. The question arose
|
496
|
+
because the source highlight filter language identifier for the C++
|
497
|
+
language is `c++` when generating PDFs via dblatex (LaTeX listings
|
498
|
+
package) or `cpp` when generating HTML (GNU source-highlight).
|
499
|
+
|
500
|
+
Using straight `ifdef::[]` block macros we have:
|
501
|
+
|
502
|
+
[listing]
|
503
|
+
.........................................
|
504
|
+
\ifdef::basebackend-docbook[]
|
505
|
+
[source,c++]
|
506
|
+
\endif::basebackend-docbook[]
|
507
|
+
\ifdef::basebackend-html[]
|
508
|
+
[source,cpp]
|
509
|
+
\endif::basebackend-html[]
|
510
|
+
-----------------------------------------
|
511
|
+
class FooParser {
|
512
|
+
public:
|
513
|
+
virtual void startDocument() = 0;
|
514
|
+
virtual void endDocument() = 0;
|
515
|
+
};
|
516
|
+
-----------------------------------------
|
517
|
+
.........................................
|
518
|
+
|
519
|
+
|
520
|
+
This can be shortened using the short form of the `ifdef::[]` macro:
|
521
|
+
|
522
|
+
[listing]
|
523
|
+
.........................................
|
524
|
+
\ifdef::basebackend-docbook[[source,c++]]
|
525
|
+
\ifdef::basebackend-html[[source,cpp]]
|
526
|
+
-----------------------------------------
|
527
|
+
class FooParser {
|
528
|
+
public:
|
529
|
+
virtual void startDocument() = 0;
|
530
|
+
virtual void endDocument() = 0;
|
531
|
+
};
|
532
|
+
-----------------------------------------
|
533
|
+
.........................................
|
534
|
+
|
535
|
+
|
536
|
+
Using a conditional attribute instead of the `ifdef::[]` macro is even
|
537
|
+
shorter:
|
538
|
+
|
539
|
+
[listing]
|
540
|
+
.........................................
|
541
|
+
[source,{basebackend@docbook:c++:cpp}]
|
542
|
+
-----------------------------------------
|
543
|
+
class FooParser {
|
544
|
+
public:
|
545
|
+
virtual void startDocument() = 0;
|
546
|
+
virtual void endDocument() = 0;
|
547
|
+
};
|
548
|
+
-----------------------------------------
|
549
|
+
.........................................
|
550
|
+
|
551
|
+
|
552
|
+
If you have a number of listings it makes sense to factor the
|
553
|
+
conditional attribute to a normal attribute:
|
554
|
+
|
555
|
+
[listing]
|
556
|
+
.........................................
|
557
|
+
:cpp: {basebackend@docbook:c++:cpp}
|
558
|
+
|
559
|
+
[source,{cpp}]
|
560
|
+
-----------------------------------------
|
561
|
+
class FooParser {
|
562
|
+
public:
|
563
|
+
virtual void startDocument() = 0;
|
564
|
+
virtual void endDocument() = 0;
|
565
|
+
};
|
566
|
+
-----------------------------------------
|
567
|
+
.........................................
|
568
|
+
|
569
|
+
|
570
|
+
Even shorter, set the default source highlight filter `language`
|
571
|
+
attribute so you don't have to specify it every time:
|
572
|
+
|
573
|
+
[listing]
|
574
|
+
.........................................
|
575
|
+
:language: {basebackend@docbook:c++:cpp}
|
576
|
+
|
577
|
+
[source]
|
578
|
+
-----------------------------------------
|
579
|
+
class FooParser {
|
580
|
+
public:
|
581
|
+
virtual void startDocument() = 0;
|
582
|
+
virtual void endDocument() = 0;
|
583
|
+
};
|
584
|
+
-----------------------------------------
|
585
|
+
.........................................
|
586
|
+
|
587
|
+
|
588
|
+
== Some of my inline passthroughs are not passed through, why?
|
589
|
+
|
590
|
+
Most likely the passthrough encloses another passthrough with a higher
|
591
|
+
precedence. For example trying to render this +\pass:[]+ with this
|
592
|
+
+\`\pass:[]`+ results in a blank string because the +\pass:[]+
|
593
|
+
passthrough evaluates first, instead use monospaced quoting and escape
|
594
|
+
the passthrough i.e. ++ \+\\pass:[]+ ++
|
595
|
+
|
596
|
+
|
597
|
+
== How can I place an anchor (link target) on a list item?
|
598
|
+
|
599
|
+
You can't use a 'BlockId' block element inside a list but you can use
|
600
|
+
the syntactically identical 'anchor' inline macro. For example:
|
601
|
+
|
602
|
+
---------------------
|
603
|
+
one:: Item one.
|
604
|
+
[[X2]]two:: Item two.
|
605
|
+
three:: Item three.
|
606
|
+
---------------------
|
607
|
+
|
608
|
+
This *will not* work:
|
609
|
+
|
610
|
+
---------------------
|
611
|
+
one:: Item one.
|
612
|
+
[[X2]]
|
613
|
+
two:: Item two.
|
614
|
+
three:: Item three.
|
615
|
+
---------------------
|
616
|
+
|
617
|
+
|
618
|
+
== How can I stop lists from nesting?
|
619
|
+
|
620
|
+
If you place two lists with different syntax hard up against each
|
621
|
+
other then the second list will be nested in the first. If you don't
|
622
|
+
want the second list to be nested separate them with a comment line
|
623
|
+
block macro. For example:
|
624
|
+
|
625
|
+
-------------------
|
626
|
+
1. List 1.
|
627
|
+
2. List 1.
|
628
|
+
|
629
|
+
//
|
630
|
+
a. List 2.
|
631
|
+
b. List 2.
|
632
|
+
-------------------
|
633
|
+
|
634
|
+
|
635
|
+
== Is it possible to include charts in AsciiDoc documents?
|
636
|
+
|
637
|
+
There are a number of programs available that generate presentation
|
638
|
+
charts from textual specification, for example
|
639
|
+
http://home.gna.org/pychart/[Pychart] is a library for writing chart
|
640
|
+
scripts in Python. Here's an example from the 'Pychart' documentation:
|
641
|
+
|
642
|
+
.barchart.py
|
643
|
+
---------------------------------------------------------------------
|
644
|
+
#
|
645
|
+
# Example bar chart (from Pychart documentation http://home.gna.org/pychart/).
|
646
|
+
#
|
647
|
+
from pychart import *
|
648
|
+
theme.get_options()
|
649
|
+
|
650
|
+
data = [(10, 20, 30, 5), (20, 65, 33, 5), (30, 55, 30, 5), (40, 45, 51, 7),
|
651
|
+
(50, 25, 27, 3), (60, 75, 30, 5), (70, 80, 42, 5), (80, 62, 32, 5),
|
652
|
+
(90, 42, 39, 5), (100, 32, 39, 4)]
|
653
|
+
|
654
|
+
# The attribute y_coord=... tells that the Y axis values
|
655
|
+
# should be taken from samples.
|
656
|
+
# In this example, Y values will be [40,50,60,70,80].
|
657
|
+
ar = area.T(y_coord = category_coord.T(data[3:8], 0),
|
658
|
+
x_grid_style=line_style.gray50_dash1,
|
659
|
+
x_grid_interval=20, x_range = (0,100),
|
660
|
+
x_axis=axis.X(label="X label"),
|
661
|
+
y_axis=axis.Y(label="Y label"),
|
662
|
+
bg_style = fill_style.gray90,
|
663
|
+
border_line_style = line_style.default,
|
664
|
+
legend = legend.T(loc=(80,10)))
|
665
|
+
|
666
|
+
# Below call sets the default attributes for all bar plots.
|
667
|
+
chart_object.set_defaults(bar_plot.T, direction="horizontal", data=data)
|
668
|
+
|
669
|
+
# Attribute cluster=(0,3) tells that you are going to draw three bar
|
670
|
+
# plots side by side. The plot labeled "foo" will the leftmost (i.e.,
|
671
|
+
# 0th out of 3). Attribute hcol tells the column from which to
|
672
|
+
# retrive sample values from. It defaults to one.
|
673
|
+
ar.add_plot(bar_plot.T(label="foo", cluster=(0,3)))
|
674
|
+
ar.add_plot(bar_plot.T(label="bar", hcol=2, cluster=(1,3)))
|
675
|
+
ar.add_plot(bar_plot.T(label="baz", hcol=3, cluster=(2,3)))
|
676
|
+
ar.draw()
|
677
|
+
---------------------------------------------------------------------
|
678
|
+
|
679
|
+
To execute the script and include the generated chart image in your
|
680
|
+
document add the following lines to the AsciiDoc source:
|
681
|
+
|
682
|
+
---------------------------------------------------------------------
|
683
|
+
// Generate chart image file.
|
684
|
+
\sys2::[python "{indir}/barchart.py" --format=png --output="{outdir}/barchart.png" --scale=2]
|
685
|
+
|
686
|
+
// Display chart image file.
|
687
|
+
image::barchart.png[]
|
688
|
+
---------------------------------------------------------------------
|
689
|
+
|
690
|
+
[NOTE]
|
691
|
+
=====================================================================
|
692
|
+
- The `barchart.py` script is located in the same directory as the
|
693
|
+
AsciiDoc source file (`{indir}`).
|
694
|
+
- The generated chart image file (`barchart.png`) is written to the
|
695
|
+
same directory as the output file (`{outdir}`).
|
696
|
+
=====================================================================
|
697
|
+
|
698
|
+
|
699
|
+
== How can I render indented paragraphs?
|
700
|
+
|
701
|
+
Styling is backend dependent:
|
702
|
+
|
703
|
+
[float]
|
704
|
+
==== Create an indented paragraph style (xhtml11 and html5 backends)
|
705
|
+
. Define an 'indented' paragraph style, for example, by putting this
|
706
|
+
in a custom configuration file:
|
707
|
+
+
|
708
|
+
---------------------------------------------------------------------
|
709
|
+
[paradef-default]
|
710
|
+
indented-style=template="indentedparagraph"
|
711
|
+
|
712
|
+
[indentedparagraph]
|
713
|
+
<div class="paragraph"{id? id="{id}"} style="text-indent:3em;">{title?<div class="title">{title}</div>}<p>
|
714
|
+
|
|
715
|
+
</p></div>
|
716
|
+
---------------------------------------------------------------------
|
717
|
+
|
718
|
+
. Now apply the 'indented' style to normal paragraphs, for example:
|
719
|
+
+
|
720
|
+
---------------------------------------------------------------------
|
721
|
+
[indented]
|
722
|
+
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas
|
723
|
+
ultrices justo porttitor augue. Vestibulum pretium. Donec porta
|
724
|
+
vestibulum mi. Aliquam pede. Aenean lobortis lorem et lacus. Sed
|
725
|
+
lacinia. Vivamus at lectus.
|
726
|
+
---------------------------------------------------------------------
|
727
|
+
|
728
|
+
[float]
|
729
|
+
==== Use the role attribute (xhtml11 and html5 backends)
|
730
|
+
. Add the following line to custom stylesheet:
|
731
|
+
+
|
732
|
+
---------------------------------------------------------------------
|
733
|
+
div.paragraph.indented p {text-indent: 3em;}
|
734
|
+
---------------------------------------------------------------------
|
735
|
+
|
736
|
+
. Apply the 'role' attribute to indented paragraphs, for example:
|
737
|
+
+
|
738
|
+
---------------------------------------------------------------------
|
739
|
+
[role="indented"]
|
740
|
+
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas
|
741
|
+
ultrices justo porttitor augue. Vestibulum pretium. Donec porta
|
742
|
+
vestibulum mi. Aliquam pede. Aenean lobortis lorem et lacus. Sed
|
743
|
+
lacinia. Vivamus at lectus.
|
744
|
+
---------------------------------------------------------------------
|
745
|
+
|
746
|
+
. Include the custom stylesheet by setting the 'stylesheet' attribute
|
747
|
+
(either from the command-line or with an attribute entry in the
|
748
|
+
document header).
|
749
|
+
|
750
|
+
[float]
|
751
|
+
==== Use the role attribute (docbook backend)
|
752
|
+
. Add the following line to the distributed `docbook-xsl.css`
|
753
|
+
stylesheet or include it in a custom stylesheet:
|
754
|
+
+
|
755
|
+
---------------------------------------------------------------------
|
756
|
+
p.indented {text-indent: 3em;}
|
757
|
+
---------------------------------------------------------------------
|
758
|
+
|
759
|
+
. Apply the 'role' attribute to indented paragraphs, for example:
|
760
|
+
+
|
761
|
+
---------------------------------------------------------------------
|
762
|
+
[role="indented"]
|
763
|
+
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas
|
764
|
+
ultrices justo porttitor augue. Vestibulum pretium. Donec porta
|
765
|
+
vestibulum mi. Aliquam pede. Aenean lobortis lorem et lacus. Sed
|
766
|
+
lacinia. Vivamus at lectus.
|
767
|
+
---------------------------------------------------------------------
|
768
|
+
|
769
|
+
. If you have included the custom CSS in a separate stylesheet you
|
770
|
+
will need to specify the stylesheet file name (along with the
|
771
|
+
default `docbook-xsl.css` stylesheet file name) with the
|
772
|
+
`html.stylesheet` XSL parameter. If you are using 'a2x(1)' use the
|
773
|
+
`--stylesheet` option (it sets the `html.stylesheet` XSL parameter),
|
774
|
+
for example: `--stylesheet "docbook-xsl.css mycss.css"`.
|
775
|
+
|
776
|
+
NOTE: This applies to HTML outputs not PDF. To achieve the same
|
777
|
+
results with PDF outputs you will need to customize the DocBook XSL
|
778
|
+
Stylesheets to render indented paragraphs from DocBook `simpara`
|
779
|
+
elements containing the the `role="indented"` attribute.
|
780
|
+
|
781
|
+
|
782
|
+
== Is there a way to set default table grid and frame attributes?
|
783
|
+
|
784
|
+
You can set the 'grid' and 'frame' attributes globally in your
|
785
|
+
document header with Attribute Entries or from the command-line using
|
786
|
+
the `--attribute` option. In the following example tables that don't
|
787
|
+
explicitly set the 'grid' and 'frame' values will default to 'all' and
|
788
|
+
'topbot' respectively:
|
789
|
+
|
790
|
+
---------------------------------------------------------------------
|
791
|
+
:grid: all
|
792
|
+
:frame: topbot
|
793
|
+
---------------------------------------------------------------------
|
794
|
+
|
795
|
+
TIP: This technique can be applied to any block element attribute
|
796
|
+
(just beware of possible ambiguity, for example, table and image
|
797
|
+
blocks both have a 'width' attribute).
|
798
|
+
|
799
|
+
|
800
|
+
== How can I place a backslash character in front of an attribute reference without escaping the reference?
|
801
|
+
|
802
|
+
Use the predefined `{backslash}` attribute reference instead of an
|
803
|
+
actual backslash, for example if the `{projectname}` attribute has
|
804
|
+
the value `foobar` then:
|
805
|
+
|
806
|
+
d:\data{backslash}{projectname}
|
807
|
+
|
808
|
+
would be rendered as:
|
809
|
+
|
810
|
+
d:\data\foobar
|
811
|
+
|
812
|
+
== How can I escape AsciiDoc markup?
|
813
|
+
|
814
|
+
Most AsciiDoc inline elements can be suppressed by preceding them with
|
815
|
+
a backslash character. These elements include:
|
816
|
+
|
817
|
+
- Attribute references.
|
818
|
+
- Text formatting.
|
819
|
+
- Quoting,
|
820
|
+
- Macros.
|
821
|
+
- Replacements.
|
822
|
+
- Special words.
|
823
|
+
- Table cell separators.
|
824
|
+
|
825
|
+
But there are exceptions -- see the next question.
|
826
|
+
|
827
|
+
|
828
|
+
== Some elements can't be escaped with a single backslash
|
829
|
+
|
830
|
+
There are a number of exceptions to the usual single backslash rule
|
831
|
+
-- mostly relating to URL macros that have two syntaxes or quoting
|
832
|
+
ambiguity. Here are some non-standard escape examples:
|
833
|
+
|
834
|
+
[cols="l,v",width="40%",frame="topbot",options="header"]
|
835
|
+
|========================================
|
836
|
+
|AsciiDoc | Renders
|
837
|
+
|
838
|
+
2*|
|
839
|
+
\srackham@methods.co.nz
|
840
|
+
<\srackham@methods.co.nz>
|
841
|
+
\mailto:[\srackham@methods.co.nz]
|
842
|
+
|
843
|
+
2*|
|
844
|
+
\http://www.foo1.co.nz
|
845
|
+
\\http://www.foobar.com[]
|
846
|
+
\\http://www.foobar.com[Foobar Limited]
|
847
|
+
|
848
|
+
2*|
|
849
|
+
A C\++ Library for C++
|
850
|
+
\\``double-quotes''
|
851
|
+
\*\*F**ile Open\...
|
852
|
+
|========================================
|
853
|
+
|
854
|
+
The source of this problem is ambiguity across substitution types --
|
855
|
+
the first match unescapes allowing the second to substitute. A
|
856
|
+
work-around for difficult cases is to side-step the problem using the
|
857
|
+
+\pass:[]+ passthrough inline macro.
|
858
|
+
|
859
|
+
NOTE: Escaping is unnecessary inside 'inline literal passthroughs'
|
860
|
+
(backtick quoted text).
|
861
|
+
|
862
|
+
|
863
|
+
== How can I escape a list?
|
864
|
+
Here's how to handle situations where the first line of a paragraph is
|
865
|
+
mistaken for a list item.
|
866
|
+
|
867
|
+
[float]
|
868
|
+
==== Numbered and bulleted lists
|
869
|
+
Precede the bullet or index of the first list item with an `{empty}`
|
870
|
+
attribute, for example:
|
871
|
+
|
872
|
+
{empty}- Qui in magna commodo est labitur dolorum an. Est ne magna
|
873
|
+
primis adolescens.
|
874
|
+
|
875
|
+
The predefined `{empty}` attribute is replaced by an empty string and
|
876
|
+
ensures the first line is not mistaken for a bulleted list item.
|
877
|
+
|
878
|
+
[float]
|
879
|
+
==== Labeled lists
|
880
|
+
Two colons or semicolons in a paragraph may be confused with a labeled
|
881
|
+
list entry. Use the predefined `{two-colons}` and `{two-semicolons}`
|
882
|
+
attributes to suppress this behavior, for example:
|
883
|
+
|
884
|
+
Qui in magna commodo{two-colons} est labitur dolorum an. Est ne
|
885
|
+
magna primis adolescens.
|
886
|
+
|
887
|
+
Will be rendered as:
|
888
|
+
|
889
|
+
Qui in magna commodo{two-colons} est labitur dolorum an. Est ne
|
890
|
+
magna primis adolescens.
|
891
|
+
|
892
|
+
|
893
|
+
== How can I set default list and tables styles?
|
894
|
+
|
895
|
+
You can set the element's 'style' entry in a global or custom
|
896
|
+
configuration file.
|
897
|
+
|
898
|
+
This example this will horizontally style all labeled lists that don't
|
899
|
+
have an explicit style attribute:
|
900
|
+
|
901
|
+
----------------------------------
|
902
|
+
[listdef-labeled]
|
903
|
+
style=horizontal
|
904
|
+
|
905
|
+
[listdef-labeled2]
|
906
|
+
style=horizontal
|
907
|
+
----------------------------------
|
908
|
+
|
909
|
+
This example will put a top and bottom border on all tables that don't
|
910
|
+
already have an explicit style attribute:
|
911
|
+
|
912
|
+
----------------------------------
|
913
|
+
[tabledef-default]
|
914
|
+
style=topbot
|
915
|
+
topbot-style=frame="topbot"
|
916
|
+
----------------------------------
|
917
|
+
|
918
|
+
Alternatively you can set the configuration entries from inside your
|
919
|
+
document, the above examples are equivalent to:
|
920
|
+
|
921
|
+
----------------------------------
|
922
|
+
:listdef-labeled.style: horizontal
|
923
|
+
:listdef-labeled2.style: horizontal
|
924
|
+
|
925
|
+
:tabledef-default.topbot-style: frame="topbot"
|
926
|
+
:tabledef-default.style: topbot
|
927
|
+
----------------------------------
|
928
|
+
|
929
|
+
|
930
|
+
== Why do I get a filter non-zero exit code error?
|
931
|
+
|
932
|
+
An error was returned when AsciiDoc tried to execute an external
|
933
|
+
filter command. The most common reason for this is that the filter
|
934
|
+
command could not be found by the command shell. To figure out what
|
935
|
+
the problem is run AsciiDoc with the `--verbose` option to determine
|
936
|
+
the command that is failing and then try to run the command manually
|
937
|
+
from the command-line.
|
938
|
+
|
939
|
+
|
940
|
+
== Are there any DocBook viewers?
|
941
|
+
|
942
|
+
http://live.gnome.org/Yelp[Yelp], the GNOME help viewer, does a
|
943
|
+
creditable job of displaying DocBook XML files directly.
|
944
|
+
|
945
|
+
|
946
|
+
== Can you create ODF and PDF files using LibreOffice?
|
947
|
+
|
948
|
+
https://www.libreoffice.org/[LibreOffice] can convert HTML produced by
|
949
|
+
AsciiDoc to ODF text format and PDF format (I used LibreOffice 3.5 at
|
950
|
+
the time of writing, the fidelity is very good but it's not perfect):
|
951
|
+
|
952
|
+
. Create the HTML file using AsciiDoc, for example:
|
953
|
+
|
954
|
+
asciidoc -a icons -a numbered -a disable-javascript article.txt
|
955
|
+
+
|
956
|
+
JavaScript is disabled because LibreOffice does not execute
|
957
|
+
JavaScript, this means that AsciiDoc table of contents and footnotes
|
958
|
+
will not be rendered into ODF (if you want the table of contents and
|
959
|
+
footnotes you could manually cut and paste them from a Web browser).
|
960
|
+
|
961
|
+
. Convert the HTML file to an ODF text file using LibreOffice:
|
962
|
+
|
963
|
+
lowriter --invisible --convert-to odt article.html
|
964
|
+
+
|
965
|
+
--
|
966
|
+
The images imported from an HTML file will be linked, if your document
|
967
|
+
contains images you should convert them to embedded images:
|
968
|
+
|
969
|
+
[lowerroman]
|
970
|
+
. Open the document in LibreOffice Writer.
|
971
|
+
. Run the 'Edit->Links...' menu command.
|
972
|
+
. Select all links and press the 'Break Link' button.
|
973
|
+
|
974
|
+
Some images may also have been resized. To restore an image to its
|
975
|
+
original size:
|
976
|
+
|
977
|
+
[lowerroman]
|
978
|
+
. Right-click on the image and select the 'Picture...' menu item.
|
979
|
+
. Click on the 'Crop' tab.
|
980
|
+
. Press the 'Original Size' button.
|
981
|
+
|
982
|
+
--
|
983
|
+
|
984
|
+
. Convert the ODF file to an PDF text file using LibreOffice:
|
985
|
+
|
986
|
+
lowriter --invisible --convert-to pdf article.odt
|
987
|
+
+
|
988
|
+
A PDF index is automatically created using the section headings.
|
989
|
+
|
990
|
+
Alternatively you could manually copy-and-paste the entire document
|
991
|
+
from a Web browser into a blank ODF document in LibreOffice -- this
|
992
|
+
technique will bring through the table of contents and footnotes.
|
993
|
+
|
994
|
+
This tip was originally contributed by Bernard Amade.
|
995
|
+
|
996
|
+
|
997
|
+
== How can I suppress cell separators in included table data files?
|
998
|
+
|
999
|
+
Use the `{include:}` system attribute instead of the `include::[]`
|
1000
|
+
macro (the former is not expanded until after the table data has been
|
1001
|
+
parsed into cells, whereas the latter is included before the table is
|
1002
|
+
processed.
|
1003
|
+
|
1004
|
+
|
1005
|
+
== How can I preserve paragraph line boundaries?
|
1006
|
+
|
1007
|
+
Apply the The 'verse' paragraph style, the rendered text preserves
|
1008
|
+
line boundaries and is useful for lyrics and poems. For example:
|
1009
|
+
|
1010
|
+
---------------------------------------------------------------------
|
1011
|
+
[verse]
|
1012
|
+
Consul *necessitatibus* per id,
|
1013
|
+
consetetur, eu pro everti postulant
|
1014
|
+
homero verear ea mea, qui.
|
1015
|
+
---------------------------------------------------------------------
|
1016
|
+
|
1017
|
+
Alternatively, if you are generating PDF files, you can use line
|
1018
|
+
breaks. For example:
|
1019
|
+
|
1020
|
+
---------------------------------------------------------------------
|
1021
|
+
Consul *necessitatibus* per id, +
|
1022
|
+
consetetur, eu pro everti postulant +
|
1023
|
+
homero verear ea mea, qui.
|
1024
|
+
---------------------------------------------------------------------
|
1025
|
+
|
1026
|
+
|
1027
|
+
== How can I include non-breaking space characters?
|
1028
|
+
|
1029
|
+
Use the non-breaking space character entity reference ` ` (see
|
1030
|
+
the next question). You could also use the predefined `{nbsp}`
|
1031
|
+
attribute reference.
|
1032
|
+
|
1033
|
+
|
1034
|
+
== Can I include HTML and XML character entity references in my document?
|
1035
|
+
|
1036
|
+
Yes, just enter the reference in your document. For example `β`
|
1037
|
+
will print a Greek small beta character β
|
1038
|
+
|
1039
|
+
|
1040
|
+
[[X1]]
|
1041
|
+
== How do I include spaces in URLs?
|
1042
|
+
|
1043
|
+
URL inline macro targets (addresses) cannot contain white space
|
1044
|
+
characters. If you need spaces encode them as `%20`. For example:
|
1045
|
+
|
1046
|
+
image:large%20image.png[]
|
1047
|
+
http://www.foo.bar.com/an%20example%20document.html
|
1048
|
+
|
1049
|
+
|
1050
|
+
== How can I get AsciiDoc to assign the correct DocBook language attribute?
|
1051
|
+
|
1052
|
+
Set the AsciiDoc 'lang' attribute to the appropriate language code.
|
1053
|
+
For example:
|
1054
|
+
|
1055
|
+
a2x -a lang=es doc/article.txt
|
1056
|
+
|
1057
|
+
This will ensure that downstream DocBook processing will generate the
|
1058
|
+
correct language specific document headings (things like table of
|
1059
|
+
contents, revision history, figure and table captions, admonition
|
1060
|
+
captions).
|
1061
|
+
|
1062
|
+
|
1063
|
+
== How can I turn off table and image title numbering?
|
1064
|
+
For HTML outputs set the 'caption' attribute to an empty string,
|
1065
|
+
either globally:
|
1066
|
+
|
1067
|
+
-------------------------
|
1068
|
+
:caption:
|
1069
|
+
-------------------------
|
1070
|
+
|
1071
|
+
or on an element by element basis, for example:
|
1072
|
+
|
1073
|
+
-------------------------
|
1074
|
+
.Tiger
|
1075
|
+
[caption=""]
|
1076
|
+
image::images/tiger.png[]
|
1077
|
+
-------------------------
|
1078
|
+
|
1079
|
+
|
1080
|
+
== How can I assign multiple author names?
|
1081
|
+
|
1082
|
+
A quick way to do this is put both authors in a single first name, for
|
1083
|
+
example:
|
1084
|
+
|
1085
|
+
---------------------------------------
|
1086
|
+
My Document
|
1087
|
+
===========
|
1088
|
+
:Author: Bill_and_Ben_the_Flowerpot_Men
|
1089
|
+
:Author Initials: BB & BC
|
1090
|
+
---------------------------------------
|
1091
|
+
|
1092
|
+
asciidoc(1) replaces the underscores with spaces.
|
1093
|
+
|
1094
|
+
If you are generating DocBook then a more flexible approach is to
|
1095
|
+
create a 'docinfo' file containing a DocBook 'authorgroup' element
|
1096
|
+
(search the 'User Guide' for 'docinfo' for more details).
|
1097
|
+
|
1098
|
+
|
1099
|
+
== How can I selectively disable a quoted text substitution?
|
1100
|
+
|
1101
|
+
Omitting the tag name will disable quoting. For example, if you don't
|
1102
|
+
want superscripts or subscripts then put the following in a custom
|
1103
|
+
configuration file or edit the global `asciidoc.conf` configuration
|
1104
|
+
file:
|
1105
|
+
|
1106
|
+
-------------------
|
1107
|
+
[quotes]
|
1108
|
+
^=
|
1109
|
+
~=
|
1110
|
+
-------------------
|
1111
|
+
|
1112
|
+
Alternatively you can set the configuration entries from within your
|
1113
|
+
document, the above examples are equivalent to:
|
1114
|
+
|
1115
|
+
-------------------
|
1116
|
+
:quotes.^:
|
1117
|
+
:quotes.~:
|
1118
|
+
-------------------
|
1119
|
+
|
1120
|
+
|
1121
|
+
== How can I customize the \{localdate} format?
|
1122
|
+
|
1123
|
+
The default format for the `{localdate}` attribute is the ISO 8601
|
1124
|
+
`yyyy-mm-dd` format. You can change this format by explicitly setting
|
1125
|
+
the `{localdate}` attribute. For example by setting it using the
|
1126
|
+
asciidoc(1) `-a` command-line option:
|
1127
|
+
|
1128
|
+
asciidoc -a localdate=`date +%d-%m-%Y` mydoc.txt
|
1129
|
+
|
1130
|
+
You could also set it by adding an Attribute Entry to your source
|
1131
|
+
document, for example:
|
1132
|
+
|
1133
|
+
:localdate: {sys: date +%Y-%m-%d}
|
1134
|
+
|
1135
|
+
|
1136
|
+
== Where can I find examples of commands used to build output documents?
|
1137
|
+
|
1138
|
+
The User Guide has some. You could also look at `./doc/main.aap` and
|
1139
|
+
`./examples/website/main.aap` in the AsciiDoc distribution, they have
|
1140
|
+
all the commands used to build the AsciiDoc documentation and the
|
1141
|
+
AsciiDoc website (even if you don't use A-A-P you'll still find it
|
1142
|
+
useful).
|
1143
|
+
|
1144
|
+
|
1145
|
+
== Why have you used the DocBook <simpara> element instead of <para>?
|
1146
|
+
|
1147
|
+
`<simpara>` is really the same as `<para>` except it can't contain
|
1148
|
+
block elements -- this matches, more closely, the AsciiDoc paragraph
|
1149
|
+
semantics.
|
1150
|
+
|
1151
|
+
|
1152
|
+
== How can I format text inside a listing block?
|
1153
|
+
|
1154
|
+
By default only 'specialcharacters' and 'callouts' are substituted in
|
1155
|
+
listing blocks; you can add quotes substitutions by explicitly setting
|
1156
|
+
the block 'subs' attribute, for example:
|
1157
|
+
|
1158
|
+
[listing]
|
1159
|
+
..........................................
|
1160
|
+
[subs="quotes"]
|
1161
|
+
------------------------------------------
|
1162
|
+
$ ls *-al*
|
1163
|
+
------------------------------------------
|
1164
|
+
..........................................
|
1165
|
+
|
1166
|
+
The `-al` will rendered bold. Note that:
|
1167
|
+
|
1168
|
+
- You would need to explicitly escape text you didn't want quoted.
|
1169
|
+
- Don't do this in source code listing blocks because it modifies the
|
1170
|
+
source code which confuses the syntax highlighter.
|
1171
|
+
- This only works if your DocBook processor recognizes DocBook
|
1172
|
+
`<emphasis>` elements inside `<screen>` elements.
|
1173
|
+
|
1174
|
+
Alternative, if the lines are contiguous, you could use the 'literal'
|
1175
|
+
paragraph style:
|
1176
|
+
|
1177
|
+
------------------------------------------
|
1178
|
+
["literal",subs="quotes"]
|
1179
|
+
$ ls *-al*
|
1180
|
+
------------------------------------------
|
1181
|
+
|
1182
|
+
|
1183
|
+
== Why doesn't the include1::[] macro work?
|
1184
|
+
|
1185
|
+
Internally the `include1` macro is translated to the `include1` system
|
1186
|
+
attribute which means it must be evaluated in a region where attribute
|
1187
|
+
substitution is enabled. `include1` won't work, for example, in a
|
1188
|
+
ListingBlock (unless attribute substitution is enabled). `include1`
|
1189
|
+
is intended for use in configuration files, use the `include` macro
|
1190
|
+
and set the attribute `depth=1` instead, for example:
|
1191
|
+
|
1192
|
+
[listing]
|
1193
|
+
................................................
|
1194
|
+
------------------------------------------------
|
1195
|
+
\include::blogpost_media_processing.txt[depth=1]
|
1196
|
+
------------------------------------------------
|
1197
|
+
................................................
|
1198
|
+
|
1199
|
+
|
1200
|
+
== How can I make the mailto macro work with multiple email addresses?
|
1201
|
+
|
1202
|
+
For the AsciiDoc 'mailto' macro to work with multiple email addresses
|
1203
|
+
(as per RFC2368) you need to URL encode the '@' characters (replace
|
1204
|
+
them with '%40'), if you don't the individual addresses will be
|
1205
|
+
rendered as separate links. You also need to <<X1,replace spaces with
|
1206
|
+
'%20'>>.
|
1207
|
+
|
1208
|
+
For example, the following call won't work:
|
1209
|
+
|
1210
|
+
mailto:jb@foobar.com,jd@acme.co.nz?subject=New foofoo release[New foofoo release]
|
1211
|
+
|
1212
|
+
Use this instead:
|
1213
|
+
|
1214
|
+
mailto:jb%40foobar.com,jd%40acme.co.nz?subject=New%20foofoo%20release[New foofoo release]
|
1215
|
+
|
1216
|
+
|
1217
|
+
== How can a replacement have a trailing backslash?
|
1218
|
+
Quote the entry name -- this nonsensical example replaces `x\` with
|
1219
|
+
`y`:
|
1220
|
+
|
1221
|
+
"x\\"=y
|
1222
|
+
|
1223
|
+
If quoting were omitted the equals character (separating the
|
1224
|
+
entry name `x` from the value `y`) would be escaped.
|
1225
|
+
|
1226
|
+
|
1227
|
+
== How can I control page breaks when printing HTML outputs?
|
1228
|
+
Here are some techniques you can use to control page breaks in HTML
|
1229
|
+
outputs produced by the 'xhtml11' and 'html5' backends:
|
1230
|
+
|
1231
|
+
- You can generate a page break with the '<<<' block macro. The
|
1232
|
+
following example prints the 'Rats and Mice' section on a new page:
|
1233
|
+
+
|
1234
|
+
----------------
|
1235
|
+
<<<
|
1236
|
+
== Rats and Mice
|
1237
|
+
Lorum ipsum ...
|
1238
|
+
----------------
|
1239
|
+
|
1240
|
+
- You can use the 'unbreakable' option to instruct the browser not to
|
1241
|
+
break a block element. The following image and it's caption will be
|
1242
|
+
kept together the printed page:
|
1243
|
+
+
|
1244
|
+
------------------------------------
|
1245
|
+
[options="unbreakable"]
|
1246
|
+
.Tiger block image
|
1247
|
+
image::images/tiger.png[Tiger image]
|
1248
|
+
------------------------------------
|
1249
|
+
|
1250
|
+
- You can apply the 'unbreakable' option globally to all block
|
1251
|
+
elements by defining the 'unbreakable-option' attribute in your
|
1252
|
+
document header.
|
1253
|
+
|
1254
|
+
- Finally, the most powerful technique is to create custom CSS
|
1255
|
+
containing paged media properties. For example this asciidoc(1)
|
1256
|
+
command:
|
1257
|
+
+
|
1258
|
+
--
|
1259
|
+
|
1260
|
+
asciidoc --attribute stylesheet=article.css article.txt
|
1261
|
+
|
1262
|
+
Will include the following `article.css` file in the output document:
|
1263
|
+
|
1264
|
+
-------------------------------------------------
|
1265
|
+
div#toc, div.sect1 { page-break-before: always; }
|
1266
|
+
-------------------------------------------------
|
1267
|
+
|
1268
|
+
Which will ensure the table of contents and all top level sections
|
1269
|
+
start on a new printed page.
|
1270
|
+
--
|
1271
|
+
|
1272
|
+
|
1273
|
+
== Is it possible to reposition the Table of Contents in HTML outputs?
|
1274
|
+
By default the 'xhtml11' and 'html5' backends auto-position the TOC
|
1275
|
+
after the header. You can manually position the header by setting the
|
1276
|
+
'toc-placement' attribute value to 'manual' and then inserting the
|
1277
|
+
`toc::[]` block macro where you want the TOC to appear. For example,
|
1278
|
+
put this in the document header:
|
1279
|
+
|
1280
|
+
----------------------
|
1281
|
+
:toc-placement: manual
|
1282
|
+
----------------------
|
1283
|
+
|
1284
|
+
and this where you want the TOC to appear:
|
1285
|
+
|
1286
|
+
-------
|
1287
|
+
toc::[]
|
1288
|
+
-------
|
1289
|
+
|
1290
|
+
|
1291
|
+
== HTML generated by AsciiDoc fills the width of the browser, how can I limit it to a more readable book width?
|
1292
|
+
You can set the maximum with for outputs generated by 'html5',
|
1293
|
+
'xhtml11' and 'slidy' backends by assigning the
|
1294
|
+
link:userguide.html#X103[max-width] attribute (either from the
|
1295
|
+
command-line or with an attribute entry in the document header). For
|
1296
|
+
example:
|
1297
|
+
|
1298
|
+
asciidoc -a max-width=55em article.txt
|