mizuho 0.9.6 → 0.9.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (222) hide show
  1. data/README.markdown +4 -2
  2. data/Rakefile +0 -37
  3. data/asciidoc/BUGS +9 -18
  4. data/asciidoc/BUGS.txt +5 -14
  5. data/asciidoc/CHANGELOG +1433 -266
  6. data/asciidoc/CHANGELOG.txt +2821 -1810
  7. data/asciidoc/COPYING +339 -339
  8. data/asciidoc/COPYRIGHT +18 -18
  9. data/asciidoc/INSTALL +189 -30
  10. data/asciidoc/INSTALL.txt +175 -19
  11. data/asciidoc/MANIFEST +88 -0
  12. data/asciidoc/Makefile.in +29 -13
  13. data/asciidoc/README +16 -17
  14. data/asciidoc/README.txt +35 -36
  15. data/asciidoc/a2x.py +902 -0
  16. data/asciidoc/asciidoc.conf +610 -455
  17. data/asciidoc/asciidoc.py +1965 -1061
  18. data/asciidoc/asciidocapi.py +257 -0
  19. data/asciidoc/common.aap +2 -2
  20. data/asciidoc/configure +1170 -1023
  21. data/asciidoc/configure.ac +1 -1
  22. data/asciidoc/dblatex/asciidoc-dblatex.xsl +42 -0
  23. data/asciidoc/doc/a2x.1 +559 -102
  24. data/asciidoc/doc/a2x.1.txt +233 -91
  25. data/asciidoc/doc/article-docinfo.xml +87 -0
  26. data/asciidoc/doc/article.pdf +0 -0
  27. data/asciidoc/doc/article.txt +139 -122
  28. data/asciidoc/doc/asciidoc.1 +157 -46
  29. data/asciidoc/doc/asciidoc.1.txt +171 -118
  30. data/asciidoc/doc/asciidoc.conf +7 -8
  31. data/asciidoc/doc/asciidoc.dict +960 -635
  32. data/asciidoc/doc/asciidoc.txt +2335 -1464
  33. data/asciidoc/doc/asciidocapi.txt +189 -0
  34. data/asciidoc/doc/asciimathml.txt +14 -17
  35. data/asciidoc/doc/book-multi.txt +181 -155
  36. data/asciidoc/doc/book.epub +0 -0
  37. data/asciidoc/doc/book.txt +156 -131
  38. data/asciidoc/doc/customers.csv +18 -18
  39. data/asciidoc/doc/epub-notes.txt +210 -0
  40. data/asciidoc/doc/faq.txt +1122 -547
  41. data/asciidoc/doc/latex-backend.txt +192 -191
  42. data/asciidoc/doc/latex-bugs.txt +134 -0
  43. data/asciidoc/doc/latex-filter.pdf +0 -0
  44. data/asciidoc/doc/latex-filter.txt +196 -0
  45. data/asciidoc/doc/latexmath.txt +13 -136
  46. data/asciidoc/doc/latexmathml.txt +2 -2
  47. data/asciidoc/doc/main.aap +233 -297
  48. data/asciidoc/doc/music-filter.pdf +0 -0
  49. data/asciidoc/doc/music-filter.txt +55 -65
  50. data/asciidoc/doc/publishing-ebooks-with-asciidoc.txt +398 -0
  51. data/asciidoc/doc/slidy-example.txt +167 -0
  52. data/asciidoc/doc/slidy.txt +113 -0
  53. data/asciidoc/doc/source-highlight-filter.pdf +0 -0
  54. data/asciidoc/doc/source-highlight-filter.txt +45 -20
  55. data/asciidoc/doc/testasciidoc.txt +231 -0
  56. data/asciidoc/docbook-xsl/asciidoc-docbook-xsl.txt +30 -8
  57. data/asciidoc/docbook-xsl/chunked.xsl +17 -19
  58. data/asciidoc/docbook-xsl/common.xsl +106 -67
  59. data/asciidoc/docbook-xsl/epub.xsl +35 -0
  60. data/asciidoc/docbook-xsl/fo.xsl +3 -0
  61. data/asciidoc/docbook-xsl/htmlhelp.xsl +16 -17
  62. data/asciidoc/docbook-xsl/manpage.xsl +31 -31
  63. data/asciidoc/docbook-xsl/text.xsl +6 -1
  64. data/asciidoc/docbook-xsl/xhtml.xsl +14 -14
  65. data/asciidoc/docbook45.conf +759 -0
  66. data/asciidoc/filters/code/code-filter-readme.txt +37 -37
  67. data/asciidoc/filters/code/code-filter-test.txt +15 -15
  68. data/asciidoc/filters/code/code-filter.conf +8 -8
  69. data/asciidoc/filters/graphviz/asciidoc-graphviz-sample.txt +104 -64
  70. data/asciidoc/filters/graphviz/graphviz-filter.conf +20 -16
  71. data/asciidoc/filters/graphviz/graphviz2png.py +54 -39
  72. data/asciidoc/filters/latex/latex-filter.conf +18 -0
  73. data/asciidoc/filters/latex/latex2png.py +216 -0
  74. data/asciidoc/filters/music/music-filter.conf +8 -17
  75. data/asciidoc/filters/music/music2png.py +40 -32
  76. data/asciidoc/filters/source/source-highlight-filter.conf +40 -34
  77. data/asciidoc/help.conf +261 -96
  78. data/asciidoc/html4.conf +505 -460
  79. data/asciidoc/html5.conf +686 -0
  80. data/asciidoc/images/highlighter.png +0 -0
  81. data/asciidoc/images/icons/caution.png +0 -0
  82. data/asciidoc/images/icons/example.png +0 -0
  83. data/asciidoc/images/icons/important.png +0 -0
  84. data/asciidoc/images/icons/note.png +0 -0
  85. data/asciidoc/images/icons/tip.png +0 -0
  86. data/asciidoc/images/icons/warning.png +0 -0
  87. data/asciidoc/images/smallnew.png +0 -0
  88. data/asciidoc/javascripts/asciidoc.js +189 -0
  89. data/asciidoc/javascripts/slidy.js +2845 -0
  90. data/asciidoc/javascripts/toc.js +8 -0
  91. data/asciidoc/lang-de.conf +57 -0
  92. data/asciidoc/lang-en.conf +54 -0
  93. data/asciidoc/lang-es.conf +49 -9
  94. data/asciidoc/lang-fr.conf +59 -0
  95. data/asciidoc/lang-hu.conf +55 -0
  96. data/asciidoc/lang-it.conf +55 -0
  97. data/asciidoc/lang-nl.conf +57 -0
  98. data/asciidoc/lang-pt-BR.conf +56 -0
  99. data/asciidoc/lang-ru.conf +60 -0
  100. data/asciidoc/lang-uk.conf +60 -0
  101. data/asciidoc/latex.conf +700 -663
  102. data/asciidoc/main.aap +77 -0
  103. data/asciidoc/slidy.conf +136 -0
  104. data/asciidoc/{examples/website/xhtml11-manpage.css → stylesheets/asciidoc-manpage.css} +1 -1
  105. data/asciidoc/stylesheets/asciidoc.css +508 -0
  106. data/asciidoc/stylesheets/docbook-xsl.css +322 -272
  107. data/asciidoc/stylesheets/flask-manpage.css +1 -0
  108. data/asciidoc/stylesheets/flask.css +584 -0
  109. data/asciidoc/stylesheets/pygments.css +66 -0
  110. data/asciidoc/stylesheets/slidy.css +445 -0
  111. data/asciidoc/stylesheets/toc2.css +33 -0
  112. data/asciidoc/stylesheets/volnitsky-manpage.css +1 -0
  113. data/asciidoc/stylesheets/volnitsky.css +435 -0
  114. data/asciidoc/stylesheets/xhtml11-quirks.css +5 -3
  115. data/asciidoc/tests/asciidocapi.py +257 -0
  116. data/asciidoc/tests/data/deprecated-quotes.txt +12 -0
  117. data/asciidoc/tests/data/filters-test.txt +90 -0
  118. data/asciidoc/tests/data/lang-de-test.txt +106 -0
  119. data/asciidoc/tests/data/lang-en-test.txt +114 -0
  120. data/asciidoc/tests/data/lang-es-test.txt +106 -0
  121. data/asciidoc/tests/data/lang-fr-test.txt +106 -0
  122. data/asciidoc/tests/data/lang-hu-test.txt +106 -0
  123. data/asciidoc/tests/data/lang-nl-test.txt +94 -0
  124. data/asciidoc/tests/data/lang-pt-BR-test.txt +106 -0
  125. data/asciidoc/tests/data/lang-ru-test.txt +106 -0
  126. data/asciidoc/tests/data/lang-uk-test.txt +106 -0
  127. data/asciidoc/tests/data/oldtables.txt +64 -0
  128. data/asciidoc/tests/data/rcs-id-marker-test.txt +6 -0
  129. data/asciidoc/tests/data/testcases.conf +2 -0
  130. data/asciidoc/tests/data/testcases.txt +740 -0
  131. data/asciidoc/tests/data/utf8-bom-test.txt +9 -0
  132. data/asciidoc/tests/data/utf8-examples.txt +217 -0
  133. data/asciidoc/tests/testasciidoc.conf +520 -0
  134. data/asciidoc/tests/testasciidoc.py +411 -0
  135. data/asciidoc/text.conf +16 -16
  136. data/asciidoc/vim/syntax/asciidoc.vim +99 -91
  137. data/asciidoc/wordpress.conf +43 -3
  138. data/asciidoc/xhtml11-quirks.conf +61 -57
  139. data/asciidoc/xhtml11.conf +684 -645
  140. data/lib/mizuho.rb +2 -0
  141. data/lib/mizuho/generator.rb +2 -2
  142. data/test/generator_spec.rb +1 -1
  143. data/test/parser_spec.rb +1 -1
  144. data/test/spec_helper.rb +3 -4
  145. metadata +87 -88
  146. data/asciidoc/a2x +0 -674
  147. data/asciidoc/doc/article.css-embedded.html +0 -602
  148. data/asciidoc/doc/article.html +0 -46
  149. data/asciidoc/doc/asciidoc-revhistory.xml +0 -27
  150. data/asciidoc/doc/asciidoc.1.css-embedded.html +0 -598
  151. data/asciidoc/doc/asciidoc.1.css.html +0 -212
  152. data/asciidoc/doc/asciidoc.1.html +0 -190
  153. data/asciidoc/doc/asciidoc.css-embedded.html +0 -7853
  154. data/asciidoc/doc/asciidoc.css.html +0 -7416
  155. data/asciidoc/doc/asciidoc.html +0 -3339
  156. data/asciidoc/doc/book-multi.css-embedded.html +0 -575
  157. data/asciidoc/doc/book-multi.html +0 -55
  158. data/asciidoc/doc/book.css-embedded.html +0 -607
  159. data/asciidoc/doc/book.html +0 -43
  160. data/asciidoc/doc/docbook-xsl.css +0 -272
  161. data/asciidoc/doc/latex-backend.html +0 -117
  162. data/asciidoc/doc/music-filter.html +0 -566
  163. data/asciidoc/doc/source-highlight-filter.html +0 -214
  164. data/asciidoc/docbook.conf +0 -721
  165. data/asciidoc/examples/website/ASCIIMathML.js +0 -938
  166. data/asciidoc/examples/website/CHANGELOG.html +0 -4389
  167. data/asciidoc/examples/website/CHANGELOG.txt +0 -1810
  168. data/asciidoc/examples/website/INSTALL.html +0 -161
  169. data/asciidoc/examples/website/INSTALL.txt +0 -71
  170. data/asciidoc/examples/website/LaTeXMathML.js +0 -1223
  171. data/asciidoc/examples/website/README-website.html +0 -118
  172. data/asciidoc/examples/website/README-website.txt +0 -29
  173. data/asciidoc/examples/website/README.html +0 -125
  174. data/asciidoc/examples/website/README.txt +0 -36
  175. data/asciidoc/examples/website/a2x.1.html +0 -419
  176. data/asciidoc/examples/website/a2x.1.txt +0 -204
  177. data/asciidoc/examples/website/asciidoc-docbook-xsl.html +0 -130
  178. data/asciidoc/examples/website/asciidoc-docbook-xsl.txt +0 -43
  179. data/asciidoc/examples/website/asciidoc-graphviz-sample.txt +0 -130
  180. data/asciidoc/examples/website/asciimathml.txt +0 -64
  181. data/asciidoc/examples/website/build-website.sh +0 -25
  182. data/asciidoc/examples/website/customers.csv +0 -18
  183. data/asciidoc/examples/website/downloads.html +0 -257
  184. data/asciidoc/examples/website/downloads.txt +0 -121
  185. data/asciidoc/examples/website/faq.html +0 -673
  186. data/asciidoc/examples/website/faq.txt +0 -547
  187. data/asciidoc/examples/website/index.html +0 -419
  188. data/asciidoc/examples/website/index.txt +0 -245
  189. data/asciidoc/examples/website/latex-backend.html +0 -535
  190. data/asciidoc/examples/website/latex-backend.txt +0 -191
  191. data/asciidoc/examples/website/latexmathml.txt +0 -41
  192. data/asciidoc/examples/website/layout1.conf +0 -161
  193. data/asciidoc/examples/website/layout1.css +0 -65
  194. data/asciidoc/examples/website/layout2.conf +0 -158
  195. data/asciidoc/examples/website/layout2.css +0 -93
  196. data/asciidoc/examples/website/manpage.html +0 -266
  197. data/asciidoc/examples/website/manpage.txt +0 -118
  198. data/asciidoc/examples/website/music-filter.html +0 -242
  199. data/asciidoc/examples/website/music-filter.txt +0 -158
  200. data/asciidoc/examples/website/music1.abc +0 -12
  201. data/asciidoc/examples/website/music1.png +0 -0
  202. data/asciidoc/examples/website/music2.ly +0 -9
  203. data/asciidoc/examples/website/music2.png +0 -0
  204. data/asciidoc/examples/website/newlists.txt +0 -40
  205. data/asciidoc/examples/website/newtables.txt +0 -397
  206. data/asciidoc/examples/website/sample1.png +0 -0
  207. data/asciidoc/examples/website/sample3.png +0 -0
  208. data/asciidoc/examples/website/sample4.png +0 -0
  209. data/asciidoc/examples/website/source-highlight-filter.html +0 -286
  210. data/asciidoc/examples/website/source-highlight-filter.txt +0 -203
  211. data/asciidoc/examples/website/support.html +0 -78
  212. data/asciidoc/examples/website/support.txt +0 -5
  213. data/asciidoc/examples/website/toc.js +0 -69
  214. data/asciidoc/examples/website/userguide.html +0 -7460
  215. data/asciidoc/examples/website/userguide.txt +0 -4979
  216. data/asciidoc/examples/website/version83.txt +0 -37
  217. data/asciidoc/examples/website/version9.html +0 -143
  218. data/asciidoc/examples/website/version9.txt +0 -48
  219. data/asciidoc/examples/website/xhtml11-quirks.css +0 -41
  220. data/asciidoc/examples/website/xhtml11.css +0 -328
  221. data/asciidoc/stylesheets/xhtml11-manpage.css +0 -18
  222. data/asciidoc/stylesheets/xhtml11.css +0 -328
@@ -1,547 +1,1122 @@
1
- AsciiDoc Frequently Asked Questions
2
- ===================================
3
-
4
- An embryonic AsciiDoc FAQ.
5
-
6
-
7
- == Is it possible to include charts in AsciiDoc documents?
8
-
9
- There are a number of programs available that generate presentation
10
- charts from textual specification, for example
11
- http://home.gna.org/pychart/[Pychart] is a library for writing chart
12
- scripts in Python. Here's an example from the 'Pychart' documentation:
13
-
14
- .barchart.py
15
- ---------------------------------------------------------------------
16
- #
17
- # Example bar chart (from Pychart documentation http://home.gna.org/pychart/).
18
- #
19
- from pychart import *
20
- theme.get_options()
21
-
22
- data = [(10, 20, 30, 5), (20, 65, 33, 5), (30, 55, 30, 5), (40, 45, 51, 7),
23
- (50, 25, 27, 3), (60, 75, 30, 5), (70, 80, 42, 5), (80, 62, 32, 5),
24
- (90, 42, 39, 5), (100, 32, 39, 4)]
25
-
26
- # The attribute y_coord=... tells that the Y axis values
27
- # should be taken from samples.
28
- # In this example, Y values will be [40,50,60,70,80].
29
- ar = area.T(y_coord = category_coord.T(data[3:8], 0),
30
- x_grid_style=line_style.gray50_dash1,
31
- x_grid_interval=20, x_range = (0,100),
32
- x_axis=axis.X(label="X label"),
33
- y_axis=axis.Y(label="Y label"),
34
- bg_style = fill_style.gray90,
35
- border_line_style = line_style.default,
36
- legend = legend.T(loc=(80,10)))
37
-
38
- # Below call sets the default attributes for all bar plots.
39
- chart_object.set_defaults(bar_plot.T, direction="horizontal", data=data)
40
-
41
- # Attribute cluster=(0,3) tells that you are going to draw three bar
42
- # plots side by side. The plot labeled "foo" will the leftmost (i.e.,
43
- # 0th out of 3). Attribute hcol tells the column from which to
44
- # retrive sample values from. It defaults to one.
45
- ar.add_plot(bar_plot.T(label="foo", cluster=(0,3)))
46
- ar.add_plot(bar_plot.T(label="bar", hcol=2, cluster=(1,3)))
47
- ar.add_plot(bar_plot.T(label="baz", hcol=3, cluster=(2,3)))
48
- ar.draw()
49
- ---------------------------------------------------------------------
50
-
51
- To execute the script and include the generated chart image in your
52
- document add the following lines to the AsciiDoc source:
53
-
54
- ---------------------------------------------------------------------
55
- // Generate chart image file.
56
- \sys2::[python barchart.py --format=png --output=barchart.png --scale=2]
57
-
58
- // Display chart image file.
59
- image::barchart.png[]
60
- ---------------------------------------------------------------------
61
-
62
- NOTE: You need to run asciidoc(1) with the `--unsafe` command-line
63
- option to execute the `sys2` system macro.
64
-
65
-
66
- == How can I render indented paragraphs?
67
-
68
- To unconditionally indent all paragraphs add the following line to the
69
- `xhtml11.css` stylesheet (or a custom stylesheet).
70
-
71
- ---------------------------------------------------------------------
72
- div.paragraph p {text-indent: 3em;}
73
- ---------------------------------------------------------------------
74
-
75
- This will restyle the entire document by indenting all paragraphs
76
- which is normally what you want to do (mixed paragraph styles produce
77
- ugly documents).
78
-
79
- To selectively indent paragraphs with the 'indented' style add the
80
- following line to the `xhtml11.css` stylesheet (or a custom
81
- stylesheet).
82
-
83
- ---------------------------------------------------------------------
84
- div.paragraph.indented p {text-indent: 3em;}
85
- ---------------------------------------------------------------------
86
-
87
- Then apply the 'indented' style to normal paragraphs, for example:
88
-
89
- ---------------------------------------------------------------------
90
- [indented]
91
- Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas
92
- ultrices justo porttitor augue. Vestibulum pretium. Donec porta
93
- vestibulum mi. Aliquam pede. Aenean lobortis lorem et lacus. Sed
94
- lacinia. Vivamus at lectus.
95
- ---------------------------------------------------------------------
96
-
97
- NOTE: This FAQ applies to XHTML output not DocBook. To achieve the
98
- same results with DocBook you would need to customize the DocBook XSL
99
- stylesheets to indent paragraphs with the `simpara` element
100
- `role="indented"` attribute.
101
-
102
-
103
- == Is there a way to set default image height and width attributes?
104
-
105
- You can set the 'height' and 'width' attributes globally in your
106
- document with Attribute Entries or from the command-line using the
107
- `--attribute` option. In the following example images that don't
108
- explicitly set the 'height' and 'width' values will be 350 by 250
109
- pixels.
110
-
111
- ---------------------------------------------------------------------
112
- :height: 250
113
- :width: 350
114
-
115
- image:images/tiger.png[]
116
- ---------------------------------------------------------------------
117
-
118
-
119
- == How can I place a backslash character in front of an attribute reference without escaping the reference?
120
-
121
- Use the predefined `\{backslash}` attribute reference instead of an
122
- actual backslash, for example if the `\{projectname}` attribute has
123
- the value `foobar` then:
124
-
125
- d:\data{backslash}{projectname}
126
-
127
- would be rendered as:
128
-
129
- d:\data\foobar
130
-
131
- == How can I escape AsciiDoc markup?
132
-
133
- Most AsciiDoc inline elements can be suppressed by preceding them with
134
- a backslash character. These elements include:
135
-
136
- - Attribute references.
137
- - Text formatting.
138
- - Quoting,
139
- - Macros.
140
- - Replacements.
141
- - Special words.
142
- - Table cell separators.
143
-
144
- But there are exceptions -- see the next question.
145
-
146
-
147
- == Some elements can't be escaped with a single backslash
148
-
149
- There are a number of exceptions to the usual single backslash rule
150
- -- mostly relating to URL macros that have two syntaxes or quoting
151
- ambiguity. Here are some non-standard escape examples:
152
-
153
- [cols="1default,4literal",width="70%",grid="none",frame="none"]
154
- |====================================================================
155
- |Mailto URLs |
156
- \srackham@methods.co.nz
157
- <\srackham@methods.co.nz>
158
- \mailto:[\srackham@methods.co.nz]
159
-
160
- |Web URLs |
161
- \http://www.foo1.co.nz
162
- \\http://www.foobar.com[]
163
- \\http://www.foobar.com[Foobar Limited]
164
-
165
- |Other |
166
- A C+\+ Library for C++
167
- A C+\+ Library for C+\+ \+++
168
- \\``double-quotes''
169
- \*\*F**ile Open...
170
- |====================================================================
171
-
172
- The source of this problem is ambiguity across substitution types --
173
- the first match unescapes allowing the second to substitute. A
174
- work-around for difficult cases is to side-step the problem using the
175
- `\pass:[]` passthrough inline macro.
176
-
177
-
178
- == How can I set default list and tables styles?
179
-
180
- You can set the element's 'style' entry in a global or custom
181
- configuration file.
182
-
183
- This example this will horizontally style all labeled lists that don't
184
- have an explicit style attribute:
185
-
186
- ----------------------------------
187
- [listdef-labeled]
188
- style=horizontal
189
-
190
- [listdef-labeled2]
191
- style=horizontal
192
- ----------------------------------
193
-
194
- This example will put a top and bottom border on all tables that don't
195
- already have an explicit style attribute:
196
-
197
- ----------------------------------
198
- [tabledef-default]
199
- style=topbot
200
- topbot-style=frame="topbot"
201
- ----------------------------------
202
-
203
- Alternatively you can set the configuration entries from inside your
204
- document, the above examples are equivalent to:
205
-
206
- ----------------------------------
207
- :listdef-labeled.style: horizontal
208
- :listdef-labeled2.style: horizontal
209
-
210
- :tabledef-default.topbot-style: frame="topbot"
211
- :tabledef-default.style: topbot
212
- ----------------------------------
213
-
214
-
215
- == Why do I get a filter non-zero exit code error?
216
-
217
- An error was returned when AsciiDoc tried to execute an external
218
- filter command. The most common reason for this is that the filter
219
- command could not be found by the command shell. To figure out what
220
- the problem is run AsciiDoc with the `--verbose` option to determine
221
- the command that is failing and then try to run the command manually
222
- from the command-line.
223
-
224
-
225
- == Are there any DocBook viewers?
226
-
227
- http://live.gnome.org/Yelp[Yelp], the GNOME help viewer, does a
228
- creditable job of displaying DocBook files XML files directly. Just
229
- run it from the command-line, for example:
230
-
231
- $ yelp file://home/srackham/tmp/book.xml
232
-
233
- Note that you have to supply the full path name in URI format, this
234
- shell script makes interactive use easier:
235
-
236
- -------------------------------
237
- #!/bin/sh
238
- if [ -z "$1" ]; then
239
- echo "usage: dbkview FILE"
240
- exit 1
241
- fi
242
- yelp "file://$(pwd)/$1"
243
- -------------------------------
244
-
245
- This tip was submitted by Lionel Orry.
246
-
247
-
248
- == Can you create ODF documents using AsciiDoc?
249
-
250
- The easiest and highest fidelity methods I've seen is to generate
251
- HTML from AsciiDoc then paste it from your browser (we use Firefox)
252
- into OpenOffice Writer.
253
-
254
- - I found that that there is better fidelity pasting HTML generated by
255
- the 'html4' backend instead of the default 'xhtml11' backend.
256
- - Don't paste AsciiDoc tables of contents, OpenOffice Writer (I was
257
- using version 2.3) hangs when saving. This may be something to do
258
- with the embedded JavaScript but I haven't looked closely at it, I
259
- may even be wrong about this.
260
-
261
- This tip was contributed by Bernard Amade.
262
-
263
-
264
- == How can I supress cell separators in included table data files?
265
-
266
- Use the `\{include:}` system attribute instead of the `\include::[]`
267
- macro (the former is not expanded until after the table data has been
268
- parsed into cells, whereas the latter is included before the table is
269
- processed.
270
-
271
-
272
- == How can I preserve paragraph line boundaries?
273
-
274
- Apply the The 'verse' paragraph style, the rendered text preserves
275
- line boundaries and is useful for lyrics and poems. For example:
276
-
277
- ---------------------------------------------------------------------
278
- [verse]
279
- Consul *necessitatibus* per id,
280
- consetetur, eu pro everti postulant
281
- homero verear ea mea, qui.
282
- ---------------------------------------------------------------------
283
-
284
- If you are generating PDF files (using FOP) or HTML files then you can
285
- use line breaks. For example:
286
-
287
- ---------------------------------------------------------------------
288
- Consul *necessitatibus* per id, +
289
- consetetur, eu pro everti postulant +
290
- homero verear ea mea, qui.
291
- ---------------------------------------------------------------------
292
-
293
-
294
- == How can I include non-breaking space characters?
295
-
296
- The predefined `\{nbsp}` attribute reference will be replaced by a
297
- non-breaking space character. You could also use the non-breaking
298
- space character entity reference `\&#160;` (see the next question).
299
-
300
-
301
- == Can I include HTML and XML character entity references in my document?
302
-
303
- Yes, just enter the reference in your document. For example `\&#946;`
304
- will print a Greek small beta character &#946;
305
-
306
-
307
- [[X1]]
308
- == How do I include spaces in URLs?
309
-
310
- URL inline macro targets (addresses) cannot contain white space
311
- characters. If you need spaces encode them as `%20`. For example:
312
-
313
- image:large%20image.png[]
314
- http://www.foo.bar.com/an%20example%20document.html
315
-
316
-
317
- == How can I get AsciiDoc to assign the correct DocBook language attribute?
318
-
319
- Set the AsciiDoc 'lang' attribute to the appropriate language code.
320
- For example:
321
-
322
- $ a2x -a lang=es doc/article.txt
323
-
324
- This will ensure that downstream DocBook processing will generate the
325
- correct language specific document headings (things like table of
326
- contents, revision history, figure and table captions, admonition
327
- captions).
328
-
329
-
330
- == Why does AsciiDoc give me a ``malformed author'' error?
331
-
332
- This is normally because there are more than three names (up to three
333
- are expected: first name, middle name and last name). For example,
334
- this author line would result in an error:
335
-
336
- Vincent Willem van Gogh
337
-
338
- You can enter multi-word first, middle and last names in the author
339
- line using the underscore as a word separator. For example:
340
-
341
- Vincent Willem van_Gogh
342
-
343
- You could also resolve the problem by replacing the author line with
344
- explicit attribute entries:
345
-
346
- :First name: Vincent
347
- :Middle name: Willem
348
- :Last name: Van Gogh
349
-
350
-
351
- == How can I assign multiple author names?
352
-
353
- A quick way to do this is put both authors in a single first name, for
354
- example:
355
-
356
- My Document
357
- ===========
358
- :Author: Bill_and_Ben_the_Flowerpot_Men
359
- :Author Initials: BB & BC
360
-
361
- asciidoc(1) replaces the underscores with spaces.
362
-
363
- The longer, semantically correct, way is to override the
364
- `[header]` configuration file section in a document specific `.conf`
365
- file. For example if your document is `mydoc.txt` then a file called
366
- `mydoc.conf` in the document directory would be picked up
367
- automatically by asciidoc(1). Copy and paste the default
368
- `docbook.conf` file `[header]` to `mydoc.conf` and modify the author
369
- related markup:
370
-
371
- [header]
372
- :
373
- <authorgroup>...
374
- :
375
-
376
-
377
- == How can I escape a labeled list entry?
378
-
379
- Two colons or semicolons in a paragraph may be confused with a labeled
380
- list entry. Use the predefined `\{two_colons}` and `\{two_semicolons}`
381
- to suppress this behavior, for example:
382
-
383
- Qui in magna commodo{two_colons} est labitur dolorum an. Est ne
384
- magna primis adolescens.
385
-
386
- Will be rendered as:
387
-
388
- Qui in magna commodo{two_colons} est labitur dolorum an. Est ne
389
- magna primis adolescens.
390
-
391
-
392
- == How can I selectively disable a quoted text substitution?
393
-
394
- Omitting the tag name will disable quoting. For example, if you don't
395
- want superscripts or subscripts then put the following in a custom
396
- configuration file or edit the global `asciidoc.conf` configuration
397
- file:
398
-
399
- -------------------
400
- [quotes]
401
- ^=
402
- ~=
403
- -------------------
404
-
405
- Alternatively you can set the configuration entries from within your
406
- document, the above examples are equivalent to:
407
-
408
- -------------------
409
- :quotes.^:
410
- :quotes.~:
411
- -------------------
412
-
413
-
414
- == How can I customize the \{localdate} format?
415
-
416
- The default format for the `\{localdate}` attribute is the ISO 8601
417
- `yyyy-mm-dd` format. You can change this format by explicitly setting
418
- the `\{localdate}` attribute. For example by setting it using the
419
- asciidoc(1) `-a` command-line option:
420
-
421
- $ asciidoc -a localdate=`date +%d-%d-%Y` mydoc.txt
422
-
423
- You could also set it by adding an Attribute Entry to your souce
424
- document, for example:
425
-
426
- :localdate: {sys: date +%Y-%m-%d}
427
-
428
- Since it's set using an executable attribute you'll also need to
429
- include the `--unsafe` option when you run asciidoc).
430
-
431
-
432
- == Why doesn't AsciiDoc support strike through text?
433
-
434
- The reason it's not in the distribution is that DocBook does not have
435
- provision for strike through text and one of the AsciiDoc design goals
436
- is that AsciiDoc markup should be applicable to all output formats.
437
-
438
- Strike through is normally used to mark deleted text -- a more
439
- comprehensive way to manage document revisions is to use a version
440
- control system such as Subversion. You can also use the AsciiDoc
441
- 'CommentLines' and 'CommentBlocks' to retain revised text in the
442
- source document.
443
-
444
- If you really need strike through text for (X)HTML outputs then adding
445
- the following to a configuration file will allow you to quote strike
446
- through text with hyphen characters:
447
-
448
- ---------------------------------------------------------------------
449
- ifdef::basebackend-html[]
450
-
451
- [quotes]
452
- -=strikethrough
453
-
454
- [tags]
455
- strikethrough=<span style="text-decoration: line-through;">|</span>
456
-
457
- endif::basebackend-html[]
458
- ---------------------------------------------------------------------
459
-
460
-
461
- == Where can I find examples of commands used to build output documents?
462
-
463
- The User Guide has some. You could also look at `./doc/main.aap` in
464
- the AsciiDoc distribution, it has all the commands used to build the
465
- AsciiDoc documentation (even if you don't use A-A-P you'll still find
466
- it useful).
467
-
468
-
469
- == Why have you used the DocBook <simpara> element instead of <para>?
470
-
471
- `<simpara>` is really the same as `<para>` except it can't contain
472
- block elements -- this matched, more closely, the AsciiDoc paragraph
473
- semantics.
474
-
475
-
476
- == How can I format text inside a listing block?
477
-
478
- By default only 'specialcharacters' and 'callouts' are substituted in
479
- listing blocks; you can add quotes substitutions by explicitly setting
480
- the block 'subs' attribute, for example:
481
-
482
- [subs="quotes"]
483
- ------------------------------------------
484
- $ ls *-al*
485
- ------------------------------------------
486
-
487
- The `-al` will rendered bold. Note that:
488
-
489
- - You would need to explicitly escape text you didn't want quoted.
490
- - Don't do this in source code listing blocks because it modifies the
491
- source code which confuses the syntax highlighter.
492
- - This only works if your DocBook processor recognizes DocBook
493
- `<emphasis>` elements inside `<screen>` elements.
494
-
495
-
496
- == Why doesn't the include1::[] macro work?
497
-
498
- Internally the `include1` macro is translated to the `include1` system
499
- attribute which means it must be evaluated in a region where attribute
500
- substitution is enabled. `include1` won't work, for example, in a
501
- ListingBlock (unless attribute substitution is enabled). `include1`
502
- is intended for use in configuration files, use the `include` macro
503
- and set the attribute `depth=1` instead, for example:
504
-
505
- -----------------------------------------------
506
- include::blogpost_media_processing.txt[depth=1]
507
- -----------------------------------------------
508
-
509
- == How can I customize PDF files generated by dblatex?
510
-
511
- There are a number of dblatex XSL parameters that can be used to
512
- customize PDF output. You can set them globally in the AsciiDoc
513
- `./dblatex/asciidoc-dblatex.xsl` configuration file or you can also
514
- pass them on the a2x(1) command-line, for example:
515
-
516
- a2x -f pdf --dblatex-opts "-P latex.output.revhistory=0" doc/article.txt
517
-
518
- See also the http://dblatex.sourceforge.net/[dblatex] documentation.
519
-
520
-
521
- == How can I make the mailto macro work with multiple email addresses?
522
-
523
- For the AsciiDoc 'mailto' macro to work with multiple email addresses
524
- (as per RFC2368) you need to URL encode the '@' characters (replace
525
- them with '%40'), if you don't the individual addresses will be
526
- rendered as separate links. You also need to <<X1,replace spaces with
527
- '%20'>>.
528
-
529
- For example, the following call won't work:
530
-
531
- mailto:jb@foobar.com,jd@acme.co.nz?subject=New foofoo release[New foofoo release]
532
-
533
- Use this instead:
534
-
535
- mailto:jb%40foobar.com,jd%40acme.co.nz?subject=New%20foofoo%20release[New foofoo release]
536
-
537
-
538
- == How can a replacement have a trailing backslash?
539
- Quote the entry name -- this nonsensical example replaces `x\` with
540
- `y`:
541
-
542
- "x\\"=y
543
-
544
- If quoting were omitted the equals character (separating the
545
- entry name `x` from the value `y`) would be escaped.
546
-
547
-
1
+ AsciiDoc Frequently Asked Questions
2
+ ===================================
3
+
4
+
5
+ [NOTE]
6
+ ======
7
+ - New FAQs are normally added at the top of this document.
8
+ - The FAQ may be updated between AsciiDoc releases so some of the
9
+ newer FAQs may apply to the trunk and not the current release.
10
+ ======
11
+
12
+ [[X5]]
13
+ == How can I include embedded fonts in an EPUB document
14
+ This is a two step process:
15
+
16
+ 1. Declare the font files and their use in your document's CSS
17
+ stylesheet. For example:
18
+ +
19
+ [listing]
20
+ .........................................
21
+ @font-face {
22
+ font-family : LiberationSerif-Regular;
23
+ font-weight : normal;
24
+ font-style: normal;
25
+ src : url(LiberationSerif-Regular.ttf);
26
+ }
27
+
28
+ body {
29
+ font-family: LiberationSerif-Regular, serif;
30
+ }
31
+ .........................................
32
+
33
+ 2. Declare the the font file as resource when you use `a2x(1)` to
34
+ compile the EPUB. For example:
35
+
36
+ a2x -f epub -d book --epubcheck --stylesheet epubtest.css --resource .ttf=application/x-font-ttf --resource LiberationSerif-Regular.ttf epubtest.txt
37
+
38
+ [NOTE]
39
+ ======
40
+ - Requires AsciiDoc 8.6.5 or better.
41
+ - The True Type Font mimetype had to be declared explicitly with the
42
+ `--resource .ttf=application/x-font-ttf` option because it wasn't
43
+ registered on my Linux system.
44
+ - In the above example the font file is in the same directory as the
45
+ AsciiDoc source file and is installed to the same relative location
46
+ in the EPUB archive OEBPS directory -- if your font file resides in
47
+ a different location you'll need to adjust the `--resource` option
48
+ accordingly (see the 'RESOURCES' section in the `a2x(1)` man page
49
+ for details).
50
+ - The URL value of the CSS 'src' property is set to the destination
51
+ font file relative the the CSS file.
52
+ - The `--resource` option allows you to inject any file (not just font
53
+ files) into the EPUB output document.
54
+ - Using the CSS '@font-face' rule is a complex subject and is outside
55
+ the scope of the FAQ.
56
+ - Many EPUB readers do not process embedded fonts.
57
+ ======
58
+
59
+
60
+ == What's the difference between + quoted text and ` quoted monospaced text?
61
+ `+` (plus) quoted text is implemented as an AsciiDoc 'quotes' whereas
62
+ +`+ (grave accent or backtick) quoted text is implemented as an
63
+ AsciiDoc 'inline literal' passthrough macro. The semantics are
64
+ different:
65
+
66
+ 1. Inline passthrough macros are processed before any other inline
67
+ substitutions e.g. all of the following line will be processed as a
68
+ single inline passthrough and rendered as monospaced text (which is
69
+ not the intended result):
70
+ +
71
+ --
72
+ `single quoted text' and `monospaced quoted text`
73
+
74
+ This line works as expected:
75
+
76
+ `single quoted text' and +monospaced quoted text+
77
+ --
78
+
79
+ 2. Backtick quoted text is rendered literally i.e. no substitutions
80
+ are performed on the enclosed text. Here are some examples that
81
+ would have to be escaped if plus quoting were used (<<X4,see
82
+ also>>):
83
+
84
+ The `++i` and `++j` auto-increments.
85
+ Paths `~/.vim` and `~/docs`.
86
+ The `__init__` method.
87
+ The `{id}` attribute.
88
+
89
+
90
+ == Why is the generated HTML title element text invalid?
91
+ Probably because your document title contains formatting that has
92
+ generated HTML title markup. You can resolve this by explicitly
93
+ defining the 'title' attribute in your document's header.
94
+
95
+
96
+ == AsciiDoc sometimes generates invalid output markup, why?
97
+ AsciiDoc is backend agnostic, the 'asciidoc' command has no knowledge
98
+ of the syntax or structure of the backend format that it generates.
99
+ Output document validation (syntactic and structural) should be
100
+ performed separately by external validation tools. For example,
101
+ AsciiDoc's 'a2x' toolchain command automatically performs validation
102
+ checks using 'xmllint'.
103
+
104
+
105
+ == The AsciiDoc toclevels attribute does not work with DocBook outputs, why?
106
+ DocBook has no provision for specifying table of contents levels but
107
+ you can set the TOC level further down the toolchain by passing the
108
+ DocBook XSL Stylesheets
109
+ http://docbook.sourceforge.net/release/xsl/current/doc/html/toc.section.depth.html[toc.section.depth]
110
+ parameter to 'dblatex' (using the `--param` option) or 'xsltproc'
111
+ (using the `--stringparam` option). For example to show only chapter
112
+ titles in the TOC of a 'book' document set 'toc.section.depth' to '0'.
113
+ Increment the 'toc.section.depth' value to show more sub-section
114
+ titles. If you are using 'a2x' you can set the options in the source
115
+ file, for example:
116
+
117
+ // a2x: --xsltproc-opts "--stringparam toc.section.depth 0"
118
+ // a2x: --dblatex-opts "--param toc.section.depth=0"
119
+
120
+ If the document is of type 'article' use the value '1' to show only
121
+ top level section titles in the TOC, use the value '2' for two levels
122
+ etc.
123
+
124
+
125
+ == How can I include chapter and section tables of contents?
126
+ DocBook outputs processed by DocBook XSL Stylesheets (either manually
127
+ or via 'a2x') can generate additional separate section and chapter
128
+ tables of contents using combinations of the
129
+ http://www.sagehill.net/docbookxsl/TOCcontrol.html[TOC parameters].
130
+ Here are some examples using combinations of the
131
+ `generate.section.toc.level` and `toc.section.depth` DocBook XSL
132
+ Stylesheets parameters:
133
+
134
+ [cols="2*l,4",width="90%",frame="topbot",options="header"]
135
+ |======================================================
136
+ |generate.section.toc.level |toc.section.depth |
137
+ |1 |
138
+ |Single level book chapter TOCs or article section TOCs
139
+
140
+ |1 | 3
141
+ |Article section TOCs with two levels
142
+
143
+ |1 | 2
144
+ |Book chapter TOCs with two levels
145
+ |======================================================
146
+
147
+
148
+ == How can I customize the appearance of XHTML and EPUB documents generated by a2x?
149
+ You can customize the appearance of an EPUB document with CSS. See
150
+ the link:publishing-ebooks-with-asciidoc.html[Sherlock Holmes eBook
151
+ example] on the AsciiDoc website.
152
+
153
+
154
+ == DocBook has many elements for document meta-data -- how can I use them from AsciiDoc?
155
+ The 'docinfo', 'docinfo1' and 'docinfo2' attributes allow you include
156
+ link:userguide.html#X97[document information files] containing DocBook
157
+ XML into the header of the output file.
158
+
159
+
160
+ == Do element titles automatically generate link captions?
161
+ If you go the DocBook route then yes -- just omit the caption from the
162
+ AsciiDoc 'xref' (`<<...>>`) macro. Both dblatex and DocBook XSL will
163
+ use the target element's title text. Examples:
164
+
165
+ [listing]
166
+ ..................................................................
167
+ [[X1]]
168
+ Section One
169
+ -----------
170
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas
171
+ ultrices justo porttitor augue. Vestibulum pretium. Donec porta
172
+
173
+ See also <<X3>> (this link displays the text 'A titled paragraph').
174
+
175
+ [id="X2",reftext="2nd section"]
176
+ Section Two
177
+ -----------
178
+ See also <<X1>> (this link displays the text 'Section One').
179
+
180
+ [[X3]]
181
+ .A titled paragraph
182
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
183
+
184
+ See also <<X2>> (this link displays the text '2nd section').
185
+ ..................................................................
186
+
187
+ The AsciiDoc 'reftext' attribute has been used to explicitly set the
188
+ link text to '2nd section' for 'Section Two'.
189
+
190
+
191
+ == Can I define my own table styles?
192
+ In addition to the built-in styles you can define your own. This
193
+ (simplified) example for HTML backends defines a table style called
194
+ 'red' which sets the background cell color to red. First put the
195
+ definition in a configuration file:
196
+
197
+ [listing]
198
+ .........................................
199
+ [tabledef-default]
200
+ red-style=tags="red"
201
+
202
+ [tabletags-red]
203
+ bodydata=<td style="background-color:red;">|</td>
204
+ .........................................
205
+
206
+ Now you can use the style name to style cells or columns (in this
207
+ example we use an unambiguous shortened abbreviation 'r'):
208
+
209
+ [listing]
210
+ .........................................
211
+ |==================================
212
+ |Normal cell r|Red cell
213
+ |==================================
214
+ .........................................
215
+
216
+
217
+ == How can I add highlighted editorial comments to an AsciiDoc document?
218
+ Both block and inline link:userguide.html#X25[comment lines] are
219
+ displayed on the output if the 'showcomments' attribute is defined.
220
+ Example:
221
+
222
+ [listing]
223
+ .........................................
224
+ :showcomments:
225
+ // A block comment line.
226
+
227
+ Qui in magna commodo, est labitur dolorum an. Est ne magna primis
228
+ // An inline comment line.
229
+ adolescens.
230
+ .........................................
231
+
232
+ Is rendered as:
233
+
234
+ :showcomments:
235
+ // A block comment line.
236
+
237
+ Qui in magna commodo, est labitur dolorum an. Est ne magna primis
238
+ // An inline comment line.
239
+ adolescens.
240
+
241
+ NOTE: link:userguide.html#X26[Comment blocks] are never displayed.
242
+
243
+
244
+ == What is the preferred file name extension for AsciiDoc files?
245
+ The `.txt` http://en.wikipedia.org/wiki/Text_file[text file] extension
246
+ is preferred, but it's just a convention and it's not enforced by the
247
+ software.
248
+
249
+ AsciiDoc source files are human readable
250
+ http://en.wikipedia.org/wiki/Plain_text[plain text] files which is
251
+ what the `.txt` extension is for. All text editors recognize and open
252
+ files with a `.txt` extension. The `.txt` extension is universally
253
+ recognized and unambiguous -- you are not left asking questions like
254
+ ``What on earth is this file with the funny extension?'', ``How do I
255
+ open it?'' and ``Is it safe to open?''.
256
+
257
+
258
+ == How can I generate numbered bibliographic entries?
259
+ If your outputs are DocBook generated then adding the following inline
260
+ macro to a custom configuration file will result in auto-incrementing
261
+ bibliography entry numbers (instead of displaying the bibliographic
262
+ identifiers):
263
+
264
+ [anchor3-inlinemacro]
265
+ <anchor id="{1}" xreflabel="[{counter:bibliography1}]"/>[{counter:bibliography2}]
266
+
267
+ This FAQ submitted by Bela Hausmann.
268
+
269
+
270
+ == How can I include lines of dashes inside a listing block?
271
+ A line of four or more dashes will be mistaken for the ListingBlock
272
+ terminator, one way round this problem is to use a LiteralBlock styled
273
+ as a listing block. For example:
274
+
275
+ [listing]
276
+ ...........................
277
+ Lorum ipsum
278
+ -----------
279
+ ...........................
280
+
281
+
282
+ == How can I customize PDF files generated by dblatex?
283
+
284
+ There are a number of dblatex XSL parameters that can be used to
285
+ customize PDF output. You can set them globally in the AsciiDoc
286
+ `./dblatex/asciidoc-dblatex.xsl` configuration file or you can also
287
+ pass them on the a2x(1) command-line. Here are some examples:
288
+
289
+ The
290
+ http://dblatex.sourceforge.net/doc/manual/latex.output.revhistory.html[latex.output.revhistory]
291
+ parameter is used to suppress the revision history:
292
+
293
+ a2x -f pdf --dblatex-opts "-P latex.output.revhistory=0" doc/article.txt
294
+
295
+ The
296
+ http://dblatex.sourceforge.net/doc/manual/doc.layout.html[doc.layout]
297
+ parameter is used to include the cover page and document body (i.e. excludes
298
+ table of contents and index), the
299
+ http://dblatex.sourceforge.net/doc/manual/doc.publisher.show.html[doc.publisher.show]
300
+ parameter is used to exclude the cover page logo:
301
+
302
+ a2x -f pdf --dblatex-opts " -P doc.layout=\"coverpage mainmatter\" -P doc.publisher.show=0" doc/article.txt
303
+
304
+ See also the
305
+ http://dblatex.sourceforge.net/doc/manual/sec-params.html[dblatex XSL
306
+ parameter reference].
307
+
308
+
309
+ == How can I add lists of figures and tables to PDFs created by dblatex?
310
+ Set the
311
+ http://dblatex.sourceforge.net/doc/sec-custom.html[doc.lot.show XSL
312
+ parameter] -- you can set it using the dblatex `--param` command-line
313
+ option, for example:
314
+
315
+ $ a2x --dblatex-opts="--param=doc.lot.show=figure,table" doc/article.txt
316
+
317
+
318
+ == How can I stop the document title being displayed?
319
+ You could simply omit the document title, but this will result in a
320
+ blank 'title' element in HTML outputs. If you want the HTML 'title'
321
+ element to contain the document title then define the 'notitle'
322
+ attribute (this will just suppress displaying the title), for example:
323
+
324
+ My document title
325
+ =================
326
+ :no title:
327
+
328
+
329
+ == Why am I having trouble getting nested macros to work?
330
+ The following example expands the 'image' inline macro, but the
331
+ expansion contains double-quote characters which confuses the ensuing
332
+ 'footnoteref' macro expansion:
333
+
334
+ footnoteref:["F1","A footnote, with an image image:smallnew.png[]"]
335
+
336
+ The solution is to use unquoted attribute values, replacing embedded
337
+ commas with the comma character entity (`&#44;`):
338
+
339
+ footnoteref:[F1,A footnote&#44; with an image image:smallnew.png[]]
340
+
341
+ Similarly, you can embed double-quote characters in unquoted attribute
342
+ values using the `&#34;` character entity.
343
+
344
+
345
+ == Why am I getting DocBook validation errors?
346
+ Not all valid AsciiDoc source generates valid DocBook, for example
347
+ 'special sections' (abstract, preface, colophon, dedication,
348
+ bibliography, glossary, appendix, index, synopsis) have different
349
+ DocBook schema's to normal document sections. For example, a paragraph
350
+ is illegal in a bibliography.
351
+
352
+ Don't forget if your document is a book you need to specify the
353
+ asciidoc `-d book` command option, if you don't an article DocBook
354
+ document will be generated, possibly containing book specific
355
+ sections, resulting in validation errors.
356
+
357
+
358
+ == How can I disable special section titles?
359
+ For example, you want to use 'References' as a normal section name but
360
+ AsciiDoc is auto-magically generating a DocBook 'bibliography'
361
+ section. All you need to do is explicitly specify the section template
362
+ name, for example:
363
+
364
+ [sect1]
365
+ References
366
+ ----------
367
+
368
+
369
+ == How can I insert XML processing instructions into output documents?
370
+ Use an inline or block passthrough macros. This example inserts
371
+ `<?dblatex bgcolor="#cceeff"?>` into the DocBook output generated by
372
+ AsciiDoc:
373
+
374
+ pass::[<?dblatex bgcolor="#cceeff"?>]
375
+
376
+ NOTE: XML processing instructions are specific to the application that
377
+ processes the XML (the previous `dblatex` processing instruction is
378
+ recognized by `dblatex(1)` when it processes the DocBook XML generated
379
+ by Asciidoc).
380
+
381
+
382
+ [[X4]]
383
+ == How do I prevent double-quoted text being mistaken for an inline literal?
384
+ Mixing doubled-quoted text with inline literal passthroughs can
385
+ produce undesired results, for example, all of the following line is
386
+ interpreted as an inline literal passthrough:
387
+
388
+ ``XXX'' `YYY`
389
+
390
+ In this case the solution is to use monospace quoting instead of the
391
+ inline literal:
392
+
393
+ ``XXX'' +YYY+
394
+
395
+ Use the +\pass:[]+ macro if it's necessary to suppress
396
+ substitutions in the monospaced text, for example:
397
+
398
+ ``XXX'' +pass:[don't `quote` me]+
399
+
400
+
401
+ == How can I generate a single HTML document file containing images and CSS styles?
402
+ With the advent of Internet Explorer 8 all major web browsers now
403
+ support the
404
+ http://en.wikipedia.org/wiki/Data:_URI_scheme[data URI scheme] for
405
+ embedded images. The AsciiDoc 'xhtml11' and 'html5' backends supports
406
+ the data URI scheme for embedded images and by default it embeds the
407
+ CSS stylesheet. For example the following command will generate a
408
+ single `article.html` file containing embedded images, admonition
409
+ icons and the CSS stylesheet:
410
+
411
+ $ asciidoc -a data-uri -a icons article.txt
412
+
413
+
414
+ == Are there any tools to help me understand what's going on inside AsciiDoc?
415
+
416
+ AsciiDoc has a built-in trace mechanism which is controlled by the
417
+ 'trace' attribute; there is also the `--verbose` command-line option.
418
+ These features are detailed in
419
+ http://www.methods.co.nz/asciidoc/userguide.html#X82[Appendix G of the
420
+ User Guide].
421
+
422
+
423
+ == One-liner ifdef::[]'s are disproportionately verbose can they shortened?
424
+
425
+ This is the response to a question posted on the AsciiDoc discussion
426
+ list, it illustrates a number of useful techniques. The question arose
427
+ because the source highlight filter language identifier for the C++
428
+ language is `c++` when generating PDFs via dblatex (LaTeX listings
429
+ package) or `cpp` when generating HTML (GNU source-highlight).
430
+
431
+ Using straight `ifdef::[]` block macros we have:
432
+
433
+ [listing]
434
+ .........................................
435
+ \ifdef::basebackend-docbook[]
436
+ [source,c++]
437
+ \endif::basebackend-docbook[]
438
+ \ifdef::basebackend-html[]
439
+ [source,cpp]
440
+ \endif::basebackend-html[]
441
+ -----------------------------------------
442
+ class FooParser {
443
+ public:
444
+ virtual void startDocument() = 0;
445
+ virtual void endDocument() = 0;
446
+ };
447
+ -----------------------------------------
448
+ .........................................
449
+
450
+
451
+ This can be shortened using the short form of the `ifdef::[]` macro:
452
+
453
+ [listing]
454
+ .........................................
455
+ \ifdef::basebackend-docbook[[source,c++]]
456
+ \ifdef::basebackend-html[[source,cpp]]
457
+ -----------------------------------------
458
+ class FooParser {
459
+ public:
460
+ virtual void startDocument() = 0;
461
+ virtual void endDocument() = 0;
462
+ };
463
+ -----------------------------------------
464
+ .........................................
465
+
466
+
467
+ Using a conditional attribute instead of the `ifdef::[]` macro is even
468
+ shorter:
469
+
470
+ [listing]
471
+ .........................................
472
+ [source,{basebackend@docbook:c++:cpp}]
473
+ -----------------------------------------
474
+ class FooParser {
475
+ public:
476
+ virtual void startDocument() = 0;
477
+ virtual void endDocument() = 0;
478
+ };
479
+ -----------------------------------------
480
+ .........................................
481
+
482
+
483
+ If you have a number of listings it makes sense to factor the
484
+ conditional attribute to a normal attribute:
485
+
486
+ [listing]
487
+ .........................................
488
+ :cpp: {basebackend@docbook:c++:cpp}
489
+
490
+ [source,{cpp}]
491
+ -----------------------------------------
492
+ class FooParser {
493
+ public:
494
+ virtual void startDocument() = 0;
495
+ virtual void endDocument() = 0;
496
+ };
497
+ -----------------------------------------
498
+ .........................................
499
+
500
+
501
+ Even shorter, set the default source highlight filter `language`
502
+ attribute so you don't have to specify it every time:
503
+
504
+ [listing]
505
+ .........................................
506
+ :language: {basebackend@docbook:c++:cpp}
507
+
508
+ [source]
509
+ -----------------------------------------
510
+ class FooParser {
511
+ public:
512
+ virtual void startDocument() = 0;
513
+ virtual void endDocument() = 0;
514
+ };
515
+ -----------------------------------------
516
+ .........................................
517
+
518
+
519
+ == Some of my inline passthroughs are not passed through, why?
520
+
521
+ Most likely the passthrough encloses another passthrough with a higher
522
+ precedence. For example trying to render this +\pass:[]+ with this
523
+ +\`\pass:[]`+ results in a blank string because the +\pass:[]+
524
+ passthrough evaluates first, instead use monospaced quoting and escape
525
+ the passthrough i.e. ++ \+\\pass:[]+ ++
526
+
527
+
528
+ == How can I place an anchor (link target) on a list item?
529
+
530
+ You can't use a 'BlockId' block element inside a list but you can use
531
+ the syntactically identical 'anchor' inline macro. For example:
532
+
533
+ ---------------------
534
+ one:: Item one.
535
+ [[X2]]two:: Item two.
536
+ three:: Item three.
537
+ ---------------------
538
+
539
+ This *will not* work:
540
+
541
+ ---------------------
542
+ one:: Item one.
543
+ [[X2]]
544
+ two:: Item two.
545
+ three:: Item three.
546
+ ---------------------
547
+
548
+
549
+ == How can I stop lists from nesting?
550
+
551
+ If you place two lists with different syntax hard up against each
552
+ other then the second list will be nested in the first. If you don't
553
+ want the second list to be nested separate them with a comment line
554
+ block macro. For example:
555
+
556
+ -------------------
557
+ 1. List 1.
558
+ 2. List 1.
559
+
560
+ //
561
+ a. List 2.
562
+ b. List 2.
563
+ -------------------
564
+
565
+
566
+ == Is it possible to include charts in AsciiDoc documents?
567
+
568
+ There are a number of programs available that generate presentation
569
+ charts from textual specification, for example
570
+ http://home.gna.org/pychart/[Pychart] is a library for writing chart
571
+ scripts in Python. Here's an example from the 'Pychart' documentation:
572
+
573
+ .barchart.py
574
+ ---------------------------------------------------------------------
575
+ #
576
+ # Example bar chart (from Pychart documentation http://home.gna.org/pychart/).
577
+ #
578
+ from pychart import *
579
+ theme.get_options()
580
+
581
+ data = [(10, 20, 30, 5), (20, 65, 33, 5), (30, 55, 30, 5), (40, 45, 51, 7),
582
+ (50, 25, 27, 3), (60, 75, 30, 5), (70, 80, 42, 5), (80, 62, 32, 5),
583
+ (90, 42, 39, 5), (100, 32, 39, 4)]
584
+
585
+ # The attribute y_coord=... tells that the Y axis values
586
+ # should be taken from samples.
587
+ # In this example, Y values will be [40,50,60,70,80].
588
+ ar = area.T(y_coord = category_coord.T(data[3:8], 0),
589
+ x_grid_style=line_style.gray50_dash1,
590
+ x_grid_interval=20, x_range = (0,100),
591
+ x_axis=axis.X(label="X label"),
592
+ y_axis=axis.Y(label="Y label"),
593
+ bg_style = fill_style.gray90,
594
+ border_line_style = line_style.default,
595
+ legend = legend.T(loc=(80,10)))
596
+
597
+ # Below call sets the default attributes for all bar plots.
598
+ chart_object.set_defaults(bar_plot.T, direction="horizontal", data=data)
599
+
600
+ # Attribute cluster=(0,3) tells that you are going to draw three bar
601
+ # plots side by side. The plot labeled "foo" will the leftmost (i.e.,
602
+ # 0th out of 3). Attribute hcol tells the column from which to
603
+ # retrive sample values from. It defaults to one.
604
+ ar.add_plot(bar_plot.T(label="foo", cluster=(0,3)))
605
+ ar.add_plot(bar_plot.T(label="bar", hcol=2, cluster=(1,3)))
606
+ ar.add_plot(bar_plot.T(label="baz", hcol=3, cluster=(2,3)))
607
+ ar.draw()
608
+ ---------------------------------------------------------------------
609
+
610
+ To execute the script and include the generated chart image in your
611
+ document add the following lines to the AsciiDoc source:
612
+
613
+ ---------------------------------------------------------------------
614
+ // Generate chart image file.
615
+ \sys2::[python "{indir}/barchart.py" --format=png --output="{outdir}/barchart.png" --scale=2]
616
+
617
+ // Display chart image file.
618
+ image::barchart.png[]
619
+ ---------------------------------------------------------------------
620
+
621
+ [NOTE]
622
+ =====================================================================
623
+ - The `barchart.py` script is located in the same directory as the
624
+ AsciiDoc source file (`{indir}`).
625
+ - The generated chart image file (`barchart.png`) is written to the
626
+ same directory as the output file (`{outdir}`).
627
+ =====================================================================
628
+
629
+
630
+ == How can I render indented paragraphs?
631
+
632
+ Styling is backend dependent:
633
+
634
+ [float]
635
+ ==== Create an indented paragraph style (xhtml11 and html5 backends)
636
+ . Define an 'indented' paragraph style, for example, by putting this
637
+ in a custom configuration file:
638
+ +
639
+ ---------------------------------------------------------------------
640
+ [paradef-default]
641
+ indented-style=template="indentedparagraph"
642
+
643
+ [indentedparagraph]
644
+ <div class="paragraph"{id? id="{id}"} style="text-indent:3em;">{title?<div class="title">{title}</div>}<p>
645
+ |
646
+ </p></div>
647
+ ---------------------------------------------------------------------
648
+
649
+ . Now apply the 'indented' style to normal paragraphs, for example:
650
+ +
651
+ ---------------------------------------------------------------------
652
+ [indented]
653
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas
654
+ ultrices justo porttitor augue. Vestibulum pretium. Donec porta
655
+ vestibulum mi. Aliquam pede. Aenean lobortis lorem et lacus. Sed
656
+ lacinia. Vivamus at lectus.
657
+ ---------------------------------------------------------------------
658
+
659
+ [float]
660
+ ==== Use the role attribute (xhtml11 and html5 backends)
661
+ . Add the following line to custom stylesheet:
662
+ +
663
+ ---------------------------------------------------------------------
664
+ div.paragraph.indented p {text-indent: 3em;}
665
+ ---------------------------------------------------------------------
666
+
667
+ . Apply the 'role' attribute to indented paragraphs, for example:
668
+ +
669
+ ---------------------------------------------------------------------
670
+ [role="indented"]
671
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas
672
+ ultrices justo porttitor augue. Vestibulum pretium. Donec porta
673
+ vestibulum mi. Aliquam pede. Aenean lobortis lorem et lacus. Sed
674
+ lacinia. Vivamus at lectus.
675
+ ---------------------------------------------------------------------
676
+
677
+ . Include the custom stylesheet by setting the 'stylesheet' attribute
678
+ (either from the command-line or with an attribute entry in the
679
+ document header).
680
+
681
+ [float]
682
+ ==== Use the role attribute (docbook backend)
683
+ . Add the following line to the distributed `docbook-xsl.css`
684
+ stylesheet or include it in a custom stylesheet:
685
+ +
686
+ ---------------------------------------------------------------------
687
+ p.indented {text-indent: 3em;}
688
+ ---------------------------------------------------------------------
689
+
690
+ . Apply the 'role' attribute to indented paragraphs, for example:
691
+ +
692
+ ---------------------------------------------------------------------
693
+ [role="indented"]
694
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas
695
+ ultrices justo porttitor augue. Vestibulum pretium. Donec porta
696
+ vestibulum mi. Aliquam pede. Aenean lobortis lorem et lacus. Sed
697
+ lacinia. Vivamus at lectus.
698
+ ---------------------------------------------------------------------
699
+
700
+ . If you have included the custom CSS in a separate stylesheet you
701
+ will need to specify the stylesheet file name (along with the
702
+ default `docbook-xsl.css` stylesheet file name) with the
703
+ `html.stylesheet` XSL parameter. If you are using 'a2x(1)' use the
704
+ `--stylesheet` option (it sets the `html.stylesheet` XSL parameter),
705
+ for example: `--stylesheet "docbook-xsl.css mycss.css"`.
706
+
707
+ NOTE: This applies to HTML outputs not PDF. To achieve the same
708
+ results with PDF outputs you will need to customize the DocBook XSL
709
+ Stylesheets to render indented paragraphs from DocBook `simpara`
710
+ elements containing the the `role="indented"` attribute.
711
+
712
+
713
+ == Is there a way to set default table grid and frame attributes?
714
+
715
+ You can set the 'grid' and 'frame' attributes globally in your
716
+ document header with Attribute Entries or from the command-line using
717
+ the `--attribute` option. In the following example tables that don't
718
+ explicitly set the 'grid' and 'frame' values will default to 'all' and
719
+ 'topbot' respectively:
720
+
721
+ ---------------------------------------------------------------------
722
+ :grid: all
723
+ :frame: topbot
724
+ ---------------------------------------------------------------------
725
+
726
+ TIP: This technique can be applied to any block element attribute
727
+ (just beware of possible ambiguity, for example, table and image
728
+ blocks both have a 'width' attribute).
729
+
730
+
731
+ == How can I place a backslash character in front of an attribute reference without escaping the reference?
732
+
733
+ Use the predefined `{backslash}` attribute reference instead of an
734
+ actual backslash, for example if the `{projectname}` attribute has
735
+ the value `foobar` then:
736
+
737
+ d:\data{backslash}{projectname}
738
+
739
+ would be rendered as:
740
+
741
+ d:\data\foobar
742
+
743
+ == How can I escape AsciiDoc markup?
744
+
745
+ Most AsciiDoc inline elements can be suppressed by preceding them with
746
+ a backslash character. These elements include:
747
+
748
+ - Attribute references.
749
+ - Text formatting.
750
+ - Quoting,
751
+ - Macros.
752
+ - Replacements.
753
+ - Special words.
754
+ - Table cell separators.
755
+
756
+ But there are exceptions -- see the next question.
757
+
758
+
759
+ == Some elements can't be escaped with a single backslash
760
+
761
+ There are a number of exceptions to the usual single backslash rule
762
+ -- mostly relating to URL macros that have two syntaxes or quoting
763
+ ambiguity. Here are some non-standard escape examples:
764
+
765
+ [cols="l,v",width="40%",frame="topbot",options="header"]
766
+ |========================================
767
+ |AsciiDoc | Renders
768
+
769
+ 2*|
770
+ \srackham@methods.co.nz
771
+ <\srackham@methods.co.nz>
772
+ \mailto:[\srackham@methods.co.nz]
773
+
774
+ 2*|
775
+ \http://www.foo1.co.nz
776
+ \\http://www.foobar.com[]
777
+ \\http://www.foobar.com[Foobar Limited]
778
+
779
+ 2*|
780
+ A C\++ Library for C++
781
+ \\``double-quotes''
782
+ \*\*F**ile Open\...
783
+ |========================================
784
+
785
+ The source of this problem is ambiguity across substitution types --
786
+ the first match unescapes allowing the second to substitute. A
787
+ work-around for difficult cases is to side-step the problem using the
788
+ +\pass:[]+ passthrough inline macro.
789
+
790
+ NOTE: Escaping is unnecessary inside 'inline literal passthroughs'
791
+ (backtick quoted text).
792
+
793
+
794
+ == How can I escape a list?
795
+ Here's how to handle situations where the first line of a paragraph is
796
+ mistaken for a list item.
797
+
798
+ [float]
799
+ ==== Numbered and bulleted lists
800
+ Precede the bullet or index of the first list item with an `{empty}`
801
+ attribute, for example:
802
+
803
+ {empty}- Qui in magna commodo est labitur dolorum an. Est ne magna
804
+ primis adolescens.
805
+
806
+ The predefined `{empty}` attribute is replaced by an empty string and
807
+ ensures the first line is not mistaken for a bulleted list item.
808
+
809
+ [float]
810
+ ==== Labeled lists
811
+ Two colons or semicolons in a paragraph may be confused with a labeled
812
+ list entry. Use the predefined `{two-colons}` and `{two-semicolons}`
813
+ attributes to suppress this behavior, for example:
814
+
815
+ Qui in magna commodo{two-colons} est labitur dolorum an. Est ne
816
+ magna primis adolescens.
817
+
818
+ Will be rendered as:
819
+
820
+ Qui in magna commodo{two-colons} est labitur dolorum an. Est ne
821
+ magna primis adolescens.
822
+
823
+
824
+ == How can I set default list and tables styles?
825
+
826
+ You can set the element's 'style' entry in a global or custom
827
+ configuration file.
828
+
829
+ This example this will horizontally style all labeled lists that don't
830
+ have an explicit style attribute:
831
+
832
+ ----------------------------------
833
+ [listdef-labeled]
834
+ style=horizontal
835
+
836
+ [listdef-labeled2]
837
+ style=horizontal
838
+ ----------------------------------
839
+
840
+ This example will put a top and bottom border on all tables that don't
841
+ already have an explicit style attribute:
842
+
843
+ ----------------------------------
844
+ [tabledef-default]
845
+ style=topbot
846
+ topbot-style=frame="topbot"
847
+ ----------------------------------
848
+
849
+ Alternatively you can set the configuration entries from inside your
850
+ document, the above examples are equivalent to:
851
+
852
+ ----------------------------------
853
+ :listdef-labeled.style: horizontal
854
+ :listdef-labeled2.style: horizontal
855
+
856
+ :tabledef-default.topbot-style: frame="topbot"
857
+ :tabledef-default.style: topbot
858
+ ----------------------------------
859
+
860
+
861
+ == Why do I get a filter non-zero exit code error?
862
+
863
+ An error was returned when AsciiDoc tried to execute an external
864
+ filter command. The most common reason for this is that the filter
865
+ command could not be found by the command shell. To figure out what
866
+ the problem is run AsciiDoc with the `--verbose` option to determine
867
+ the command that is failing and then try to run the command manually
868
+ from the command-line.
869
+
870
+
871
+ == Are there any DocBook viewers?
872
+
873
+ http://live.gnome.org/Yelp[Yelp], the GNOME help viewer, does a
874
+ creditable job of displaying DocBook XML files directly.
875
+
876
+
877
+ == Can you create ODF documents using AsciiDoc?
878
+
879
+ The easiest and highest fidelity method I've seen is to generate
880
+ HTML from AsciiDoc then paste it from your browser (we use Firefox)
881
+ into OpenOffice Writer.
882
+
883
+ - I found that that there is better fidelity pasting HTML generated by
884
+ the 'html4' backend instead of the default 'xhtml11' backend.
885
+ - Don't paste AsciiDoc tables of contents, OpenOffice Writer (I was
886
+ using version 2.3) hangs when saving. This may be something to do
887
+ with the embedded JavaScript but I haven't looked closely at it, I
888
+ may even be wrong about this.
889
+
890
+ This tip was contributed by Bernard Amade.
891
+
892
+
893
+ == How can I suppress cell separators in included table data files?
894
+
895
+ Use the `{include:}` system attribute instead of the `include::[]`
896
+ macro (the former is not expanded until after the table data has been
897
+ parsed into cells, whereas the latter is included before the table is
898
+ processed.
899
+
900
+
901
+ == How can I preserve paragraph line boundaries?
902
+
903
+ Apply the The 'verse' paragraph style, the rendered text preserves
904
+ line boundaries and is useful for lyrics and poems. For example:
905
+
906
+ ---------------------------------------------------------------------
907
+ [verse]
908
+ Consul *necessitatibus* per id,
909
+ consetetur, eu pro everti postulant
910
+ homero verear ea mea, qui.
911
+ ---------------------------------------------------------------------
912
+
913
+ Alternatively, if you are generating PDF files, you can use line
914
+ breaks. For example:
915
+
916
+ ---------------------------------------------------------------------
917
+ Consul *necessitatibus* per id, +
918
+ consetetur, eu pro everti postulant +
919
+ homero verear ea mea, qui.
920
+ ---------------------------------------------------------------------
921
+
922
+
923
+ == How can I include non-breaking space characters?
924
+
925
+ Use the non-breaking space character entity reference `&#160;` (see
926
+ the next question). You could also use the predefined `{nbsp}`
927
+ attribute reference.
928
+
929
+
930
+ == Can I include HTML and XML character entity references in my document?
931
+
932
+ Yes, just enter the reference in your document. For example `&#946;`
933
+ will print a Greek small beta character &#946;
934
+
935
+
936
+ [[X1]]
937
+ == How do I include spaces in URLs?
938
+
939
+ URL inline macro targets (addresses) cannot contain white space
940
+ characters. If you need spaces encode them as `%20`. For example:
941
+
942
+ image:large%20image.png[]
943
+ http://www.foo.bar.com/an%20example%20document.html
944
+
945
+
946
+ == How can I get AsciiDoc to assign the correct DocBook language attribute?
947
+
948
+ Set the AsciiDoc 'lang' attribute to the appropriate language code.
949
+ For example:
950
+
951
+ $ a2x -a lang=es doc/article.txt
952
+
953
+ This will ensure that downstream DocBook processing will generate the
954
+ correct language specific document headings (things like table of
955
+ contents, revision history, figure and table captions, admonition
956
+ captions).
957
+
958
+
959
+ == How can I turn off table and image title numbering?
960
+ For HTML outputs set the 'caption' attribute to an empty string,
961
+ either globally:
962
+
963
+ -------------------------
964
+ :caption:
965
+ -------------------------
966
+
967
+ or on an element by element basis, for example:
968
+
969
+ -------------------------
970
+ .Tiger
971
+ [caption=""]
972
+ image::images/tiger.png[]
973
+ -------------------------
974
+
975
+
976
+ == How can I assign multiple author names?
977
+
978
+ A quick way to do this is put both authors in a single first name, for
979
+ example:
980
+
981
+ ---------------------------------------
982
+ My Document
983
+ ===========
984
+ :Author: Bill_and_Ben_the_Flowerpot_Men
985
+ :Author Initials: BB & BC
986
+ ---------------------------------------
987
+
988
+ asciidoc(1) replaces the underscores with spaces.
989
+
990
+ If you are generating DocBook then a more flexible approach is to
991
+ create a 'docinfo' file containing a DocBook 'authorgroup' element
992
+ (search the 'User Guide' for 'docinfo' for more details).
993
+
994
+
995
+ == How can I selectively disable a quoted text substitution?
996
+
997
+ Omitting the tag name will disable quoting. For example, if you don't
998
+ want superscripts or subscripts then put the following in a custom
999
+ configuration file or edit the global `asciidoc.conf` configuration
1000
+ file:
1001
+
1002
+ -------------------
1003
+ [quotes]
1004
+ ^=
1005
+ ~=
1006
+ -------------------
1007
+
1008
+ Alternatively you can set the configuration entries from within your
1009
+ document, the above examples are equivalent to:
1010
+
1011
+ -------------------
1012
+ :quotes.^:
1013
+ :quotes.~:
1014
+ -------------------
1015
+
1016
+
1017
+ == How can I customize the \{localdate} format?
1018
+
1019
+ The default format for the `{localdate}` attribute is the ISO 8601
1020
+ `yyyy-mm-dd` format. You can change this format by explicitly setting
1021
+ the `{localdate}` attribute. For example by setting it using the
1022
+ asciidoc(1) `-a` command-line option:
1023
+
1024
+ $ asciidoc -a localdate=`date +%d-%m-%Y` mydoc.txt
1025
+
1026
+ You could also set it by adding an Attribute Entry to your source
1027
+ document, for example:
1028
+
1029
+ :localdate: {sys: date +%Y-%m-%d}
1030
+
1031
+
1032
+ == Where can I find examples of commands used to build output documents?
1033
+
1034
+ The User Guide has some. You could also look at `./doc/main.aap` and
1035
+ `./examples/website/main.aap` in the AsciiDoc distribution, they have
1036
+ all the commands used to build the AsciiDoc documentation and the
1037
+ AsciiDoc website (even if you don't use A-A-P you'll still find it
1038
+ useful).
1039
+
1040
+
1041
+ == Why have you used the DocBook <simpara> element instead of <para>?
1042
+
1043
+ `<simpara>` is really the same as `<para>` except it can't contain
1044
+ block elements -- this matches, more closely, the AsciiDoc paragraph
1045
+ semantics.
1046
+
1047
+
1048
+ == How can I format text inside a listing block?
1049
+
1050
+ By default only 'specialcharacters' and 'callouts' are substituted in
1051
+ listing blocks; you can add quotes substitutions by explicitly setting
1052
+ the block 'subs' attribute, for example:
1053
+
1054
+ [listing]
1055
+ ..........................................
1056
+ [subs="quotes"]
1057
+ ------------------------------------------
1058
+ $ ls *-al*
1059
+ ------------------------------------------
1060
+ ..........................................
1061
+
1062
+ The `-al` will rendered bold. Note that:
1063
+
1064
+ - You would need to explicitly escape text you didn't want quoted.
1065
+ - Don't do this in source code listing blocks because it modifies the
1066
+ source code which confuses the syntax highlighter.
1067
+ - This only works if your DocBook processor recognizes DocBook
1068
+ `<emphasis>` elements inside `<screen>` elements.
1069
+
1070
+ Alternative, if the lines are contiguous, you could use the 'literal'
1071
+ paragraph style:
1072
+
1073
+ ------------------------------------------
1074
+ ["literal",subs="quotes"]
1075
+ $ ls *-al*
1076
+ ------------------------------------------
1077
+
1078
+
1079
+ == Why doesn't the include1::[] macro work?
1080
+
1081
+ Internally the `include1` macro is translated to the `include1` system
1082
+ attribute which means it must be evaluated in a region where attribute
1083
+ substitution is enabled. `include1` won't work, for example, in a
1084
+ ListingBlock (unless attribute substitution is enabled). `include1`
1085
+ is intended for use in configuration files, use the `include` macro
1086
+ and set the attribute `depth=1` instead, for example:
1087
+
1088
+ [listing]
1089
+ ................................................
1090
+ ------------------------------------------------
1091
+ \include::blogpost_media_processing.txt[depth=1]
1092
+ ------------------------------------------------
1093
+ ................................................
1094
+
1095
+
1096
+ == How can I make the mailto macro work with multiple email addresses?
1097
+
1098
+ For the AsciiDoc 'mailto' macro to work with multiple email addresses
1099
+ (as per RFC2368) you need to URL encode the '@' characters (replace
1100
+ them with '%40'), if you don't the individual addresses will be
1101
+ rendered as separate links. You also need to <<X1,replace spaces with
1102
+ '%20'>>.
1103
+
1104
+ For example, the following call won't work:
1105
+
1106
+ mailto:jb@foobar.com,jd@acme.co.nz?subject=New foofoo release[New foofoo release]
1107
+
1108
+ Use this instead:
1109
+
1110
+ mailto:jb%40foobar.com,jd%40acme.co.nz?subject=New%20foofoo%20release[New foofoo release]
1111
+
1112
+
1113
+ == How can a replacement have a trailing backslash?
1114
+ Quote the entry name -- this nonsensical example replaces `x\` with
1115
+ `y`:
1116
+
1117
+ "x\\"=y
1118
+
1119
+ If quoting were omitted the equals character (separating the
1120
+ entry name `x` from the value `y`) would be escaped.
1121
+
1122
+