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,797 +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>Tables</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="macros.html">Prev</a><br/>
15
- Macros
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="manpage_documents.html">Next</a><br/>
25
- Manpage Documents
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="_tables"></a>Tables</h2></div></div></div>
37
- <p>The AsciiDoc table syntax looks and behaves like other delimited block
38
- types and supports standard <a class="link" href="block_element_definitions.html" title="Block Element Definitions">block configuration entries</a>.
39
- Formatting is easy to read and, just as importantly, easy to enter.</p>
40
- <div class="itemizedlist"><ul type="disc">
41
- <li>
42
- Cells and columns can be formatted using built-in customizable styles.
43
- </li>
44
- <li>
45
- Horizontal and vertical cell alignment can be set on columns and
46
- cell.
47
- </li>
48
- <li>
49
- Horizontal and vertical cell spanning is supported.
50
- </li>
51
- </ul></div>
52
- <div class="sidebar">
53
- <p class="title"><b>Use tables sparingly</b></p>
54
- <p>When technical users first start creating documents, tables (complete
55
- with column spanning and table nesting) are often considered very
56
- important. The reality is that tables are seldom used, even in
57
- technical documentation.</p>
58
- <p>Try this exercise: thumb through your library of technical books,
59
- you’ll be surprised just how seldom tables are actually used, even
60
- less seldom are tables containing block elements (such as paragraphs
61
- or lists) or spanned cells. This is no accident, like figures, tables
62
- are outside the normal document flow — tables are for consulting not
63
- for reading.</p>
64
- <p>Tables are designed for, and should normally only be used for,
65
- displaying column oriented tabular data.</p>
66
- </div>
67
- <div class="section" lang="en" xml:lang="en">
68
- <div class="titlepage"><div><div><h3 class="title">
69
- <a id="_example_tables"></a>Example tables</h3></div></div></div>
70
- <div class="table">
71
- <a id="id36121822"></a><p class="title"><b>Table 2. Simple table</b></p>
72
- <div class="table-contents"><table summary="Simple table" border="1" width="15%">
73
- <colgroup>
74
- <col>
75
- <col>
76
- <col>
77
- </colgroup>
78
- <tbody>
79
- <tr>
80
- <td align="left" valign="top"><p>1</p></td>
81
- <td align="left" valign="top"><p>2</p></td>
82
- <td align="left" valign="top"><p>A</p></td>
83
- </tr>
84
- <tr>
85
- <td align="left" valign="top"><p>3</p></td>
86
- <td align="left" valign="top"><p>4</p></td>
87
- <td align="left" valign="top"><p>B</p></td>
88
- </tr>
89
- <tr>
90
- <td align="left" valign="top"><p>5</p></td>
91
- <td align="left" valign="top"><p>6</p></td>
92
- <td align="left" valign="top"><p>C</p></td>
93
- </tr>
94
- </tbody>
95
- </table></div>
96
- </div>
97
- <br class="table-break"><p><b>AsciiDoc source. </b>
98
- </p>
99
- <pre class="screen">[width="15%"]
100
- |=======
101
- |1 |2 |A
102
- |3 |4 |B
103
- |5 |6 |C
104
- |=======</pre>
105
- <p>
106
- </p>
107
- <div class="table">
108
- <a id="id36121959"></a><p class="title"><b>Table 3. Columns formatted with strong, monospaced and emphasis styles</b></p>
109
- <div class="table-contents"><table summary="Columns formatted with strong, monospaced and emphasis styles" border="1" width="50%">
110
- <colgroup>
111
- <col>
112
- <col>
113
- <col>
114
- </colgroup>
115
- <thead><tr>
116
- <th align="right" valign="top"> </th>
117
- <th colspan="2" align="center" valign="top">Columns 2 and 3</th>
118
- </tr></thead>
119
- <tfoot><tr>
120
- <th align="right" valign="top"><p><span class="strong"><strong>footer 1</strong></span></p></th>
121
- <th align="center" valign="top"><p><code class="literal">footer 2</code></p></th>
122
- <th align="left" valign="top"><p><span class="emphasis"><em>footer 3</em></span></p></th>
123
- </tr></tfoot>
124
- <tbody>
125
- <tr>
126
- <td align="right" valign="top"><p><span class="strong"><strong>1</strong></span></p></td>
127
- <td align="center" valign="top"><p><code class="literal">Item 1</code></p></td>
128
- <td align="left" valign="top"><p><span class="emphasis"><em>Item 1</em></span></p></td>
129
- </tr>
130
- <tr>
131
- <td align="right" valign="top"><p><span class="strong"><strong>2</strong></span></p></td>
132
- <td align="center" valign="top"><p><code class="literal">Item 2</code></p></td>
133
- <td align="left" valign="top"><p><span class="emphasis"><em>Item 2</em></span></p></td>
134
- </tr>
135
- <tr>
136
- <td align="right" valign="top"><p><span class="strong"><strong>3</strong></span></p></td>
137
- <td align="center" valign="top"><p><code class="literal">Item 3</code></p></td>
138
- <td align="left" valign="top"><p><span class="emphasis"><em>Item 3</em></span></p></td>
139
- </tr>
140
- <tr>
141
- <td align="right" valign="top"><p><span class="strong"><strong>4</strong></span></p></td>
142
- <td align="center" valign="top"><p><code class="literal">Item 4</code></p></td>
143
- <td align="left" valign="top"><p><span class="emphasis"><em>Item 4</em></span></p></td>
144
- </tr>
145
- </tbody>
146
- </table></div>
147
- </div>
148
- <br class="table-break"><p><b>AsciiDoc source. </b>
149
- </p>
150
- <pre class="screen">.An example table
151
- [width="50%",cols="&gt;s,^m,e",frame="topbot",options="header,footer"]
152
- |==========================
153
- | 2+|Columns 2 and 3
154
- |1 |Item 1 |Item 1
155
- |2 |Item 2 |Item 2
156
- |3 |Item 3 |Item 3
157
- |4 |Item 4 |Item 4
158
- |footer 1|footer 2|footer 3
159
- |==========================</pre>
160
- <p>
161
- </p>
162
- <div class="table">
163
- <a id="id36122216"></a><p class="title"><b>Table 4. Horizontal and vertical source data</b></p>
164
- <div class="table-contents"><table summary="Horizontal and vertical source data" border="1" width="80%">
165
- <colgroup>
166
- <col>
167
- <col>
168
- <col>
169
- <col>
170
- </colgroup>
171
- <thead><tr>
172
- <th align="left" valign="top">Date </th>
173
- <th align="center" valign="top">Duration </th>
174
- <th align="center" valign="top">Avg HR </th>
175
- <th align="left" valign="top">Notes</th>
176
- </tr></thead>
177
- <tbody>
178
- <tr>
179
- <td align="left" valign="top"><p>22-Aug-08</p></td>
180
- <td align="center" valign="top"><p>10:24</p></td>
181
- <td align="center" valign="top"><p>157</p></td>
182
- <td align="left" valign="top"><p>Worked out MSHR (max sustainable heart rate) by going hard
183
- for this interval.</p></td>
184
- </tr>
185
- <tr>
186
- <td align="left" valign="top"><p>22-Aug-08</p></td>
187
- <td align="center" valign="top"><p>23:03</p></td>
188
- <td align="center" valign="top"><p>152</p></td>
189
- <td align="left" valign="top"><p>Back-to-back with previous interval.</p></td>
190
- </tr>
191
- <tr>
192
- <td align="left" valign="top"><p>24-Aug-08</p></td>
193
- <td align="center" valign="top"><p>40:00</p></td>
194
- <td align="center" valign="top"><p>145</p></td>
195
- <td align="left" valign="top"><p>Moderately hard interspersed with 3x 3min intervals (2min
196
- hard + 1min really hard taking the HR up to 160).</p></td>
197
- </tr>
198
- </tbody>
199
- </table></div>
200
- </div>
201
- <br class="table-break"><p>Short cells can be entered horizontally, longer cells vertically. The
202
- default behavior is to strip leading and trailing blank lines within a
203
- cell. These characteristics aid readability and data entry.</p>
204
- <p><b>AsciiDoc source. </b>
205
- </p>
206
- <pre class="screen">.Windtrainer workouts
207
- [width="80%",cols="3,^2,^2,10",options="header"]
208
- |=========================================================
209
- |Date |Duration |Avg HR |Notes
210
-
211
- |22-Aug-08 |10:24 | 157 |
212
- Worked out MSHR (max sustainable heart rate) by going hard
213
- for this interval.
214
-
215
- |22-Aug-08 |23:03 | 152 |
216
- Back-to-back with previous interval.
217
-
218
- |24-Aug-08 |40:00 | 145 |
219
- Moderately hard interspersed with 3x 3min intervals (2min
220
- hard + 1min really hard taking the HR up to 160).
221
-
222
- |=========================================================</pre>
223
- <p>
224
- </p>
225
- <div class="table">
226
- <a id="id36122426"></a><p class="title"><b>Table 5. A table with externally sourced CSV data</b></p>
227
- <div class="table-contents"><table summary="A table with externally sourced CSV data" border="1">
228
- <colgroup>
229
- <col>
230
- <col>
231
- <col>
232
- <col>
233
- <col>
234
- </colgroup>
235
- <thead><tr>
236
- <th align="center" valign="top">ID</th>
237
- <th align="left" valign="top">Customer Name</th>
238
- <th align="left" valign="top">Contact Name</th>
239
- <th align="left" valign="top">Customer Address</th>
240
- <th align="left" valign="top">Phone</th>
241
- </tr></thead>
242
- <tbody></tbody>
243
- </table></div>
244
- </div>
245
- <br class="table-break"><p><b>AsciiDoc source. </b>
246
- </p>
247
- <pre class="screen">[format="csv",cols="^1,4*2",options="header"]
248
- |===================================================
249
- ID,Customer Name,Contact Name,Customer Address,Phone
250
- include::customers.csv[]
251
- |===================================================</pre>
252
- <p>
253
- </p>
254
- <div class="table">
255
- <a id="id36122532"></a><p class="title"><b>Table 6. Cell spans, alignments and styles</b></p>
256
- <div class="table-contents"><table summary="Cell spans, alignments and styles" border="1" width="25%">
257
- <colgroup>
258
- <col>
259
- <col>
260
- <col>
261
- <col>
262
- </colgroup>
263
- <tbody>
264
- <tr>
265
- <td align="left" valign="top"><p><span class="emphasis"><em>1</em></span></p></td>
266
- <td align="right" valign="top"><p><span class="strong"><strong>2</strong></span></p></td>
267
- <td align="center" valign="top"><p>3</p></td>
268
- <td align="right" valign="top"><p><span class="strong"><strong>4</strong></span></p></td>
269
- </tr>
270
- <tr>
271
- <td align="center" valign="top"><p><span class="emphasis"><em>5</em></span></p></td>
272
- <td rowspan="2" colspan="2" align="center" valign="middle"><p><code class="literal">6</code></p></td>
273
- <td rowspan="3" align="left" valign="bottom"><p><code class="literal">7</code></p></td>
274
- </tr>
275
- <tr><td align="center" valign="top"><p><span class="emphasis"><em>8</em></span></p></td></tr>
276
- <tr>
277
- <td align="left" valign="top"><p><span class="emphasis"><em>9</em></span></p></td>
278
- <td colspan="2" align="right" valign="top"><p><code class="literal">10</code></p></td>
279
- </tr>
280
- </tbody>
281
- </table></div>
282
- </div>
283
- <br class="table-break"><p><b>AsciiDoc source. </b>
284
- </p>
285
- <pre class="screen">[cols="e,m,^,&gt;s",width="25%"]
286
- |============================
287
- |1 &gt;s|2 |3 |4
288
- ^|5 2.2+^.^|6 .3+&lt;.&gt;m|7
289
- ^|8
290
- |9 2+&gt;|10
291
- |============================</pre>
292
- <p>
293
- </p>
294
- </div>
295
- <div class="section" lang="en" xml:lang="en">
296
- <div class="titlepage"><div><div><h3 class="title">
297
- <a id="X68"></a>Table input data formats</h3></div></div></div>
298
- <p>AsciiDoc table data can be <span class="emphasis"><em>psv</em></span>, <span class="emphasis"><em>dsv</em></span> or <span class="emphasis"><em>csv</em></span> formatted. The
299
- default table format is <span class="emphasis"><em>psv</em></span>.</p>
300
- <p>AsciiDoc <span class="emphasis"><em>psv</em></span> (<span class="emphasis"><em>Prefix Separated Values</em></span>) and <span class="emphasis"><em>dsv</em></span> (<span class="emphasis"><em>Delimiter
301
- Separated Values</em></span>) formats are cell oriented — the table is treated
302
- as a sequence of cells — there are no explicit row separators.</p>
303
- <div class="itemizedlist"><ul type="disc">
304
- <li>
305
- <span class="emphasis"><em>psv</em></span> prefixes each cell with a separator whereas <span class="emphasis"><em>dsv</em></span> delimits
306
- cells with a separator.
307
- </li>
308
- <li>
309
- <span class="emphasis"><em>psv</em></span> and <span class="emphasis"><em>dsv</em></span> separators are Python regular expressions.
310
- </li>
311
- <li>
312
- The default <span class="emphasis"><em>psv</em></span> separator contains <a class="link" href="tables.html#X84" title="Cell Specifiers">cell specifier</a> related
313
- named regular expression groups.
314
- </li>
315
- <li>
316
- The default <span class="emphasis"><em>dsv</em></span> separator is <code class="literal">:|\n</code> (a colon or a new line
317
- character).
318
- </li>
319
- <li>
320
- <span class="emphasis"><em>psv</em></span> and <span class="emphasis"><em>dsv</em></span> cell separators can be escaped by preceding them
321
- with a backslash character.
322
- </li>
323
- </ul></div>
324
- <p>Here are four <span class="emphasis"><em>psv</em></span> cells (the second item spans two columns; the
325
- last contains an escaped separator):</p>
326
- <pre class="literallayout">|One 2+|Two and three |A \| separator character</pre>
327
- <p><span class="emphasis"><em>csv</em></span> is the quasi-standard row oriented <span class="emphasis"><em>Comma Separated Values
328
- (CSV)</em></span> format commonly used to import and export spreadsheet and
329
- database data.</p>
330
- </div>
331
- <div class="section" lang="en" xml:lang="en">
332
- <div class="titlepage"><div><div><h3 class="title">
333
- <a id="X69"></a>Table attributes</h3></div></div></div>
334
- <p>Tables can be customized by the following attributes:</p>
335
- <div class="variablelist"><dl>
336
- <dt><span class="term">
337
- format
338
- </span></dt>
339
- <dd>
340
- <span class="emphasis"><em>psv</em></span> (default), <span class="emphasis"><em>dsv</em></span> or <span class="emphasis"><em>csv</em></span> (See <a class="link" href="tables.html#X68" title="Table input data formats">Table Data Formats</a>).
341
- </dd>
342
- <dt><span class="term">
343
- separator
344
- </span></dt>
345
- <dd>
346
- The cell separator. A Python regular expression (<span class="emphasis"><em>psv</em></span> and <span class="emphasis"><em>dsv</em></span>
347
- formats) or a single character (<span class="emphasis"><em>csv</em></span> format).
348
- </dd>
349
- <dt><span class="term">
350
- frame
351
- </span></dt>
352
- <dd>
353
- Defines the table border and can take the following values: <span class="emphasis"><em>topbot</em></span>
354
- (top and bottom), <span class="emphasis"><em>all</em></span> (all sides), <span class="emphasis"><em>none</em></span> and <span class="emphasis"><em>sides</em></span> (left and
355
- right sides). The default value is <span class="emphasis"><em>all</em></span>.
356
- </dd>
357
- <dt><span class="term">
358
- grid
359
- </span></dt>
360
- <dd>
361
- Defines which ruler lines are drawn between table rows and columns.
362
- The <span class="emphasis"><em>grid</em></span> attribute value can be any of the following values: <span class="emphasis"><em>none</em></span>,
363
- <span class="emphasis"><em>cols</em></span>, <span class="emphasis"><em>rows</em></span> and <span class="emphasis"><em>all</em></span>. The default value is <span class="emphasis"><em>all</em></span>.
364
- </dd>
365
- <dt><span class="term">
366
- align
367
- </span></dt>
368
- <dd>
369
- Use the <span class="emphasis"><em>align</em></span> attribute to horizontally align the table on the
370
- page (works with HTML outputs only, has no effect on DocBook outputs).
371
- The following values are valid: <span class="emphasis"><em>left</em></span>, <span class="emphasis"><em>right</em></span>, and <span class="emphasis"><em>center</em></span>.
372
- </dd>
373
- <dt><span class="term">
374
- float
375
- </span></dt>
376
- <dd>
377
- Use the <span class="emphasis"><em>float</em></span> attribute to float the table <span class="emphasis"><em>left</em></span> or <span class="emphasis"><em>right</em></span> on the
378
- page (works with HTML outputs only, has no effect on DocBook outputs).
379
- Floating only makes sense in conjunction with a table <span class="emphasis"><em>width</em></span>
380
- attribute value of less than 100% (otherwise the table will take up
381
- all the available space). <span class="emphasis"><em>float</em></span> and <span class="emphasis"><em>align</em></span> attributes are mutually
382
- exclusive. Use the <code class="literal">unfloat::[]</code> block macro to stop floating.
383
- </dd>
384
- <dt><span class="term">
385
- halign
386
- </span></dt>
387
- <dd>
388
- Use the <span class="emphasis"><em>halign</em></span> attribute to horizontally align all cells in a table.
389
- The following values are valid: <span class="emphasis"><em>left</em></span>, <span class="emphasis"><em>right</em></span>, and <span class="emphasis"><em>center</em></span>
390
- (defaults to <span class="emphasis"><em>left</em></span>). Overridden by <a class="link" href="tables.html#X70" title="Column Specifiers">Column specifiers</a> and
391
- <a class="link" href="tables.html#X84" title="Cell Specifiers">Cell specifiers</a>.
392
- </dd>
393
- <dt><span class="term">
394
- valign
395
- </span></dt>
396
- <dd>
397
- Use the <span class="emphasis"><em>valign</em></span> attribute to vertically align all cells in a table.
398
- The following values are valid: <span class="emphasis"><em>top</em></span>, <span class="emphasis"><em>bottom</em></span>, and <span class="emphasis"><em>middle</em></span>
399
- (defaults to <span class="emphasis"><em>top</em></span>). Overridden by <a class="link" href="tables.html#X70" title="Column Specifiers">Column specifiers</a> and
400
- <a class="link" href="tables.html#X84" title="Cell Specifiers">Cell specifiers</a>.
401
- </dd>
402
- <dt><span class="term">
403
- options
404
- </span></dt>
405
- <dd>
406
- The <span class="emphasis"><em>options</em></span> attribute can contain comma separated values, for
407
- example: <span class="emphasis"><em>header</em></span>, <span class="emphasis"><em>footer</em></span>. By default header and footer rows are
408
- omitted. See <a class="link" href="f_attribute_options.html" title="F. Attribute Options">attribute options</a> for a complete list of
409
- available table options.
410
- </dd>
411
- <dt><span class="term">
412
- cols
413
- </span></dt>
414
- <dd>
415
- <p>
416
- The <span class="emphasis"><em>cols</em></span> attribute is a comma separated list of <a class="link" href="tables.html#X70" title="Column Specifiers">column specifiers</a>. For example <code class="literal">cols="2&lt;p,2*,4p,&gt;"</code>.
417
- </p>
418
- <div class="itemizedlist"><ul type="disc">
419
- <li>
420
- If <span class="emphasis"><em>cols</em></span> is present it must specify all columns.
421
- </li>
422
- <li>
423
- If the <span class="emphasis"><em>cols</em></span> attribute is not specified the number of columns is
424
- calculated as the number of data items in the <span class="strong"><strong>first line</strong></span> of the
425
- table.
426
- </li>
427
- <li>
428
- The degenerate form for the <span class="emphasis"><em>cols</em></span> attribute is an integer
429
- specifying the number of columns e.g. <code class="literal">cols=4</code>.
430
- </li>
431
- </ul></div>
432
- </dd>
433
- <dt><span class="term">
434
- width
435
- </span></dt>
436
- <dd>
437
- The <span class="emphasis"><em>width</em></span> attribute is expressed as a percentage value
438
- (<span class="emphasis"><em>"1%"</em></span>…<span class="emphasis"><em>"99%"</em></span>). The width specifies the table width relative to
439
- the available width. HTML backends use this value to set the table
440
- width attribute. It’s a bit more complicated with DocBook, see the
441
- <a class="link" href="tables.html#X89" title="DocBook table widths">DocBook table widths</a> sidebar.
442
- </dd>
443
- <dt><span class="term">
444
- filter
445
- </span></dt>
446
- <dd>
447
- The <span class="emphasis"><em>filter</em></span> attribute defines an external shell command that is
448
- invoked for each cell. The built-in <span class="emphasis"><em>asciidoc</em></span> table style is
449
- implemented using a filter.
450
- </dd>
451
- </dl></div>
452
- <div class="sidebar">
453
- <a id="X89"></a><p class="title"><b>DocBook table widths</b></p>
454
- <p>The AsciiDoc docbook backend generates CALS tables. CALS tables do not
455
- support a table width attribute — table width can only be controlled
456
- by specifying absolute column widths.</p>
457
- <p>Specifying absolute column widths is not media independent because
458
- different presentation media have different physical dimensions. To
459
- get round this limitation both
460
- <a class="ulink" href="http://www.sagehill.net/docbookxsl/Tables.html#TableWidth" target="_top">DocBook XSL
461
- Stylesheets</a> and
462
- <a class="ulink" href="http://dblatex.sourceforge.net/doc/manual/ch03s05.html#sec-table-width" target="_top">dblatex</a>
463
- have implemented table width processing instructions for setting the
464
- table width as a percentage of the available width. AsciiDoc emits
465
- these processing instructions if the <span class="emphasis"><em>width</em></span> attribute is set along
466
- with proportional column widths (the AsciiDoc docbook backend
467
- <span class="emphasis"><em>pageunits</em></span> attribute defaults to <span class="emphasis"><em>*</em></span>).</p>
468
- <p>To generate DocBook tables with absolute column widths set the
469
- <span class="emphasis"><em>pageunits</em></span> attribute to a CALS absolute unit such as <span class="emphasis"><em>pt</em></span> and set the
470
- <span class="emphasis"><em>pagewidth</em></span> attribute to match the width of the presentation media.</p>
471
- </div>
472
- </div>
473
- <div class="section" lang="en" xml:lang="en">
474
- <div class="titlepage"><div><div><h3 class="title">
475
- <a id="X70"></a>Column Specifiers</h3></div></div></div>
476
- <p>Column specifiers define how columns are rendered and appear in the
477
- table <a class="link" href="tables.html#X69" title="Table attributes">cols attribute</a>. A column specifier consists of an
478
- optional column multiplier followed by optional alignment, width and
479
- style values and is formatted like:</p>
480
- <pre class="literallayout">[&lt;multiplier&gt;*][&lt;align&gt;][&lt;width&gt;][&lt;style&gt;]</pre>
481
- <div class="itemizedlist"><ul type="disc">
482
- <li>
483
- All components are optional. The multiplier must be first and the
484
- style last. The order of <code class="literal">&lt;align&gt;</code> or <code class="literal">&lt;width&gt;</code> is not important.
485
- </li>
486
- <li>
487
- Column <code class="literal">&lt;width&gt;</code> can be either an integer proportional value (1…)
488
- or a percentage (1%…100%). The default value is 1. To ensure
489
- portability across different backends, there is no provision for
490
- absolute column widths (not to be confused with output column width
491
- <a class="link" href="tables.html#X72" title="Markup attributes">markup attributes</a> which are available in both percentage and
492
- absolute units).
493
- </li>
494
- <li>
495
- <p>
496
- The <span class="emphasis"><em>&lt;align&gt;</em></span> column alignment specifier is formatted like:
497
- </p>
498
- <pre class="literallayout">[&lt;horizontal&gt;][.&lt;vertical&gt;]</pre>
499
- <p>Where <code class="literal">&lt;horizontal&gt;</code> and <code class="literal">&lt;vertical&gt;</code> are one of the following
500
- characters: <code class="literal">&lt;</code>, <code class="literal">^</code> or <code class="literal">&gt;</code> which represent <span class="emphasis"><em>left</em></span>, <span class="emphasis"><em>center</em></span> and
501
- <span class="emphasis"><em>right</em></span> horizontal alignment or <span class="emphasis"><em>top</em></span>, <span class="emphasis"><em>middle</em></span> and <span class="emphasis"><em>bottom</em></span> vertical
502
- alignment respectively.</p>
503
- </li>
504
- <li>
505
- A <code class="literal">&lt;multiplier&gt;</code> can be used to specify repeated columns e.g.
506
- <code class="literal">cols="4*&lt;"</code> specifies four left-justified columns. The default
507
- multiplier value is 1.
508
- </li>
509
- <li>
510
- The <code class="literal">&lt;style&gt;</code> name specifies a <a class="link" href="tables.html#X71" title="Table styles">table style</a> to used to markup
511
- column cells (you can use the full style names if you wish but the
512
- first letter is normally sufficient).
513
- </li>
514
- <li>
515
- Column specific styles are not applied to header rows.
516
- </li>
517
- </ul></div>
518
- </div>
519
- <div class="section" lang="en" xml:lang="en">
520
- <div class="titlepage"><div><div><h3 class="title">
521
- <a id="X84"></a>Cell Specifiers</h3></div></div></div>
522
- <p>Cell specifiers allow individual cells in <span class="emphasis"><em>psv</em></span> formatted tables to be
523
- spanned, multiplied, aligned and styled. Cell specifiers prefix <span class="emphasis"><em>psv</em></span>
524
- <code class="literal">|</code> delimiters and are formatted like:</p>
525
- <pre class="literallayout">[&lt;span&gt;*|+][&lt;align&gt;][&lt;style&gt;]</pre>
526
- <div class="itemizedlist"><ul type="disc">
527
- <li>
528
- <p>
529
- <span class="emphasis"><em>&lt;span&gt;</em></span> specifies horizontal and vertical cell spans (<span class="emphasis"><em>+</em></span> operator) or
530
- the number of times the cell is replicated (<span class="emphasis"><em>*</em></span> operator). <span class="emphasis"><em>&lt;span&gt;</em></span>
531
- is formatted like:
532
- </p>
533
- <pre class="literallayout">[&lt;colspan&gt;][.&lt;rowspan&gt;]</pre>
534
- <p>Where <code class="literal">&lt;colspan&gt;</code> and <code class="literal">&lt;rowspan&gt;</code> are integers specifying the number of
535
- columns and rows to span.</p>
536
- </li>
537
- <li>
538
- <code class="literal">&lt;align&gt;</code> specifies horizontal and vertical cell alignment an is the
539
- same as in <a class="link" href="tables.html#X70" title="Column Specifiers">column specifiers</a>.
540
- </li>
541
- <li>
542
- A <code class="literal">&lt;style&gt;</code> value is the first letter of <a class="link" href="tables.html#X71" title="Table styles">table style</a> name.
543
- </li>
544
- </ul></div>
545
- <p>For example, the following <span class="emphasis"><em>psv</em></span> formatted cell will span two columns
546
- and the text will be centered and emphasized:</p>
547
- <pre class="literallayout">`2+^e| Cell text`</pre>
548
- </div>
549
- <div class="section" lang="en" xml:lang="en">
550
- <div class="titlepage"><div><div><h3 class="title">
551
- <a id="X71"></a>Table styles</h3></div></div></div>
552
- <p>Table styles can be applied to the entire table (by setting the
553
- <span class="emphasis"><em>style</em></span> attribute in the table’s attribute list) or on a per column
554
- basis (by specifying the style in the table’s <a class="link" href="tables.html#X69" title="Table attributes">cols attribute</a>).
555
- Table data can be formatted using the following predefined styles:</p>
556
- <div class="variablelist"><dl>
557
- <dt><span class="term">
558
- default
559
- </span></dt>
560
- <dd>
561
- The default style: AsciiDoc inline text formatting; blank lines are
562
- treated as paragraph breaks.
563
- </dd>
564
- <dt><span class="term">
565
- emphasis
566
- </span></dt>
567
- <dd>
568
- Like default but all text is emphasised.
569
- </dd>
570
- <dt><span class="term">
571
- monospaced
572
- </span></dt>
573
- <dd>
574
- Like default but all text is in a monospaced font.
575
- </dd>
576
- <dt><span class="term">
577
- strong
578
- </span></dt>
579
- <dd>
580
- Like default but all text is bold.
581
- </dd>
582
- <dt><span class="term">
583
- header
584
- </span></dt>
585
- <dd>
586
- Apply the same style as the table header. Normally used to create a
587
- vertical header in the first column.
588
- </dd>
589
- <dt><span class="term">
590
- asciidoc
591
- </span></dt>
592
- <dd>
593
- With this style table cells can contain any of the AsciiDoc elements
594
- that are allowed inside document sections. This style runs asciidoc(1)
595
- as a filter to process cell contents. See also <a class="link" href="tables.html#X83" title="DocBook table limitations">Docbook table limitations</a>.
596
- </dd>
597
- <dt><span class="term">
598
- literal
599
- </span></dt>
600
- <dd>
601
- No text formatting; monospaced font; all line breaks are retained
602
- (the same as the AsciiDoc <a class="link" href="delimited_blocks.html#X65" title="Literal Blocks">LiteralBlock</a> element).
603
- </dd>
604
- <dt><span class="term">
605
- verse
606
- </span></dt>
607
- <dd>
608
- All line breaks are retained (just like the AsciiDoc <a class="link" href="paragraphs.html#X94" title="quote and verse paragraph styles">verse paragraph style</a>).
609
- </dd>
610
- </dl></div>
611
- </div>
612
- <div class="section" lang="en" xml:lang="en">
613
- <div class="titlepage"><div><div><h3 class="title">
614
- <a id="X72"></a>Markup attributes</h3></div></div></div>
615
- <p>AsciiDoc makes a number of attributes available to table markup
616
- templates and tags. Column specific attributes are available when
617
- substituting the <span class="emphasis"><em>colspec</em></span> cell data tags.</p>
618
- <div class="variablelist"><dl>
619
- <dt><span class="term">
620
- pageunits
621
- </span></dt>
622
- <dd>
623
- DocBook backend only. Specifies table column absolute width units.
624
- Defaults to <span class="emphasis"><em>*</em></span>.
625
- </dd>
626
- <dt><span class="term">
627
- pagewidth
628
- </span></dt>
629
- <dd>
630
- DocBook backend only. The nominal output page width in <span class="emphasis"><em>pageunit</em></span>
631
- units. Used to calculate CALS tables absolute column and table
632
- widths. Defaults to <span class="emphasis"><em>425</em></span>.
633
- </dd>
634
- <dt><span class="term">
635
- tableabswidth
636
- </span></dt>
637
- <dd>
638
- Integer value calculated from <span class="emphasis"><em>width</em></span> and <span class="emphasis"><em>pagewidth</em></span> attributes.
639
- In <span class="emphasis"><em>pageunit</em></span> units.
640
- </dd>
641
- <dt><span class="term">
642
- tablepcwidth
643
- </span></dt>
644
- <dd>
645
- Table width expressed as a percentage of the available width. Integer
646
- value (0..100).
647
- </dd>
648
- <dt><span class="term">
649
- colabswidth
650
- </span></dt>
651
- <dd>
652
- Integer value calculated from <span class="emphasis"><em>cols</em></span> column width, <span class="emphasis"><em>width</em></span> and
653
- <span class="emphasis"><em>pagewidth</em></span> attributes. In <span class="emphasis"><em>pageunit</em></span> units.
654
- </dd>
655
- <dt><span class="term">
656
- colpcwidth
657
- </span></dt>
658
- <dd>
659
- Column width expressed as a percentage of the table width. Integer
660
- value (0..100).
661
- </dd>
662
- <dt><span class="term">
663
- colcount
664
- </span></dt>
665
- <dd>
666
- Total number of table columns.
667
- </dd>
668
- <dt><span class="term">
669
- rowcount
670
- </span></dt>
671
- <dd>
672
- Total number of table rows.
673
- </dd>
674
- <dt><span class="term">
675
- halign
676
- </span></dt>
677
- <dd>
678
- Horizontal cell content alignment: <span class="emphasis"><em>left</em></span>, <span class="emphasis"><em>right</em></span> or <span class="emphasis"><em>center</em></span>.
679
- </dd>
680
- <dt><span class="term">
681
- valign
682
- </span></dt>
683
- <dd>
684
- Vertical cell content alignment: <span class="emphasis"><em>top</em></span>, <span class="emphasis"><em>bottom</em></span> or <span class="emphasis"><em>middle</em></span>.
685
- </dd>
686
- <dt><span class="term">
687
- colnumber, colstart
688
- </span></dt>
689
- <dd>
690
- The number of the leftmost column occupied by the cell (1…).
691
- </dd>
692
- <dt><span class="term">
693
- colend
694
- </span></dt>
695
- <dd>
696
- The number of the rightmost column occupied by the cell (1…).
697
- </dd>
698
- <dt><span class="term">
699
- colspan
700
- </span></dt>
701
- <dd>
702
- Number of columns the cell should span.
703
- </dd>
704
- <dt><span class="term">
705
- rowspan
706
- </span></dt>
707
- <dd>
708
- Number of rows the cell should span (1…).
709
- </dd>
710
- <dt><span class="term">
711
- morerows
712
- </span></dt>
713
- <dd>
714
- Number of additional rows the cell should span (0…).
715
- </dd>
716
- </dl></div>
717
- </div>
718
- <div class="section" lang="en" xml:lang="en">
719
- <div class="titlepage"><div><div><h3 class="title">
720
- <a id="_nested_tables"></a>Nested tables</h3></div></div></div>
721
- <p>An alternative <span class="emphasis"><em>psv</em></span> separator character <span class="emphasis"><em>!</em></span> can be used (instead of
722
- <span class="emphasis"><em>|</em></span>) in nested tables. This allows a single level of table nesting.
723
- Columns containing nested tables must use the <span class="emphasis"><em>asciidoc</em></span> style. An
724
- example can be found in <code class="literal">./examples/website/newtables.txt</code>.</p>
725
- </div>
726
- <div class="section" lang="en" xml:lang="en">
727
- <div class="titlepage"><div><div><h3 class="title">
728
- <a id="X83"></a>DocBook table limitations</h3></div></div></div>
729
- <p>Fully implementing tables is not trivial, some DocBook toolchains do
730
- better than others. AsciiDoc HTML table outputs are rendered
731
- correctly in all the popular browsers — if your DocBook generated
732
- tables don’t look right compare them with the output generated by the
733
- AsciiDoc <span class="emphasis"><em>xhtml11</em></span> backend or try a different DocBook toolchain. Here
734
- is a list of things to be aware of:</p>
735
- <div class="itemizedlist"><ul type="disc">
736
- <li>
737
- <p>
738
- Although nested tables are not legal in DocBook 4 the FOP and
739
- dblatex toolchains will process them correctly. If you use <code class="literal">a2x(1)</code>
740
- you will need to include the <code class="literal">--no-xmllint</code> option to suppress
741
- DocBook validation errors.
742
- </p>
743
- <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
744
- <h3 class="title">Note</h3>
745
- <p>Technically you can nest DocBook 4 tables one level using the
746
- <span class="emphasis"><em>entrytbl</em></span> element, but not all toolchains process <span class="emphasis"><em>entrytbl</em></span>.</p>
747
- </div>
748
- </li>
749
- <li>
750
- DocBook only allows a subset of block elements inside table cells so
751
- not all AsciiDoc elements produce valid DocBook inside table cells.
752
- If you get validation errors running <code class="literal">a2x(1)</code> try the <code class="literal">--no-xmllint</code>
753
- option, toolchains will often process nested block elements such as
754
- sidebar blocks and floating titles correctly even though, strictly
755
- speaking, they are not legal.
756
- </li>
757
- <li>
758
- Text formatting in cells using the <span class="emphasis"><em>monospaced</em></span> table style will
759
- raise validation errors because the DocBook <span class="emphasis"><em>literal</em></span> element was
760
- not designed to support formatted text (using the <span class="emphasis"><em>literal</em></span> element
761
- is a kludge on the part of AsciiDoc as there is no easy way to set
762
- the font style in DocBook.
763
- </li>
764
- <li>
765
- Cell alignments are ignored for <span class="emphasis"><em>verse</em></span>, <span class="emphasis"><em>literal</em></span> or <span class="emphasis"><em>asciidoc</em></span>
766
- table styles.
767
- </li>
768
- </ul></div>
769
- </div>
770
- </div>
771
-
772
- </div>
773
-
774
- <hr/>
775
-
776
- <div class="nav" id="navfooter">
777
- <table width="100%">
778
- <tr><td width="33%" align="left">
779
-
780
- <a href="macros.html">Prev</a><br/>
781
- Macros
782
-
783
- </td><td width="33%" align="center">
784
-
785
- <a href="index.html">Home</a><br/>
786
- AsciiDoc User Guide
787
-
788
- </td><td width="33%" align="right">
789
-
790
- <a href="manpage_documents.html">Next</a><br/>
791
- Manpage Documents
792
-
793
- </td></tr>
794
- </table>
795
- </div>
796
- </body>
797
- </html>