asciidoctor 1.5.8 → 2.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (197) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +11 -0
  3. data/CHANGELOG.adoc +628 -45
  4. data/LICENSE +2 -1
  5. data/README-de.adoc +28 -38
  6. data/README-fr.adoc +30 -43
  7. data/README-jp.adoc +255 -201
  8. data/README-zh_CN.adoc +40 -44
  9. data/README.adoc +170 -143
  10. data/asciidoctor.gemspec +22 -34
  11. data/bin/asciidoctor +5 -4
  12. data/data/locale/attributes-ar.adoc +4 -3
  13. data/data/locale/attributes-be.adoc +23 -0
  14. data/data/locale/attributes-bg.adoc +4 -3
  15. data/data/locale/attributes-ca.adoc +6 -5
  16. data/data/locale/attributes-cs.adoc +4 -3
  17. data/data/locale/attributes-da.adoc +6 -5
  18. data/data/locale/attributes-de.adoc +6 -5
  19. data/data/locale/attributes-en.adoc +4 -4
  20. data/data/locale/attributes-es.adoc +6 -5
  21. data/data/locale/attributes-fa.adoc +4 -3
  22. data/data/locale/attributes-fi.adoc +4 -3
  23. data/data/locale/attributes-fr.adoc +8 -7
  24. data/data/locale/attributes-hu.adoc +4 -3
  25. data/data/locale/attributes-id.adoc +4 -3
  26. data/data/locale/attributes-it.adoc +6 -5
  27. data/data/locale/attributes-ja.adoc +4 -3
  28. data/data/locale/{attributes-kr.adoc → attributes-ko.adoc} +4 -3
  29. data/data/locale/attributes-nb.adoc +4 -3
  30. data/data/locale/attributes-nl.adoc +6 -5
  31. data/data/locale/attributes-nn.adoc +4 -3
  32. data/data/locale/attributes-pl.adoc +8 -7
  33. data/data/locale/attributes-pt.adoc +6 -5
  34. data/data/locale/attributes-pt_BR.adoc +6 -5
  35. data/data/locale/attributes-ro.adoc +4 -3
  36. data/data/locale/attributes-ru.adoc +6 -5
  37. data/data/locale/attributes-sr.adoc +4 -4
  38. data/data/locale/attributes-sr_Latn.adoc +4 -4
  39. data/data/locale/attributes-sv.adoc +4 -4
  40. data/data/locale/attributes-th.adoc +23 -0
  41. data/data/locale/attributes-tr.adoc +4 -3
  42. data/data/locale/attributes-uk.adoc +6 -5
  43. data/data/locale/attributes-vi.adoc +23 -0
  44. data/data/locale/attributes-zh_CN.adoc +4 -3
  45. data/data/locale/attributes-zh_TW.adoc +4 -3
  46. data/data/reference/syntax.adoc +296 -0
  47. data/data/stylesheets/asciidoctor-default.css +120 -114
  48. data/data/stylesheets/coderay-asciidoctor.css +15 -17
  49. data/lib/asciidoctor/abstract_block.rb +146 -140
  50. data/lib/asciidoctor/abstract_node.rb +152 -170
  51. data/lib/asciidoctor/attribute_list.rb +77 -89
  52. data/lib/asciidoctor/block.rb +29 -28
  53. data/lib/asciidoctor/callouts.rb +4 -2
  54. data/lib/asciidoctor/cli/invoker.rb +20 -24
  55. data/lib/asciidoctor/cli/options.rb +107 -96
  56. data/lib/asciidoctor/cli.rb +3 -2
  57. data/lib/asciidoctor/convert.rb +199 -0
  58. data/lib/asciidoctor/converter/composite.rb +40 -48
  59. data/lib/asciidoctor/converter/docbook5.rb +627 -644
  60. data/lib/asciidoctor/converter/html5.rb +1053 -951
  61. data/lib/asciidoctor/converter/manpage.rb +581 -532
  62. data/lib/asciidoctor/converter/template.rb +232 -271
  63. data/lib/asciidoctor/converter.rb +370 -185
  64. data/lib/asciidoctor/core_ext/float/truncate.rb +20 -0
  65. data/lib/asciidoctor/core_ext/hash/merge.rb +8 -0
  66. data/lib/asciidoctor/core_ext/match_data/names.rb +7 -0
  67. data/lib/asciidoctor/core_ext/nil_or_empty.rb +1 -0
  68. data/lib/asciidoctor/core_ext/regexp/is_match.rb +4 -2
  69. data/lib/asciidoctor/core_ext.rb +8 -17
  70. data/lib/asciidoctor/document.rb +503 -461
  71. data/lib/asciidoctor/extensions.rb +127 -174
  72. data/lib/asciidoctor/helpers.rb +184 -107
  73. data/lib/asciidoctor/inline.rb +9 -12
  74. data/lib/asciidoctor/list.rb +11 -29
  75. data/lib/asciidoctor/load.rb +119 -0
  76. data/lib/asciidoctor/logging.rb +22 -17
  77. data/lib/asciidoctor/parser.rb +673 -719
  78. data/lib/asciidoctor/path_resolver.rb +48 -33
  79. data/lib/asciidoctor/reader.rb +383 -338
  80. data/lib/asciidoctor/rouge_ext.rb +39 -0
  81. data/lib/asciidoctor/rx.rb +723 -0
  82. data/lib/asciidoctor/section.rb +17 -16
  83. data/lib/asciidoctor/stylesheets.rb +19 -37
  84. data/lib/asciidoctor/substitutors.rb +926 -1022
  85. data/lib/asciidoctor/syntax_highlighter/coderay.rb +88 -0
  86. data/lib/asciidoctor/syntax_highlighter/highlightjs.rb +34 -0
  87. data/lib/asciidoctor/syntax_highlighter/html_pipeline.rb +10 -0
  88. data/lib/asciidoctor/syntax_highlighter/prettify.rb +30 -0
  89. data/lib/asciidoctor/syntax_highlighter/pygments.rb +157 -0
  90. data/lib/asciidoctor/syntax_highlighter/rouge.rb +143 -0
  91. data/lib/asciidoctor/syntax_highlighter.rb +253 -0
  92. data/lib/asciidoctor/table.rb +152 -114
  93. data/lib/asciidoctor/timings.rb +7 -5
  94. data/lib/asciidoctor/version.rb +2 -1
  95. data/lib/asciidoctor/writer.rb +30 -0
  96. data/lib/asciidoctor.rb +266 -1340
  97. data/man/asciidoctor.1 +49 -47
  98. data/man/asciidoctor.adoc +54 -45
  99. metadata +50 -245
  100. data/CONTRIBUTING.adoc +0 -185
  101. data/Gemfile +0 -60
  102. data/Rakefile +0 -129
  103. data/bin/asciidoctor-safe +0 -15
  104. data/features/open_block.feature +0 -92
  105. data/features/pass_block.feature +0 -66
  106. data/features/step_definitions.rb +0 -49
  107. data/features/text_formatting.feature +0 -57
  108. data/features/xref.feature +0 -1039
  109. data/lib/asciidoctor/converter/base.rb +0 -59
  110. data/lib/asciidoctor/converter/docbook45.rb +0 -93
  111. data/lib/asciidoctor/converter/factory.rb +0 -226
  112. data/lib/asciidoctor/core_ext/1.8.7/base64/strict_encode64.rb +0 -6
  113. data/lib/asciidoctor/core_ext/1.8.7/concurrent/hash.rb +0 -5
  114. data/lib/asciidoctor/core_ext/1.8.7/hash/key.rb +0 -4
  115. data/lib/asciidoctor/core_ext/1.8.7/io/binread.rb +0 -6
  116. data/lib/asciidoctor/core_ext/1.8.7/io/write.rb +0 -5
  117. data/lib/asciidoctor/core_ext/1.8.7/string/chr.rb +0 -6
  118. data/lib/asciidoctor/core_ext/1.8.7/string/limit_bytesize.rb +0 -29
  119. data/lib/asciidoctor/core_ext/1.8.7/symbol/empty.rb +0 -6
  120. data/lib/asciidoctor/core_ext/1.8.7/symbol/length.rb +0 -6
  121. data/lib/asciidoctor/core_ext/string/limit_bytesize.rb +0 -10
  122. data/test/api_test.rb +0 -1240
  123. data/test/attribute_list_test.rb +0 -242
  124. data/test/attributes_test.rb +0 -1623
  125. data/test/blocks_test.rb +0 -3870
  126. data/test/converter_test.rb +0 -470
  127. data/test/document_test.rb +0 -1853
  128. data/test/extensions_test.rb +0 -1560
  129. data/test/fixtures/asciidoc_index.txt +0 -521
  130. data/test/fixtures/basic-docinfo-footer.html +0 -6
  131. data/test/fixtures/basic-docinfo-footer.xml +0 -8
  132. data/test/fixtures/basic-docinfo.html +0 -1
  133. data/test/fixtures/basic-docinfo.xml +0 -4
  134. data/test/fixtures/basic.asciidoc +0 -5
  135. data/test/fixtures/chapter-a.adoc +0 -3
  136. data/test/fixtures/child-include.adoc +0 -5
  137. data/test/fixtures/circle.svg +0 -9
  138. data/test/fixtures/custom-backends/erb/html5/block_paragraph.html.erb +0 -6
  139. data/test/fixtures/custom-backends/haml/docbook45/block_paragraph.xml.haml +0 -6
  140. data/test/fixtures/custom-backends/haml/html5/block_paragraph.html.haml +0 -3
  141. data/test/fixtures/custom-backends/haml/html5/block_sidebar.html.haml +0 -5
  142. data/test/fixtures/custom-backends/haml/html5-tweaks/block_paragraph.html.haml +0 -1
  143. data/test/fixtures/custom-backends/slim/docbook45/block_paragraph.xml.slim +0 -6
  144. data/test/fixtures/custom-backends/slim/html5/block_paragraph.html.slim +0 -3
  145. data/test/fixtures/custom-backends/slim/html5/block_sidebar.html.slim +0 -5
  146. data/test/fixtures/custom-docinfodir/basic-docinfo.html +0 -1
  147. data/test/fixtures/custom-docinfodir/docinfo.html +0 -1
  148. data/test/fixtures/docinfo-footer.html +0 -1
  149. data/test/fixtures/docinfo-footer.xml +0 -9
  150. data/test/fixtures/docinfo.html +0 -1
  151. data/test/fixtures/docinfo.xml +0 -3
  152. data/test/fixtures/doctime-localtime.adoc +0 -2
  153. data/test/fixtures/dot.gif +0 -0
  154. data/test/fixtures/encoding.asciidoc +0 -13
  155. data/test/fixtures/file-with-missing-include.adoc +0 -1
  156. data/test/fixtures/grandchild-include.adoc +0 -3
  157. data/test/fixtures/hello-asciidoctor.pdf +0 -69
  158. data/test/fixtures/include-file.asciidoc +0 -24
  159. data/test/fixtures/include-file.jsx +0 -8
  160. data/test/fixtures/include-file.ml +0 -3
  161. data/test/fixtures/include-file.xml +0 -5
  162. data/test/fixtures/lists.adoc +0 -96
  163. data/test/fixtures/master.adoc +0 -5
  164. data/test/fixtures/mismatched-end-tag.adoc +0 -7
  165. data/test/fixtures/other-chapters.adoc +0 -11
  166. data/test/fixtures/outer-include.adoc +0 -5
  167. data/test/fixtures/parent-include-restricted.adoc +0 -5
  168. data/test/fixtures/parent-include.adoc +0 -5
  169. data/test/fixtures/sample.asciidoc +0 -30
  170. data/test/fixtures/section-a.adoc +0 -4
  171. data/test/fixtures/stylesheets/custom.css +0 -3
  172. data/test/fixtures/subdir/index.adoc +0 -3
  173. data/test/fixtures/subdir/inner-include.adoc +0 -3
  174. data/test/fixtures/subdir/middle-include.adoc +0 -5
  175. data/test/fixtures/subs-docinfo.html +0 -2
  176. data/test/fixtures/subs.adoc +0 -6
  177. data/test/fixtures/tagged-class-enclosed.rb +0 -25
  178. data/test/fixtures/tagged-class.rb +0 -23
  179. data/test/fixtures/tip.gif +0 -0
  180. data/test/fixtures/unclosed-tag.adoc +0 -3
  181. data/test/fixtures/unexpected-end-tag.adoc +0 -4
  182. data/test/invoker_test.rb +0 -745
  183. data/test/links_test.rb +0 -855
  184. data/test/lists_test.rb +0 -5151
  185. data/test/logger_test.rb +0 -211
  186. data/test/manpage_test.rb +0 -660
  187. data/test/options_test.rb +0 -262
  188. data/test/paragraphs_test.rb +0 -562
  189. data/test/parser_test.rb +0 -742
  190. data/test/paths_test.rb +0 -395
  191. data/test/preamble_test.rb +0 -173
  192. data/test/reader_test.rb +0 -2161
  193. data/test/sections_test.rb +0 -3575
  194. data/test/substitutions_test.rb +0 -2066
  195. data/test/tables_test.rb +0 -2036
  196. data/test/test_helper.rb +0 -447
  197. data/test/text_test.rb +0 -309
@@ -1,1039 +0,0 @@
1
- # language: en
2
- Feature: Cross References
3
- In order to create cross references between sections and blocks in the current or neighboring document
4
- As a writer
5
- I want to be able to use the cross reference macro to compose these references
6
-
7
- Scenario: Create a cross reference to a block that has explicit reftext
8
- Given the AsciiDoc source
9
- """
10
- :xrefstyle: full
11
-
12
- See <<param-type-t>> to learn how it works.
13
-
14
- .Parameterized Type <T>
15
- [[param-type-t,that "<T>" thing]]
16
- ****
17
- This sidebar describes what that <T> thing is all about.
18
- ****
19
- """
20
- When it is converted to html
21
- Then the result should contain the HTML structure
22
- """
23
- |See
24
- a<> href='#param-type-t' that "&lt;T&gt;" thing
25
- |to learn how it works.
26
- """
27
- When it is converted to docbook
28
- Then the result should match the XML structure
29
- """
30
- simpara
31
- |See
32
- xref<> linkend='param-type-t'/
33
- |to learn how it works.
34
- sidebar xml:id='param-type-t' xreflabel='that &quot;&lt;T&gt;&quot; thing'
35
- title Parameterized Type &lt;T&gt;
36
- simpara This sidebar describes what that &lt;T&gt; thing is all about.
37
- """
38
-
39
- Scenario: Create a cross reference to a block that has explicit reftext with formatting
40
- Given the AsciiDoc source
41
- """
42
- :xrefstyle: full
43
-
44
- There are cats, then there are the <<big-cats>>.
45
-
46
- [[big-cats,*big* cats]]
47
- == Big Cats
48
-
49
- So ferocious.
50
- """
51
- When it is converted to html
52
- Then the result should contain the HTML structure
53
- """
54
- |There are cats, then there are the
55
- a< href='#big-cats' <strong>big</strong> cats
56
- |.
57
- """
58
- When it is converted to docbook
59
- Then the result should match the XML structure
60
- """
61
- simpara
62
- |There are cats, then there are the
63
- xref< linkend='big-cats'/
64
- |.
65
- section xml:id='big-cats' xreflabel='big cats'
66
- title Big Cats
67
- simpara So ferocious.
68
- """
69
-
70
- Scenario: Create a full cross reference to a numbered section
71
- Given the AsciiDoc source
72
- """
73
- :sectnums:
74
- :xrefstyle: full
75
-
76
- See <<sect-features>> to find a complete list of features.
77
-
78
- == About
79
-
80
- [#sect-features]
81
- === Features
82
-
83
- All the features are listed in this section.
84
- """
85
- When it is converted to html
86
- Then the result should contain the HTML structure
87
- """
88
- |See
89
- a<> href='#sect-features' Section 1.1, &#8220;Features&#8221;
90
- |to find a complete list of features.
91
- """
92
-
93
- Scenario: Create a short cross reference to a numbered section
94
- Given the AsciiDoc source
95
- """
96
- :sectnums:
97
- :xrefstyle: short
98
-
99
- See <<sect-features>> to find a complete list of features.
100
-
101
- [#sect-features]
102
- == Features
103
-
104
- All the features are listed in this section.
105
- """
106
- When it is converted to html
107
- Then the result should contain the HTML structure
108
- """
109
- |See
110
- a<> href='#sect-features' Section 1
111
- |to find a complete list of features.
112
- """
113
-
114
- Scenario: Create a basic cross reference to an unnumbered section
115
- Given the AsciiDoc source
116
- """
117
- :xrefstyle: full
118
-
119
- See <<sect-features>> to find a complete list of features.
120
-
121
- [#sect-features]
122
- == Features
123
-
124
- All the features are listed in this section.
125
- """
126
- When it is converted to html
127
- Then the result should contain the HTML structure
128
- """
129
- |See
130
- a<> href='#sect-features' Features
131
- |to find a complete list of features.
132
- """
133
-
134
- Scenario: Create a basic cross reference to a numbered section when the section reference signifier is disabled
135
- Given the AsciiDoc source
136
- """
137
- :sectnums:
138
- :xrefstyle: full
139
- :!section-refsig:
140
-
141
- See <<sect-features>> to find a complete list of features.
142
-
143
- [#sect-features]
144
- == Features
145
-
146
- All the features are listed in this section.
147
- """
148
- When it is converted to html
149
- Then the result should contain the HTML structure
150
- """
151
- |See
152
- a<> href='#sect-features' 1, &#8220;Features&#8221;
153
- |to find a complete list of features.
154
- """
155
-
156
- Scenario: Create a full cross reference to a numbered chapter
157
- Given the AsciiDoc source
158
- """
159
- :doctype: book
160
- :sectnums:
161
- :xrefstyle: full
162
-
163
- See <<chap-features>> to find a complete list of features.
164
-
165
- [#chap-features]
166
- == Features
167
-
168
- All the features are listed in this chapter.
169
- """
170
- When it is converted to html
171
- Then the result should contain the HTML structure
172
- """
173
- |See
174
- a<> href='#chap-features' Chapter 1, <em>Features</em>
175
- |to find a complete list of features.
176
- """
177
-
178
- Scenario: Create a short cross reference to a numbered chapter
179
- Given the AsciiDoc source
180
- """
181
- :doctype: book
182
- :sectnums:
183
- :xrefstyle: short
184
-
185
- See <<chap-features>> to find a complete list of features.
186
-
187
- [#chap-features]
188
- == Features
189
-
190
- All the features are listed in this chapter.
191
- """
192
- When it is converted to html
193
- Then the result should contain the HTML structure
194
- """
195
- |See
196
- a<> href='#chap-features' Chapter 1
197
- |to find a complete list of features.
198
- """
199
-
200
- Scenario: Create a basic cross reference to a numbered chapter
201
- Given the AsciiDoc source
202
- """
203
- :doctype: book
204
- :sectnums:
205
- :xrefstyle: basic
206
-
207
- See <<chap-features>> to find a complete list of features.
208
-
209
- [#chap-features]
210
- == Features
211
-
212
- All the features are listed in this chapter.
213
- """
214
- When it is converted to html
215
- Then the result should contain the HTML structure
216
- """
217
- |See
218
- a<> href='#chap-features' <em>Features</em>
219
- |to find a complete list of features.
220
- """
221
-
222
- Scenario: Create a basic cross reference to an unnumbered chapter
223
- Given the AsciiDoc source
224
- """
225
- :doctype: book
226
- :xrefstyle: full
227
-
228
- See <<chap-features>> to find a complete list of features.
229
-
230
- [#chap-features]
231
- == Features
232
-
233
- All the features are listed in this chapter.
234
- """
235
- When it is converted to html
236
- Then the result should contain the HTML structure
237
- """
238
- |See
239
- a<> href='#chap-features' <em>Features</em>
240
- |to find a complete list of features.
241
- """
242
-
243
- Scenario: Create a cross reference to a chapter using a custom chapter reference signifier
244
- Given the AsciiDoc source
245
- """
246
- :doctype: book
247
- :sectnums:
248
- :xrefstyle: full
249
- :chapter-refsig: Ch
250
-
251
- See <<chap-features>> to find a complete list of features.
252
-
253
- [#chap-features]
254
- == Features
255
-
256
- All the features are listed in this chapter.
257
- """
258
- When it is converted to html
259
- Then the result should contain the HTML structure
260
- """
261
- |See
262
- a<> href='#chap-features' Ch 1, <em>Features</em>
263
- |to find a complete list of features.
264
- """
265
-
266
- Scenario: Create a full cross reference to a numbered part
267
- Given the AsciiDoc source
268
- """
269
- :doctype: book
270
- :sectnums:
271
- :partnums:
272
- :xrefstyle: full
273
-
274
- [preface]
275
- = Preface
276
-
277
- See <<p1>> for an introduction to the language.
278
-
279
- [#p1]
280
- = Language
281
-
282
- == Syntax
283
-
284
- This chapter covers the syntax.
285
- """
286
- When it is converted to html
287
- Then the result should contain the HTML structure
288
- """
289
- |See
290
- a<> href='#p1' Part I, &#8220;Language&#8221;
291
- |for an introduction to the language.
292
- """
293
-
294
- Scenario: Create a short cross reference to a numbered part
295
- Given the AsciiDoc source
296
- """
297
- :doctype: book
298
- :sectnums:
299
- :partnums:
300
- :xrefstyle: short
301
-
302
- [preface]
303
- = Preface
304
-
305
- See <<p1>> for an introduction to the language.
306
-
307
- [#p1]
308
- = Language
309
-
310
- == Syntax
311
-
312
- This chapter covers the syntax.
313
- """
314
- When it is converted to html
315
- Then the result should contain the HTML structure
316
- """
317
- |See
318
- a<> href='#p1' Part I
319
- |for an introduction to the language.
320
- """
321
-
322
- Scenario: Create a basic cross reference to a numbered part
323
- Given the AsciiDoc source
324
- """
325
- :doctype: book
326
- :sectnums:
327
- :partnums:
328
- :xrefstyle: basic
329
-
330
- [preface]
331
- = Preface
332
-
333
- See <<p1>> for an introduction to the language.
334
-
335
- [#p1]
336
- = Language
337
-
338
- == Syntax
339
-
340
- This chapter covers the syntax.
341
- """
342
- When it is converted to html
343
- Then the result should contain the HTML structure
344
- """
345
- |See
346
- a<> href='#p1' Language
347
- |for an introduction to the language.
348
- """
349
-
350
- Scenario: Create a basic cross reference to an unnumbered part
351
- Given the AsciiDoc source
352
- """
353
- :doctype: book
354
- :sectnums:
355
- :xrefstyle: full
356
-
357
- [preface]
358
- = Preface
359
-
360
- See <<p1>> for an introduction to the language.
361
-
362
- [#p1]
363
- = Language
364
-
365
- == Syntax
366
-
367
- This chapter covers the syntax.
368
- """
369
- When it is converted to html
370
- Then the result should contain the HTML structure
371
- """
372
- |See
373
- a<> href='#p1' Language
374
- |for an introduction to the language.
375
- """
376
-
377
- @wip
378
- Scenario: Create a cross reference to a part using a custom part reference signifier
379
- Given the AsciiDoc source
380
- """
381
- :doctype: book
382
- :sectnums:
383
- :partnums:
384
- :xrefstyle: full
385
- :part-refsig: P
386
-
387
- [preface]
388
- = Preface
389
-
390
- See <<p1>> for an introduction to the language.
391
-
392
- [#p1]
393
- = Language
394
-
395
- == Syntax
396
-
397
- This chapter covers the syntax.
398
- """
399
- When it is converted to html
400
- Then the result should contain the HTML structure
401
- """
402
- |See
403
- a<> href='#p1' P I, &#8220;Language&#8221;
404
- |for an introduction to the language.
405
- """
406
-
407
- Scenario: Create a full cross reference to a numbered appendix
408
- Given the AsciiDoc source
409
- """
410
- :sectnums:
411
- :xrefstyle: full
412
-
413
- See <<app-features>> to find a complete list of features.
414
-
415
- [appendix#app-features]
416
- == Features
417
-
418
- All the features are listed in this appendix.
419
- """
420
- When it is converted to html
421
- Then the result should contain the HTML structure
422
- """
423
- |See
424
- a<> href='#app-features' Appendix A, <em>Features</em>
425
- |to find a complete list of features.
426
- """
427
-
428
- Scenario: Create a short cross reference to a numbered appendix
429
- Given the AsciiDoc source
430
- """
431
- :sectnums:
432
- :xrefstyle: short
433
-
434
- See <<app-features>> to find a complete list of features.
435
-
436
- [appendix#app-features]
437
- == Features
438
-
439
- All the features are listed in this appendix.
440
- """
441
- When it is converted to html
442
- Then the result should contain the HTML structure
443
- """
444
- |See
445
- a<> href='#app-features' Appendix A
446
- |to find a complete list of features.
447
- """
448
-
449
- Scenario: Create a full cross reference to an appendix even when section numbering is disabled
450
- Given the AsciiDoc source
451
- """
452
- :xrefstyle: full
453
-
454
- See <<app-features>> to find a complete list of features.
455
-
456
- [appendix#app-features]
457
- == Features
458
-
459
- All the features are listed in this appendix.
460
- """
461
- When it is converted to html
462
- Then the result should contain the HTML structure
463
- """
464
- |See
465
- a<> href='#app-features' Appendix A, <em>Features</em>
466
- |to find a complete list of features.
467
- """
468
-
469
- Scenario: Create a full cross reference to a numbered formal block
470
- Given the AsciiDoc source
471
- """
472
- :xrefstyle: full
473
-
474
- See <<tbl-features>> to find a table of features.
475
-
476
- .Features
477
- [#tbl-features%autowidth]
478
- |===
479
- |Text formatting |Formats text for display.
480
- |===
481
- """
482
- When it is converted to html
483
- Then the result should contain the HTML structure
484
- """
485
- |See
486
- a<> href='#tbl-features' Table 1, &#8220;Features&#8221;
487
- |to find a table of features.
488
- """
489
-
490
- Scenario: Create a short cross reference to a numbered formal block
491
- Given the AsciiDoc source
492
- """
493
- :xrefstyle: short
494
-
495
- See <<tbl-features>> to find a table of features.
496
-
497
- .Features
498
- [#tbl-features%autowidth]
499
- |===
500
- |Text formatting |Formats text for display.
501
- |===
502
- """
503
- When it is converted to html
504
- Then the result should contain the HTML structure
505
- """
506
- |See
507
- a<> href='#tbl-features' Table 1
508
- |to find a table of features.
509
- """
510
-
511
- Scenario: Create a basic cross reference to a numbered formal block when the caption prefix is disabled
512
- Given the AsciiDoc source
513
- """
514
- :xrefstyle: full
515
- :!table-caption:
516
-
517
- See <<tbl-features>> to find a table of features.
518
-
519
- .Features
520
- [#tbl-features%autowidth]
521
- |===
522
- |Text formatting |Formats text for display.
523
- |===
524
- """
525
- When it is converted to html
526
- Then the result should contain the HTML structure
527
- """
528
- |See
529
- a<> href='#tbl-features' Features
530
- |to find a table of features.
531
- """
532
-
533
- Scenario: Create a cross reference to a numbered formal block with a custom caption prefix
534
- Given the AsciiDoc source
535
- """
536
- :xrefstyle: full
537
- :table-caption: Tbl
538
-
539
- See <<tbl-features>> to find a table of features.
540
-
541
- .Features
542
- [#tbl-features%autowidth]
543
- |===
544
- |Text formatting |Formats text for display.
545
- |===
546
- """
547
- When it is converted to html
548
- Then the result should contain the HTML structure
549
- """
550
- |See
551
- a<> href='#tbl-features' Tbl 1, &#8220;Features&#8221;
552
- |to find a table of features.
553
- """
554
-
555
- Scenario: Create a full cross reference to a formal image block
556
- Given the AsciiDoc source
557
- """
558
- :xrefstyle: full
559
-
560
- Behold, <<tiger>>!
561
-
562
- .The ferocious Ghostscript tiger
563
- [#tiger]
564
- image::tiger.svg[Ghostscript tiger]
565
- """
566
- When it is converted to html
567
- Then the result should match the HTML structure
568
- """
569
- .paragraph: p
570
- |Behold,
571
- a< href='#tiger' Figure 1, &#8220;The ferocious Ghostscript tiger&#8221;
572
- |!
573
- #tiger.imageblock
574
- .content: img src='tiger.svg' alt='Ghostscript tiger'
575
- .title Figure 1. The ferocious Ghostscript tiger
576
- """
577
-
578
- Scenario: Create a short cross reference to a formal image block
579
- Given the AsciiDoc source
580
- """
581
- :xrefstyle: short
582
-
583
- Behold, <<tiger>>!
584
-
585
- .The ferocious Ghostscript tiger
586
- [#tiger]
587
- image::tiger.svg[Ghostscript tiger]
588
- """
589
- When it is converted to html
590
- Then the result should match the HTML structure
591
- """
592
- .paragraph: p
593
- |Behold,
594
- a< href='#tiger' Figure 1
595
- |!
596
- #tiger.imageblock
597
- .content: img src='tiger.svg' alt='Ghostscript tiger'
598
- .title Figure 1. The ferocious Ghostscript tiger
599
- """
600
-
601
- Scenario: Create a full cross reference to a block with an explicit caption
602
- Given the AsciiDoc source
603
- """
604
- :xrefstyle: full
605
-
606
- See <<diagram-1>> and <<diagram-2>>.
607
-
608
- .Managing Orders
609
- [#diagram-1,caption="Diagram {counter:diag-number}. "]
610
- image::managing-orders.png[Managing Orders]
611
-
612
- .Managing Inventory
613
- [#diagram-2,caption="Diagram {counter:diag-number}. "]
614
- image::managing-inventory.png[Managing Inventory]
615
- """
616
- When it is converted to html
617
- Then the result should match the HTML structure
618
- """
619
- .paragraph: p
620
- |See
621
- a<> href='#diagram-1' Diagram 1, &#8220;Managing Orders&#8221;
622
- |and
623
- a< href='#diagram-2' Diagram 2, &#8220;Managing Inventory&#8221;
624
- |.
625
- #diagram-1.imageblock
626
- .content: img src='managing-orders.png' alt='Managing Orders'
627
- .title Diagram 1. Managing Orders
628
- #diagram-2.imageblock
629
- .content: img src='managing-inventory.png' alt='Managing Inventory'
630
- .title Diagram 2. Managing Inventory
631
- """
632
-
633
- Scenario: Create a short cross reference to a block with an explicit caption
634
- Given the AsciiDoc source
635
- """
636
- :xrefstyle: short
637
-
638
- See <<diagram-1>> and <<diagram-2>>.
639
-
640
- .Managing Orders
641
- [#diagram-1,caption="Diagram {counter:diag-number}. "]
642
- image::managing-orders.png[Managing Orders]
643
-
644
- .Managing Inventory
645
- [#diagram-2,caption="Diagram {counter:diag-number}. "]
646
- image::managing-inventory.png[Managing Inventory]
647
- """
648
- When it is converted to html
649
- Then the result should match the HTML structure
650
- """
651
- .paragraph: p
652
- |See
653
- a<> href='#diagram-1' Diagram 1
654
- |and
655
- a< href='#diagram-2' Diagram 2
656
- |.
657
- #diagram-1.imageblock
658
- .content: img src='managing-orders.png' alt='Managing Orders'
659
- .title Diagram 1. Managing Orders
660
- #diagram-2.imageblock
661
- .content: img src='managing-inventory.png' alt='Managing Inventory'
662
- .title Diagram 2. Managing Inventory
663
- """
664
-
665
- Scenario: Create a basic cross reference to an unnumbered formal block
666
- Given the AsciiDoc source
667
- """
668
- :xrefstyle: full
669
-
670
- See <<data>> to find the data used in this report.
671
-
672
- .Data
673
- [#data]
674
- ....
675
- a
676
- b
677
- c
678
- ....
679
- """
680
- When it is converted to html
681
- Then the result should contain the HTML structure
682
- """
683
- |See
684
- a<> href='#data' Data
685
- |to find the data used in this report.
686
- """
687
-
688
- Scenario: Use title as cross reference text to refer to a formal admonition block
689
- Given the AsciiDoc source
690
- """
691
- :xrefstyle: full
692
-
693
- Recall in <<essential-tip-1>>, we told you how to speed up this process.
694
-
695
- .Essential tip #1
696
- [#essential-tip-1]
697
- TIP: You can speed up this process by pressing the turbo button.
698
- """
699
- When it is converted to html
700
- Then the result should contain the HTML structure
701
- """
702
- |Recall in
703
- a< href='#essential-tip-1' Essential tip #1
704
- |, we told you how to speed up this process.
705
- """
706
-
707
- Scenario: Create a cross reference from an AsciiDoc cell to a section
708
- Given the AsciiDoc source
709
- """
710
- |===
711
- a|See <<_install>>
712
- |===
713
-
714
- == Install
715
-
716
- Instructions go here.
717
- """
718
- When it is converted to html
719
- Then the result should match the HTML structure
720
- """
721
- table.tableblock.frame-all.grid-all.stretch
722
- colgroup
723
- col style='width: 100%;'
724
- tbody
725
- tr
726
- td.tableblock.halign-left.valign-top
727
- div.content
728
- .paragraph: p
729
- |See
730
- a< href='#_install' Install
731
- .sect1
732
- h2#_install Install
733
- .sectionbody
734
- .paragraph: p Instructions go here.
735
- """
736
-
737
- Scenario: Create a cross reference using the title of the target section
738
- Given the AsciiDoc source
739
- """
740
- == Section One
741
-
742
- content
743
-
744
- == Section Two
745
-
746
- refer to <<Section One>>
747
- """
748
- When it is converted to html
749
- Then the result should match the HTML structure
750
- """
751
- .sect1
752
- h2#_section_one Section One
753
- .sectionbody: .paragraph: p content
754
- .sect1
755
- h2#_section_two Section Two
756
- .sectionbody: .paragraph: p
757
- |refer to
758
- a< href='#_section_one' Section One
759
- """
760
-
761
- Scenario: Create a cross reference using the reftext of the target section
762
- Given the AsciiDoc source
763
- """
764
- [reftext="the first section"]
765
- == Section One
766
-
767
- content
768
-
769
- == Section Two
770
-
771
- refer to <<the first section>>
772
- """
773
- When it is converted to html
774
- Then the result should match the HTML structure
775
- """
776
- .sect1
777
- h2#_section_one Section One
778
- .sectionbody: .paragraph: p content
779
- .sect1
780
- h2#_section_two Section Two
781
- .sectionbody: .paragraph: p
782
- |refer to
783
- a< href='#_section_one' the first section
784
- """
785
- When it is converted to docbook
786
- Then the result should match the XML structure
787
- """
788
- section xml:id='_section_one' xreflabel='the first section'
789
- title Section One
790
- simpara content
791
- section xml:id='_section_two'
792
- title Section Two
793
- simpara
794
- |refer to
795
- xref< linkend='_section_one'/
796
- """
797
-
798
- Scenario: Create a cross reference using the formatted title of the target section
799
- Given the AsciiDoc source
800
- """
801
- == Section *One*
802
-
803
- content
804
-
805
- == Section Two
806
-
807
- refer to <<Section *One*>>
808
- """
809
- When it is converted to html
810
- Then the result should match the HTML structure
811
- """
812
- .sect1
813
- h2#_section_one
814
- |Section <strong>One</strong>
815
- .sectionbody: .paragraph: p content
816
- .sect1
817
- h2#_section_two Section Two
818
- .sectionbody: .paragraph: p
819
- |refer to
820
- a< href='#_section_one' Section <strong>One</strong>
821
- """
822
-
823
- Scenario: Does not process a natural cross reference in compat mode
824
- Given the AsciiDoc source
825
- """
826
- :compat-mode:
827
-
828
- == Section One
829
-
830
- content
831
-
832
- == Section Two
833
-
834
- refer to <<Section One>>
835
- """
836
- When it is converted to html
837
- Then the result should match the HTML structure
838
- """
839
- .sect1
840
- h2#_section_one
841
- |Section One
842
- .sectionbody: .paragraph: p content
843
- .sect1
844
- h2#_section_two Section Two
845
- .sectionbody: .paragraph: p
846
- |refer to
847
- a< href='#Section One' [Section One]
848
- """
849
-
850
- Scenario: Parses text of xref macro as attributes if attribute signature found
851
- Given the AsciiDoc source
852
- """
853
- == Section One
854
-
855
- content
856
-
857
- == Section Two
858
-
859
- refer to xref:_section_one[role=next]
860
- """
861
- When it is converted to html
862
- Then the result should match the HTML structure
863
- """
864
- .sect1
865
- h2#_section_one
866
- |Section One
867
- .sectionbody: .paragraph: p content
868
- .sect1
869
- h2#_section_two Section Two
870
- .sectionbody: .paragraph: p
871
- |refer to
872
- a< href='#_section_one' class='next' Section One
873
- """
874
-
875
- Scenario: Does not parse text of xref macro as attribute if attribute signature not found
876
- Given the AsciiDoc source
877
- """
878
- == Section One
879
-
880
- content
881
-
882
- == Section Two
883
-
884
- refer to xref:_section_one[One, Section One]
885
- """
886
- When it is converted to html
887
- Then the result should match the HTML structure
888
- """
889
- .sect1
890
- h2#_section_one
891
- |Section One
892
- .sectionbody: .paragraph: p content
893
- .sect1
894
- h2#_section_two Section Two
895
- .sectionbody: .paragraph: p
896
- |refer to
897
- a< href='#_section_one' One, Section One
898
- """
899
-
900
- Scenario: Uses whole text of xref macro as link text if attribute signature found and text is enclosed in double quotes
901
- Given the AsciiDoc source
902
- """
903
- == Section One
904
-
905
- content
906
-
907
- == Section Two
908
-
909
- refer to xref:_section_one["Section One == Starting Point"]
910
- """
911
- When it is converted to html
912
- Then the result should match the HTML structure
913
- """
914
- .sect1
915
- h2#_section_one
916
- |Section One
917
- .sectionbody: .paragraph: p content
918
- .sect1
919
- h2#_section_two Section Two
920
- .sectionbody: .paragraph: p
921
- |refer to
922
- a< href='#_section_one'
923
- |Section One == Starting Point
924
- """
925
-
926
- Scenario: Does not parse text of xref macro as text if enclosed in double quotes but attribute signature not found
927
- Given the AsciiDoc source
928
- """
929
- == Section One
930
-
931
- content
932
-
933
- == Section Two
934
-
935
- refer to xref:_section_one["The Premier Section"]
936
- """
937
- When it is converted to html
938
- Then the result should match the HTML structure
939
- """
940
- .sect1
941
- h2#_section_one
942
- |Section One
943
- .sectionbody: .paragraph: p content
944
- .sect1
945
- h2#_section_two Section Two
946
- .sectionbody: .paragraph: p
947
- |refer to
948
- a< href='#_section_one' "The Premier Section"
949
- """
950
-
951
- Scenario: Can escape double quotes in text of xref macro using backslashes when text is parsed as attributes
952
- Given the AsciiDoc source
953
- """
954
- == Section One
955
-
956
- content
957
-
958
- == Section Two
959
-
960
- refer to xref:_section_one["\"The Premier Section\"",role=spotlight]
961
- """
962
- When it is converted to html
963
- Then the result should match the HTML structure
964
- """
965
- .sect1
966
- h2#_section_one
967
- |Section One
968
- .sectionbody: .paragraph: p content
969
- .sect1
970
- h2#_section_two Section Two
971
- .sectionbody: .paragraph: p
972
- |refer to
973
- a< href='#_section_one' class='spotlight' "The Premier Section"
974
- """
975
-
976
- Scenario: Override xrefstyle for a given part of the document
977
- Given the AsciiDoc source
978
- """
979
- :xrefstyle: full
980
- :doctype: book
981
- :sectnums:
982
-
983
- == Foo
984
-
985
- refer to <<#_bar>>
986
-
987
- == Bar
988
- :xrefstyle: short
989
-
990
- refer to xref:#_foo[xrefstyle=short]
991
- """
992
- When it is converted to html
993
- Then the result should match the HTML structure
994
- """
995
- .sect1
996
- h2#_foo 1. Foo
997
- .sectionbody: .paragraph: p
998
- |refer to
999
- a< href='#_bar' Chapter 2, <em>Bar</em>
1000
- .sect1
1001
- h2#_bar 2. Bar
1002
- .sectionbody: .paragraph: p
1003
- |refer to
1004
- a< href='#_foo' Chapter 1
1005
- """
1006
-
1007
- Scenario: Override xrefstyle for a specific reference by assigning the xrefstyle attribute on the xref macro
1008
- Given the AsciiDoc source
1009
- """
1010
- :xrefstyle: full
1011
- :doctype: book
1012
- :sectnums:
1013
-
1014
- == Foo
1015
-
1016
- content
1017
-
1018
- == Bar
1019
-
1020
- refer to <<#_foo>>
1021
-
1022
- refer to xref:#_foo[xrefstyle=short]
1023
- """
1024
- When it is converted to html
1025
- Then the result should match the HTML structure
1026
- """
1027
- .sect1
1028
- h2#_foo 1. Foo
1029
- .sectionbody: .paragraph: p content
1030
- .sect1
1031
- h2#_bar 2. Bar
1032
- .sectionbody
1033
- .paragraph: p
1034
- |refer to
1035
- a< href='#_foo' Chapter 1, <em>Foo</em>
1036
- .paragraph: p
1037
- |refer to
1038
- a< href='#_foo' Chapter 1
1039
- """