git-scribe 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. data/.gitignore +1 -0
  2. data/Rakefile +31 -0
  3. data/SPEC.asciidoc +126 -0
  4. data/TODO.txt +29 -0
  5. data/bin/git-scribe +2 -1
  6. data/docbook-xsl/.CatalogManager.properties.example +61 -0
  7. data/docbook-xsl/.urilist +1 -0
  8. data/git-scribe.gemspec +32 -0
  9. data/lib/git-scribe.rb +21 -315
  10. data/lib/git-scribe/check.rb +60 -0
  11. data/lib/git-scribe/cli.rb +84 -0
  12. data/lib/git-scribe/generate.rb +222 -0
  13. data/lib/git-scribe/init.rb +16 -0
  14. data/lib/git-scribe/version.rb +3 -0
  15. data/template/.gitignore +1 -0
  16. data/template/.gitscribe +5 -0
  17. data/test/check_test.rb +12 -0
  18. data/test/gen_test.rb +78 -0
  19. data/test/init_test.rb +36 -0
  20. data/test/test_helper.rb +44 -0
  21. metadata +49 -161
  22. data/example/book/big.asc +0 -5604
  23. data/example/book/holmes.asc +0 -12983
  24. data/example/output/META-INF/container.xml +0 -6
  25. data/example/output/OEBPS/ar01s02.html +0 -15
  26. data/example/output/OEBPS/ar01s03.html +0 -3
  27. data/example/output/OEBPS/content.opf +0 -21
  28. data/example/output/OEBPS/index.html +0 -5
  29. data/example/output/OEBPS/toc.ncx +0 -37
  30. data/example/output/a_case_of_identity.html +0 -725
  31. data/example/output/a_example_appendix.html +0 -63
  32. data/example/output/a_migration_notes.html +0 -95
  33. data/example/output/apa.html +0 -20
  34. data/example/output/apb.html +0 -6
  35. data/example/output/apc.html +0 -24
  36. data/example/output/apd.html +0 -30
  37. data/example/output/ape.html +0 -26
  38. data/example/output/apf.html +0 -9
  39. data/example/output/apg.html +0 -42
  40. data/example/output/aph.html +0 -89
  41. data/example/output/ar01s02.html +0 -12
  42. data/example/output/ar01s03.html +0 -34
  43. data/example/output/ar01s04.html +0 -77
  44. data/example/output/ar01s05.html +0 -272
  45. data/example/output/ar01s06.html +0 -35
  46. data/example/output/ar01s07.html +0 -105
  47. data/example/output/ar01s08.html +0 -33
  48. data/example/output/ar01s09.html +0 -12
  49. data/example/output/ar01s10.html +0 -14
  50. data/example/output/ar01s11.html +0 -34
  51. data/example/output/ar01s12.html +0 -63
  52. data/example/output/ar01s13.html +0 -156
  53. data/example/output/ar01s14.html +0 -330
  54. data/example/output/ar01s15.html +0 -22
  55. data/example/output/ar01s16.html +0 -27
  56. data/example/output/ar01s17.html +0 -94
  57. data/example/output/ar01s18.html +0 -359
  58. data/example/output/ar01s19.html +0 -373
  59. data/example/output/ar01s20.html +0 -27
  60. data/example/output/ar01s21.html +0 -33
  61. data/example/output/ar01s22.html +0 -351
  62. data/example/output/ar01s23.html +0 -21
  63. data/example/output/ar01s24.html +0 -69
  64. data/example/output/ar01s25.html +0 -60
  65. data/example/output/ar01s26.html +0 -217
  66. data/example/output/ar01s27.html +0 -88
  67. data/example/output/ar01s28.html +0 -237
  68. data/example/output/ar01s29.html +0 -68
  69. data/example/output/ar01s30.html +0 -154
  70. data/example/output/ar01s31.html +0 -6
  71. data/example/output/ar01s32.html +0 -22
  72. data/example/output/ar01s33.html +0 -209
  73. data/example/output/asciidoc_backends.html +0 -190
  74. data/example/output/asciidoc_document_types.html +0 -131
  75. data/example/output/attribute_entries.html +0 -185
  76. data/example/output/attribute_lists.html +0 -157
  77. data/example/output/attribute_references.html +0 -414
  78. data/example/output/attributelist_element.html +0 -143
  79. data/example/output/b_packager_notes.html +0 -68
  80. data/example/output/bi01.html +0 -18
  81. data/example/output/big.asc +0 -5604
  82. data/example/output/block_element_definitions.html +0 -448
  83. data/example/output/block_titles.html +0 -83
  84. data/example/output/blockid_element.html +0 -80
  85. data/example/output/book.asc +0 -5604
  86. data/example/output/book.epub +0 -0
  87. data/example/output/book.fo +0 -3788
  88. data/example/output/book.html +0 -8793
  89. data/example/output/book.xml +0 -8265
  90. data/example/output/c_asciidoc_safe_mode.html +0 -105
  91. data/example/output/callouts.html +0 -214
  92. data/example/output/catalog +0 -10
  93. data/example/output/colophon.html +0 -397
  94. data/example/output/configuration_files.html +0 -672
  95. data/example/output/converting_docbook_to_other_file_formats.html +0 -324
  96. data/example/output/d_using_asciidoc_with_non-english_languages.html +0 -107
  97. data/example/output/delimited_blocks.html +0 -455
  98. data/example/output/document_attributes.html +0 -95
  99. data/example/output/document_processing.html +0 -116
  100. data/example/output/document_structure.html +0 -493
  101. data/example/output/e_vim_syntax_highlighter.html +0 -111
  102. data/example/output/example_bibliography.html +0 -82
  103. data/example/output/example_colophon.html +0 -58
  104. data/example/output/example_glossary.html +0 -73
  105. data/example/output/example_index.html +0 -108
  106. data/example/output/f_attribute_options.html +0 -129
  107. data/example/output/filters.html +0 -179
  108. data/example/output/footnotes.html +0 -103
  109. data/example/output/g_diagnostics.html +0 -148
  110. data/example/output/generating_plain_text_files.html +0 -68
  111. data/example/output/getting_started.html +0 -87
  112. data/example/output/glossary.html +0 -95
  113. data/example/output/go01.html +0 -24
  114. data/example/output/h_backend_attributes.html +0 -308
  115. data/example/output/help_commands.html +0 -96
  116. data/example/output/holmes.asc +0 -12983
  117. data/example/output/image/octocat_professor.png +0 -0
  118. data/example/output/include/hello.c +0 -10
  119. data/example/output/index.html +0 -656
  120. data/example/output/indexes.html +0 -104
  121. data/example/output/intrinsic_attributes.html +0 -165
  122. data/example/output/ix01.html +0 -3
  123. data/example/output/lists.html +0 -666
  124. data/example/output/macros.html +0 -737
  125. data/example/output/manpage_documents.html +0 -124
  126. data/example/output/master.css +0 -281
  127. data/example/output/mathematical_formulas.html +0 -125
  128. data/example/output/page.html +0 -60
  129. data/example/output/paragraphs.html +0 -192
  130. data/example/output/pr01.html +0 -3
  131. data/example/output/source_code_highlighting.html +0 -59
  132. data/example/output/stylesheets/handbookish-quirks.css +0 -0
  133. data/example/output/stylesheets/handbookish.css +0 -233
  134. data/example/output/tables.html +0 -797
  135. data/example/output/text_formatting.html +0 -273
  136. data/example/output/the_adventure_of_the_beryl_coronet.html +0 -968
  137. data/example/output/the_adventure_of_the_blue_carbuncle.html +0 -825
  138. data/example/output/the_adventure_of_the_copper_beeches.html +0 -998
  139. data/example/output/the_adventure_of_the_engineer_s_thumb.html +0 -851
  140. data/example/output/the_adventure_of_the_noble_bachelor.html +0 -861
  141. data/example/output/the_adventure_of_the_speckled_band.html +0 -1015
  142. data/example/output/the_boscombe_valley_mystery.html +0 -974
  143. data/example/output/the_first_chapter.html +0 -110
  144. data/example/output/the_five_orange_pips.html +0 -776
  145. data/example/output/the_man_with_the_twisted_lip.html +0 -946
  146. data/example/output/the_red-headed_league.html +0 -950
  147. data/example/output/the_second_chapter.html +0 -95
  148. data/example/output/the_third_chapter.html +0 -58
  149. data/example/output/tips_and_tricks.html +0 -452
  150. data/example/output/title.html +0 -120
  151. data/example/output/titles.html +0 -126
@@ -1,672 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
- <link rel="stylesheet" href="master.css" type="text/css" />
6
- <title>Configuration Files</title>
7
- </head>
8
-
9
- <body>
10
- <div class="nav" id="navheader">
11
- <table width="100%">
12
- <tr><td width="33%" align="left">
13
-
14
- <a href="mathematical_formulas.html">Prev</a><br/>
15
- Mathematical Formulas
16
-
17
- </td><td width="33%" align="center">
18
-
19
- <a href="index.html">Home</a><br/>
20
- <strong>AsciiDoc User Guide</strong>
21
-
22
- </td><td width="33%" align="right">
23
-
24
- <a href="document_attributes.html">Next</a><br/>
25
- Document Attributes
26
-
27
- </td></tr>
28
- </table>
29
- </div>
30
-
31
- <hr/>
32
-
33
- <div class="content">
34
- <div class="section" lang="en" xml:lang="en">
35
- <div class="titlepage"><div><div><h2 class="title" style="clear: both">
36
- <a id="X7"></a>Configuration Files</h2></div></div></div>
37
- <p>AsciiDoc source file syntax and output file markup is largely
38
- controlled by a set of cascading, text based, configuration files. At
39
- runtime The AsciiDoc default configuration files are combined with
40
- optional user and document specific configuration files.</p>
41
- <div class="section" lang="en" xml:lang="en">
42
- <div class="titlepage"><div><div><h3 class="title">
43
- <a id="_configuration_file_format"></a>Configuration File Format</h3></div></div></div>
44
- <p>Configuration files contain named sections. Each section begins with a
45
- section name in square brackets []. The section body consists of the
46
- lines of text between adjacent section headings.</p>
47
- <div class="itemizedlist"><ul type="disc">
48
- <li>
49
- Section names consist of one or more alphanumeric, underscore or
50
- dash characters and cannot begin or end with a dash.
51
- </li>
52
- <li>
53
- Lines starting with a hash character "#" are treated as comments and
54
- ignored.
55
- </li>
56
- <li>
57
- Same named sections and section entries override previously loaded
58
- sections and section entries (this is sometimes referred to as
59
- <span class="emphasis"><em>cascading</em></span>). Consequently, downstream configuration files need
60
- only contain those sections and section entries that need to be
61
- overridden.
62
- </li>
63
- </ul></div>
64
- <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
65
- <h3 class="title">Tip</h3>
66
- <p>When creating custom configuration files you only need to include
67
- the sections and entries that differ from the default configuration.</p>
68
- </div>
69
- <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
70
- <h3 class="title">Tip</h3>
71
- <p>The best way to learn about configuration files is to read the
72
- default configuration files in the AsciiDoc distribution in
73
- conjunction with asciidoc(1) output files. You can view configuration
74
- file load sequence by turning on the asciidoc(1) <code class="literal">-v</code> (<code class="literal">--verbose</code>)
75
- command-line option.</p>
76
- </div>
77
- <p>AsciiDoc reserves the following section names for specific purposes:</p>
78
- <div class="variablelist"><dl>
79
- <dt><span class="term">
80
- miscellaneous
81
- </span></dt>
82
- <dd>
83
- Configuration options that don’t belong anywhere else.
84
- </dd>
85
- <dt><span class="term">
86
- attributes
87
- </span></dt>
88
- <dd>
89
- Attribute name/value entries.
90
- </dd>
91
- <dt><span class="term">
92
- specialcharacters
93
- </span></dt>
94
- <dd>
95
- Special characters reserved by the backend markup.
96
- </dd>
97
- <dt><span class="term">
98
- tags
99
- </span></dt>
100
- <dd>
101
- Backend markup tags.
102
- </dd>
103
- <dt><span class="term">
104
- quotes
105
- </span></dt>
106
- <dd>
107
- Definitions for quoted inline character formatting.
108
- </dd>
109
- <dt><span class="term">
110
- specialwords
111
- </span></dt>
112
- <dd>
113
- Lists of words and phrases singled out for special markup.
114
- </dd>
115
- <dt><span class="term">
116
- replacements, replacements2
117
- </span></dt>
118
- <dd>
119
- Find and replace substitution definitions.
120
- </dd>
121
- <dt><span class="term">
122
- specialsections
123
- </span></dt>
124
- <dd>
125
- Used to single out special section names for specific markup.
126
- </dd>
127
- <dt><span class="term">
128
- macros
129
- </span></dt>
130
- <dd>
131
- Macro syntax definitions.
132
- </dd>
133
- <dt><span class="term">
134
- titles
135
- </span></dt>
136
- <dd>
137
- Heading, section and block title definitions.
138
- </dd>
139
- <dt><span class="term">
140
- paradef-*
141
- </span></dt>
142
- <dd>
143
- Paragraph element definitions.
144
- </dd>
145
- <dt><span class="term">
146
- blockdef-*
147
- </span></dt>
148
- <dd>
149
- DelimitedBlock element definitions.
150
- </dd>
151
- <dt><span class="term">
152
- listdef-*
153
- </span></dt>
154
- <dd>
155
- List element definitions.
156
- </dd>
157
- <dt><span class="term">
158
- listtags-*
159
- </span></dt>
160
- <dd>
161
- List element tag definitions.
162
- </dd>
163
- <dt><span class="term">
164
- tabledef-*
165
- </span></dt>
166
- <dd>
167
- Table element definitions.
168
- </dd>
169
- <dt><span class="term">
170
- tabletags-*
171
- </span></dt>
172
- <dd>
173
- Table element tag definitions.
174
- </dd>
175
- </dl></div>
176
- <p>Each line of text in these sections is a <span class="emphasis"><em>section entry</em></span>. Section
177
- entries share the following syntax:</p>
178
- <div class="variablelist"><dl>
179
- <dt><span class="term">
180
- name=value
181
- </span></dt>
182
- <dd>
183
- The entry value is set to value.
184
- </dd>
185
- <dt><span class="term">
186
- name=
187
- </span></dt>
188
- <dd>
189
- The entry value is set to a zero length string.
190
- </dd>
191
- <dt><span class="term">
192
- name!
193
- </span></dt>
194
- <dd>
195
- The entry is undefined (deleted from the configuration). This
196
- syntax only applies to <span class="emphasis"><em>attributes</em></span> and <span class="emphasis"><em>miscellaneous</em></span>
197
- sections.
198
- </dd>
199
- </dl></div>
200
- <div class="itemizedlist">
201
- <p class="title"><b>Section entry behavior</b></p>
202
- <ul type="disc">
203
- <li>
204
- All equals characters inside the <code class="literal">name</code> must be escaped with a
205
- backslash character.
206
- </li>
207
- <li>
208
- <code class="literal">name</code> and <code class="literal">value</code> are stripped of leading and trailing white space.
209
- </li>
210
- <li>
211
- Attribute names, tag entry names and markup template section names
212
- consist of one or more alphanumeric, underscore or dash characters.
213
- Names should not begin or end with a dash.
214
- </li>
215
- <li>
216
- A blank configuration file section (one without any entries) deletes
217
- any preceding section with the same name (applies to non-markup
218
- template sections).
219
- </li>
220
- </ul>
221
- </div>
222
- </div>
223
- <div class="section" lang="en" xml:lang="en">
224
- <div class="titlepage"><div><div><h3 class="title">
225
- <a id="_miscellaneous_section"></a>Miscellaneous section</h3></div></div></div>
226
- <p>The optional <code class="literal">[miscellaneous]</code> section specifies the following
227
- <code class="literal">name=value</code> options:</p>
228
- <div class="variablelist"><dl>
229
- <dt><span class="term">
230
- newline
231
- </span></dt>
232
- <dd>
233
- <p>
234
- Output file line termination characters. Can include any
235
- valid Python string escape sequences. The default value is
236
- <code class="literal">\r\n</code> (carriage return, line feed). Should not be quoted or
237
- contain explicit spaces (use <code class="literal">\x20</code> instead). For example:
238
- </p>
239
- <pre class="literallayout">$ asciidoc -a 'newline=\n' -b docbook mydoc.txt</pre>
240
- </dd>
241
- <dt><span class="term">
242
- outfilesuffix
243
- </span></dt>
244
- <dd>
245
- The default extension for the output file, for example
246
- <code class="literal">outfilesuffix=.html</code>. Defaults to backend name.
247
- </dd>
248
- <dt><span class="term">
249
- tabsize
250
- </span></dt>
251
- <dd>
252
- The number of spaces to expand tab characters, for example
253
- <code class="literal">tabsize=4</code>. Defaults to 8. A <span class="emphasis"><em>tabsize</em></span> of zero suppresses tab
254
- expansion (useful when piping included files through block
255
- filters). Included files can override this option using the
256
- <span class="emphasis"><em>tabsize</em></span> attribute.
257
- </dd>
258
- <dt><span class="term">
259
- pagewidth, pageunits
260
- </span></dt>
261
- <dd>
262
- These global table related options are documented in the
263
- <a class="link" href="block_element_definitions.html#X4">Table Configuration File Definitions</a> sub-section.
264
- </dd>
265
- </dl></div>
266
- <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
267
- <h3 class="title">Note</h3>
268
- <p><code class="literal">[miscellaneous]</code> configuration file entries can be set using
269
- the asciidoc(1) <code class="literal">-a</code> (<code class="literal">--attribute</code>) command-line option.</p>
270
- </div>
271
- </div>
272
- <div class="section" lang="en" xml:lang="en">
273
- <div class="titlepage"><div><div><h3 class="title">
274
- <a id="_titles_section"></a>Titles section</h3></div></div></div>
275
- <div class="variablelist"><dl>
276
- <dt><span class="term">
277
- sectiontitle
278
- </span></dt>
279
- <dd>
280
- Two line section title pattern. The entry value is a Python
281
- regular expression containing the named group <span class="emphasis"><em>title</em></span>.
282
- </dd>
283
- <dt><span class="term">
284
- underlines
285
- </span></dt>
286
- <dd>
287
- <p>
288
- A comma separated list of document and section title underline
289
- character pairs starting with the section level 0 and ending
290
- with section level 4 underline. The default setting is:
291
- </p>
292
- <pre class="literallayout">underlines="==","--","~~","^^","++"</pre>
293
- </dd>
294
- <dt><span class="term">
295
- sect0…sect4
296
- </span></dt>
297
- <dd>
298
- One line section title patterns. The entry value is a Python
299
- regular expression containing the named group <span class="emphasis"><em>title</em></span>.
300
- </dd>
301
- <dt><span class="term">
302
- blocktitle
303
- </span></dt>
304
- <dd>
305
- <a class="link" href="block_titles.html" title="Block Titles">BlockTitle element</a> pattern. The entry value is a
306
- Python regular expression containing the named group <span class="emphasis"><em>title</em></span>.
307
- </dd>
308
- <dt><span class="term">
309
- subs
310
- </span></dt>
311
- <dd>
312
- A comma separated list of substitutions that are performed on
313
- the document header and section titles. Defaults to <span class="emphasis"><em>normal</em></span>
314
- substitution.
315
- </dd>
316
- </dl></div>
317
- </div>
318
- <div class="section" lang="en" xml:lang="en">
319
- <div class="titlepage"><div><div><h3 class="title">
320
- <a id="_tags_section"></a>Tags section</h3></div></div></div>
321
- <p>The <code class="literal">[tags]</code> section contains backend tag definitions (one per
322
- line). Tags are used to translate AsciiDoc elements to backend
323
- markup.</p>
324
- <p>An AsciiDoc tag definition is formatted like
325
- <code class="literal">&lt;tagname&gt;=&lt;starttag&gt;|&lt;endtag&gt;</code>. For example:</p>
326
- <pre class="literallayout">emphasis=&lt;em&gt;|&lt;/em&gt;</pre>
327
- <p>In this example asciidoc(1) replaces the | character with the
328
- emphasized text from the AsciiDoc input file and writes the result to
329
- the output file.</p>
330
- <p>Use the <code class="literal">{brvbar}</code> attribute reference if you need to include a | pipe
331
- character inside tag text.</p>
332
- </div>
333
- <div class="section" lang="en" xml:lang="en">
334
- <div class="titlepage"><div><div><h3 class="title">
335
- <a id="_attributes_section"></a>Attributes section</h3></div></div></div>
336
- <p>The optional <code class="literal">[attributes]</code> section contains predefined attributes.</p>
337
- <p>If the attribute value requires leading or trailing spaces then the
338
- text text should be enclosed in quotation mark (") characters.</p>
339
- <p>To delete a attribute insert a <code class="literal">name!</code> entry in a downstream
340
- configuration file or use the asciidoc(1) <code class="literal">--attribute name!</code>
341
- command-line option (an attribute name suffixed with a <code class="literal">!</code> character
342
- deletes the attribute)</p>
343
- </div>
344
- <div class="section" lang="en" xml:lang="en">
345
- <div class="titlepage"><div><div><h3 class="title">
346
- <a id="_special_characters_section"></a>Special Characters section</h3></div></div></div>
347
- <p>The <code class="literal">[specialcharacters]</code> section specifies how to escape characters
348
- reserved by the backend markup. Each translation is specified on a
349
- single line formatted like:</p>
350
- <pre class="literallayout">&lt;special_character&gt;=&lt;translated_characters&gt;</pre>
351
- <p>Special characters are normally confined to those that resolve
352
- markup ambiguity (in the case of HTML and XML markups the ampersand,
353
- less than and greater than characters). The following example causes
354
- all occurrences of the <code class="literal">&lt;</code> character to be replaced by <code class="literal">&amp;lt;</code>.</p>
355
- <pre class="literallayout">&lt;=&amp;lt;</pre>
356
- </div>
357
- <div class="section" lang="en" xml:lang="en">
358
- <div class="titlepage"><div><div><h3 class="title">
359
- <a id="_quoted_text_section"></a>Quoted Text section</h3></div></div></div>
360
- <p>Quoting is used primarily for text formatting. The <code class="literal">[quotes]</code> section
361
- defines AsciiDoc quoting characters and their corresponding backend
362
- markup tags. Each section entry value is the name of a of a <code class="literal">[tags]</code>
363
- section entry. The entry name is the character (or characters) that
364
- quote the text. The following examples are taken from AsciiDoc
365
- configuration files:</p>
366
- <pre class="literallayout">[quotes]
367
- _=emphasis</pre>
368
- <pre class="literallayout">[tags]
369
- emphasis=&lt;em&gt;|&lt;/em&gt;</pre>
370
- <p>You can specify the left and right quote strings separately by
371
- separating them with a | character, for example:</p>
372
- <pre class="literallayout">``|''=quoted</pre>
373
- <p>Omitting the tag will disable quoting, for example, if you don’t want
374
- superscripts or subscripts put the following in a custom configuration
375
- file or edit the global <code class="literal">asciidoc.conf</code> configuration file:</p>
376
- <pre class="literallayout">[quotes]
377
- ^=
378
- ~=</pre>
379
- <p><a class="link" href="text_formatting.html#X52" title="Constrained and Unconstrained Quotes">Unconstrained quotes</a> are differentiated from constrained
380
- quotes by prefixing the tag name with a hash character, for example:</p>
381
- <pre class="literallayout">__=#emphasis</pre>
382
- <div class="itemizedlist">
383
- <p class="title"><b>Quoted text behavior</b></p>
384
- <ul type="disc">
385
- <li>
386
- Quote characters must be non-alphanumeric.
387
- </li>
388
- <li>
389
- To minimize quoting ambiguity try not to use the same quote
390
- characters in different quote types.
391
- </li>
392
- </ul>
393
- </div>
394
- </div>
395
- <div class="section" lang="en" xml:lang="en">
396
- <div class="titlepage"><div><div><h3 class="title">
397
- <a id="_special_words_section"></a>Special Words section</h3></div></div></div>
398
- <p>The <code class="literal">[specialwords]</code> section is used to single out words and phrases
399
- that you want to consistently format in some way throughout your
400
- document without having to repeatedly specify the markup. The name of
401
- each entry corresponds to a markup template section and the entry
402
- value consists of a list of words and phrases to be marked up. For
403
- example:</p>
404
- <pre class="literallayout">[specialwords]
405
- strongwords=NOTE IMPORTANT</pre>
406
- <pre class="literallayout">[strongwords]
407
- &lt;strong&gt;{words}&lt;/strong&gt;</pre>
408
- <p>The examples specifies that any occurrence of <code class="literal">NOTE</code> or <code class="literal">IMPORTANT</code>
409
- should appear in a bold font.</p>
410
- <p>Words and word phrases are treated as Python regular expressions: for
411
- example, the word <code class="literal">^NOTE</code> would only match <code class="literal">NOTE</code> if appeared at
412
- the start of a line.</p>
413
- <p>AsciiDoc comes with three built-in Special Word types:
414
- <span class="emphasis"><em>emphasizedwords</em></span>, <span class="emphasis"><em>monospacedwords</em></span> and <span class="emphasis"><em>strongwords</em></span>, each has a
415
- corresponding (backend specific) markup template section. Edit the
416
- configuration files to customize existing Special Words and to add new
417
- ones.</p>
418
- <div class="itemizedlist">
419
- <p class="title"><b>Special word behavior</b></p>
420
- <ul type="disc">
421
- <li>
422
- Word list entries must be separated by space characters.
423
- </li>
424
- <li>
425
- Word list entries with embedded spaces should be enclosed in quotation (")
426
- characters.
427
- </li>
428
- <li>
429
- A <code class="literal">[specialwords]</code> section entry of the form
430
- <code class="literal">name=word1 [word2…]</code> adds words to existing <code class="literal">name</code> entries.
431
- </li>
432
- <li>
433
- A <code class="literal">[specialwords]</code> section entry of the form <code class="literal">name</code> undefines
434
- (deletes) all existing <code class="literal">name</code> words.
435
- </li>
436
- <li>
437
- Since word list entries are processed as Python regular expressions
438
- you need to be careful to escape regular expression special
439
- characters.
440
- </li>
441
- <li>
442
- By default Special Words are substituted before Inline Macros, this
443
- may lead to undesirable consequences. For example the special word
444
- <code class="literal">foobar</code> would be expanded inside the macro call
445
- <code class="literal">http://www.foobar.com[]</code>. A possible solution is to emphasize
446
- whole words only by defining the word using regular expression
447
- characters, for example <code class="literal">\bfoobar\b</code>.
448
- </li>
449
- <li>
450
- If the first matched character of a special word is a backslash then
451
- the remaining characters are output without markup i.e. the
452
- backslash can be used to escape special word markup. For example
453
- the special word <code class="literal">\\?\b[Tt]en\b</code> will mark up the words <code class="literal">Ten</code> and
454
- <code class="literal">ten</code> only if they are not preceded by a backslash.
455
- </li>
456
- </ul>
457
- </div>
458
- </div>
459
- <div class="section" lang="en" xml:lang="en">
460
- <div class="titlepage"><div><div><h3 class="title">
461
- <a id="X10"></a>Replacements section</h3></div></div></div>
462
- <p><code class="literal">[replacements]</code> and <code class="literal">[replacements2]</code> configuration file entries
463
- specify find and replace text and are formatted like:</p>
464
- <pre class="literallayout">&lt;find_pattern&gt;=&lt;replacement_text&gt;</pre>
465
- <p>The find text can be a Python regular expression; the replace text can
466
- contain Python regular expression group references.</p>
467
- <p>Use Replacement shortcuts for often used macro references, for
468
- example (the second replacement allows us to backslash escape the
469
- macro name):</p>
470
- <pre class="literallayout">NEW!=image:./images/smallnew.png[New!]
471
- \\NEW!=NEW!</pre>
472
- <div class="itemizedlist">
473
- <p class="title"><b>Replacement behavior</b></p>
474
- <ul type="disc">
475
- <li>
476
- The built-in replacements can be escaped with a backslash.
477
- </li>
478
- <li>
479
- If the find or replace text has leading or trailing spaces then the
480
- text should be enclosed in quotation (") characters.
481
- </li>
482
- <li>
483
- Since the find text is processed as a regular expression you need to
484
- be careful to escape regular expression special characters.
485
- </li>
486
- <li>
487
- Replacements are performed in the same order they appear in the
488
- configuration file replacements section.
489
- </li>
490
- </ul>
491
- </div>
492
- </div>
493
- <div class="section" lang="en" xml:lang="en">
494
- <div class="titlepage"><div><div><h3 class="title">
495
- <a id="_markup_template_sections"></a>Markup Template Sections</h3></div></div></div>
496
- <p>Markup template sections supply backend markup for translating
497
- AsciiDoc elements. Since the text is normally backend dependent
498
- you’ll find these sections in the backend specific configuration
499
- files. Template sections differ from other sections in that they
500
- contain a single block of text instead of per line <span class="emphasis"><em>name=value</em></span>
501
- entries. A markup template section body can contain:</p>
502
- <div class="itemizedlist"><ul type="disc">
503
- <li>
504
- Attribute references
505
- </li>
506
- <li>
507
- System macro calls.
508
- </li>
509
- <li>
510
- A document content placeholder
511
- </li>
512
- </ul></div>
513
- <p>The document content placeholder is a single | character and is
514
- replaced by text from the source element. Use the <code class="literal">{brvbar}</code>
515
- attribute reference if you need a literal | character in the template.</p>
516
- </div>
517
- <div class="section" lang="en" xml:lang="en">
518
- <div class="titlepage"><div><div><h3 class="title">
519
- <a id="X27"></a>Configuration File Names and Locations</h3></div></div></div>
520
- <p>Configuration files have a <code class="literal">.conf</code> file name extension; they are
521
- loaded from the following locations:</p>
522
- <div class="orderedlist"><ol type="1">
523
- <li>
524
- The directory containing the asciidoc executable.
525
- </li>
526
- <li>
527
- If there is no <code class="literal">asciidoc.conf</code> file in the directory containing the
528
- asciidoc executable then load from the global configuration
529
- directory (normally <code class="literal">/etc/asciidoc</code> or <code class="literal">/usr/local/etc/asciidoc</code>)
530
- i.e. the global configuration files directory is skipped if
531
- AsciiDoc configuration files are installed in the same directory as
532
- the asciidoc executable. This allows both a system wide copy and
533
- multiple local copies of AsciiDoc to coexist on the same host PC.
534
- </li>
535
- <li>
536
- The user’s <code class="literal">$HOME/.asciidoc</code> directory (if it exists).
537
- </li>
538
- <li>
539
- The directory containing the AsciiDoc source file.
540
- </li>
541
- <li>
542
- Explicit configuration files specified with the asciidoc(1)
543
- <code class="literal">--conf-file</code>) command-line option. The <code class="literal">--conf-file</code> option can
544
- be specified multiple times, in which case configuration files will
545
- be processed in the same order they appear on the command-line.
546
- </li>
547
- </ol></div>
548
- <p>Configuration files from the above locations are loaded in the
549
- following order:</p>
550
- <div class="itemizedlist"><ul type="disc">
551
- <li>
552
- <p>
553
- The <code class="literal">[attributes]</code> section only from:
554
- </p>
555
- <div class="itemizedlist"><ul type="circle">
556
- <li>
557
- <code class="literal">asciidoc.conf</code> in location 3
558
- </li>
559
- <li>
560
- <p>
561
- Files from location 5.
562
- </p>
563
- <p>This first pass makes locally set attributes available in the global
564
- <code class="literal">asciidoc.conf</code> file.</p>
565
- </li>
566
- </ul></div>
567
- </li>
568
- <li>
569
- <code class="literal">asciidoc.conf</code> from locations 1, 2, 3.
570
- </li>
571
- <li>
572
- <span class="emphasis"><em>attributes</em></span>, <span class="emphasis"><em>titles</em></span> and <span class="emphasis"><em>specialcharacters</em></span> sections from the
573
- <code class="literal">asciidoc.conf</code> in location 4.
574
- </li>
575
- <li>
576
- The document header is parsed at this point and we can assume the
577
- <span class="emphasis"><em>backend</em></span> and <span class="emphasis"><em>doctype</em></span> have now been defined.
578
- </li>
579
- <li>
580
- <code class="literal">&lt;backend&gt;.conf</code> and <code class="literal">&lt;backend&gt;-&lt;doctype&gt;.conf</code> from locations 1,
581
- 2,3.
582
- </li>
583
- <li>
584
- Filter conf files from the <code class="literal">filters</code> directory in locations 1, 2, 3.
585
- </li>
586
- <li>
587
- <code class="literal">lang-&lt;lang&gt;.conf</code> from locations 1, 2, 3.
588
- </li>
589
- <li>
590
- <code class="literal">asciidoc.conf</code> from location 4.
591
- </li>
592
- <li>
593
- <code class="literal">&lt;backend&gt;.conf</code> and <code class="literal">&lt;backend&gt;-&lt;doctype&gt;.conf</code> from location 4.
594
- 2,3.
595
- </li>
596
- <li>
597
- Filter conf files from location 4.
598
- </li>
599
- <li>
600
- <code class="literal">&lt;docfile&gt;.conf</code> and <code class="literal">&lt;docfile&gt;-&lt;backend&gt;.conf</code> from location 4.
601
- </li>
602
- <li>
603
- Configuration files from location 5.
604
- </li>
605
- </ul></div>
606
- <p>Where:</p>
607
- <div class="itemizedlist"><ul type="disc">
608
- <li>
609
- <code class="literal">&lt;backend&gt;</code> and <code class="literal">&lt;doctype&gt;</code> are values specified by the asciidoc(1)
610
- <code class="literal">-b</code> (<code class="literal">--backend</code>) and <code class="literal">-d</code> (<code class="literal">--doctype</code>) command-line options.
611
- </li>
612
- <li>
613
- <code class="literal">&lt;infile&gt;</code> is the path name of the AsciiDoc input file without the
614
- file name extension.
615
- </li>
616
- <li>
617
- <code class="literal">&lt;lang&gt;</code> is a two letter country code set by the the AsciiDoc <span class="emphasis"><em>lang</em></span>
618
- attribute.
619
- </li>
620
- </ul></div>
621
- <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
622
- <h3 class="title">Note</h3>
623
- <p>The backend and language global configuration files are loaded <span class="strong"><strong>after</strong></span>
624
- the header has been parsed. This means that you can set most
625
- attributes in the document header. Here’s an example header:</p>
626
- <pre class="literallayout">Life's Mysteries
627
- ================
628
- :author: Hu Nose
629
- :doctype: book
630
- :toc:
631
- :icons:
632
- :data-uri:
633
- :lang: en
634
- :encoding: iso-8859-1</pre>
635
- <p>Attributes set in the document header take precedence over
636
- configuration file attributes.</p>
637
- </div>
638
- <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
639
- <h3 class="title">Tip</h3>
640
- <p>Use the asciidoc(1) <code class="literal">-v</code> (<code class="literal">--verbose</code>) command-line option to see
641
- which configuration files are loaded and the order in which they are
642
- loaded.</p>
643
- </div>
644
- </div>
645
- </div>
646
-
647
- </div>
648
-
649
- <hr/>
650
-
651
- <div class="nav" id="navfooter">
652
- <table width="100%">
653
- <tr><td width="33%" align="left">
654
-
655
- <a href="mathematical_formulas.html">Prev</a><br/>
656
- Mathematical Formulas
657
-
658
- </td><td width="33%" align="center">
659
-
660
- <a href="index.html">Home</a><br/>
661
- AsciiDoc User Guide
662
-
663
- </td><td width="33%" align="right">
664
-
665
- <a href="document_attributes.html">Next</a><br/>
666
- Document Attributes
667
-
668
- </td></tr>
669
- </table>
670
- </div>
671
- </body>
672
- </html>