Debian Codegraph @

tests/languages/asciidoc/issue3480.test

raw
1 // View this document online at https://asciidoctor.org/docs/asciidoc-writers-guide/
2 = AsciiDoc Writer's Guide
3 Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
4 :description: This guide describes the basic structure of an AsciiDoc document, how to create your first AsciiDoc document, how to add other structural elements such as lists, block quotes and source code, and how to convert an AsciiDoc document to HTML, DocBook and PDF.
5 :keywords: AsciiDoc, Asciidoctor, syntax, reference, learn, how to, writers, authors
6 :page-description: {description}
7 :page-keywords: {keywords}
8 :page-layout: docs
9 ifndef::env-site[]
10 :toc: left
11 :icons: font
12 :idprefix:
13 :idseparator: -
14 :sectanchors:
15 :source-highlighter: highlightjs
16 endif::[]
17 :experimental:
18 :mdash: &#8212;
19 :language: asciidoc
20 :source-language: {language}
21 :table-caption!:
22 :example-caption!:
23 :figure-caption!:
24 :imagesdir: ../images
25 // Refs
26 :url-docs-asciidoc: https://docs.asciidoctor.org/asciidoc/latest/
27 :url-quickref: {url-docs-asciidoc}syntax-quick-reference/
28 :user-ref: https://asciidoctor.org/docs/user-manual
29 :asciidoctor-ref: https://asciidoctor.org/
30 :asciidoctor-gem-ref: https://rubygems.org/gems/asciidoctor
31 :uri-install: https://asciidoctor.org/docs/install-toolchain/
32 :fopub-doc-ref: https://github.com/asciidoctor/asciidoctor-fopub#readme
33 :docs-ref: https://asciidoctor.org/docs
34 :gist-ref: https://gist.github.com
35 :snippets-ref: https://gitlab.com/explore/snippets
36 :publican-ref: https://fedorahosted.org/publican
37
38 This guide provides a gentle introduction to AsciiDoc, a _plain text_ documentation *syntax* and *processor*.
39 This introduction is intended for anyone who wants to reduce the effort required to write and publish content, whether for technical documentation, articles, web pages or good ol'-fashioned prose.
40
41 TIP: If you want to know what AsciiDoc is all about, find the answer in {url-docs-asciidoc}#about-asciidoc[About AsciiDoc].
42 If you're looking for a concise survey of the AsciiDoc syntax, consult the {url-quickref}[AsciiDoc Syntax Quick Reference].
43
44 In this guide, you'll learn:
45
46 - The basic structure of an AsciiDoc document
47 - How to create your first AsciiDoc document
48 - How to add other structural elements such as lists, block quotes and source code
49 - How to convert an AsciiDoc document to HTML, DocBook and PDF
50
51 In addition to covering the AsciiDoc basics, this guide also suggests a set of conventions to help you create more consistent documents and maximize your writing productivity.
52
53 Let's dive in to AsciiDoc!
54
55 == Writing in AsciiDoc
56
57 The goal of this section is to teach you how to compose your first AsciiDoc document.
58 Hopefully, when you look back, you'll agree it just makes sense.
59
60 Your adventure with AsciiDoc begins in your favorite text editor.
61
62 === It's just text, mate.
63
64 Since AsciiDoc syntax is just _plain text_, you can write an AsciiDoc document using _any_ text editor.
65 You don't need complex word processing programs like Microsoft Word, OpenOffice Writer or Google Docs.
66 In fact, you _shouldn't_ use these programs because they add cruft to your document (that you can't see) and makes conversion tedious.
67
68 TIP: While it's true any text editor will do, I recommend selecting an editor that supports syntax highlighting for AsciiDoc.
69 The *[red]##c##[green]##o##[purple]##l##[fuchsia]##o##[blue]##r##* brings contrast to the text, making it easier to read.
70 The highlighting also confirms when you've entered the correct syntax for an inline or block element.
71
72 The most popular application for editing plain text on macOS is *TextMate*.
73 A similar choice on Linux is *GEdit*.
74 On Windows, stay away from Notepad and Wordpad because they produce plain text which is not cross-platform friendly.
75 Opt instead for a competent text editor like *Notepad++*.
76 If you're a programmer (or a writer with an inner geek), you'll likely prefer *Vim*, *Emacs*, or *Sublime Text*, all of which are available cross-platform.
77 The key feature all these editors share is syntax highlighting for AsciiDoc.
78
79 Open up your favorite text editor and get ready to write some AsciiDoc!
80
81 === Content is king!
82
83 The bulk of the content in a document is paragraph text.
84 This is why Asciidoctor doesn't require any special markup or attributes to specify paragraph content.
85 You can just start typing.
86
87 In Asciidoctor, adjacent or consecutive lines of text form a paragraph element.
88 To start a new paragraph after another element, such as a section title or table, hit the kbd:[RETURN] key twice to insert a blank line, and then continue typing your content.
89
90 .Two paragraphs in an AsciiDoc document
91 [source]
92 ----
93 This journey begins one late Monday afternoon in Antwerp.
94 Our team desperately needs coffee, but none of us dare open the office door.
95
96 To leave means code dismemberment and certain death.
97 ----
98
99 .The two paragraphs rendered using the default (html5) converter and stylesheet (asciidoctor.css)
100 ====
101 This journey begins one late Monday afternoon in Antwerp.
102 Our team desperately needs coffee, but none of us dare open the office door.
103
104 To leave means code dismemberment and certain death.
105 ====
106
107 Just like that, *you're writing in AsciiDoc!*
108 As you can see, it's just like writing an e-mail.
109
110 Save the file with a file extension of `.adoc`.
111
112 TIP: If you want to find out how to convert the document to HTML, DocBook or PDF, skip ahead to the section on <<converting-your-document>>.
113
114 ==== Wrapped text and hard line breaks
115
116 Since adjacent lines of text are combined into a single paragraph when Asciidoctor converts a document, that means you can wrap paragraph text or put each sentence or phrase on a separate line.
117 The line breaks won't appear in the output.
118
119 However, if you want the line breaks in a paragraph to be preserved, you can either use a space followed by a plus sign (`{plus}`) or set the `hardbreaks` option on the paragraph.
120 This results in a visible line break (e.g., `<br>`) following each line.
121
122 [source]
123 .Line breaks preserved using a space followed by the plus sign ({plus})
124 ----
125 Rubies are red, +
126 Topazes are blue.
127 ----
128
129 ====
130 Rubies are red, +
131 Topazes are blue.
132 ====
133
134 [source]
135 .Line breaks preserved using the hardbreaks option
136 ----
137 [%hardbreaks]
138 Ruby is red.
139 Java is black.
140 ----
141
142 ====
143 [%hardbreaks]
144 Ruby is red.
145 Java is black.
146 ====
147
148 To preserve line breaks throughout your whole document, add the `hardbreaks` attribute to the document's header.
149
150 .Line breaks preserved throughout the document using the hardbreaks attribute
151 [source]
152 ----
153 = Line Break Doc Title
154 :hardbreaks:
155
156 Rubies are red,
157 Topazes are blue.
158 ----
159
160 === Admonitions
161
162 There are certain statements you may want to draw attention to by taking them out of the content's flow and labeling them with a priority.
163 These are called admonitions.
164 It's rendered style is determined by the assigned label (i.e., value).
165 Asciidoctor provides five admonition style labels:
166
167 * `NOTE`
168 * `TIP`
169 * `IMPORTANT`
170 * `CAUTION`
171 * `WARNING`
172
173 .Caution vs. Warning
174 [#caution-vs-warning]
175 ****
176 When choosing the admonition type, you may find yourself getting confused between "caution" and "warning" as these words are often used interchangeably.
177 Here's a simple rule to help you differentiate the two:
178
179 * Use *CAUTION* to advise the reader to _act_ carefully (i.e., exercise care).
180 * Use *WARNING* to inform the reader of danger, harm, or consequences that exist.
181
182 To find a deeper analysis, see https://www.differencebetween.com/difference-between-caution-and-vs-warning/.
183 ****
184
185 When you want to call attention to a single paragraph, start the first line of the paragraph with the label you want to use.
186 The label must be uppercase and followed by a colon (`:`).
187
188 .Admonition paragraph syntax
189 [source]
190 ----
191 WARNING: Wolpertingers are known to nest in server racks. <1> <2>
192 Enter at your own risk.
193 ----
194 <1> The label must be uppercase and immediately followed by a colon (`:`).
195 <2> Separate the first line of the paragraph from the label by a single space.
196
197 .Result: Admonition paragraph
198 ====
199 WARNING: Wolpertingers are known to nest in server racks.
200 Enter at your own risk.
201 ====
202
203 An admonition paragraph is rendered in a callout box with the admonition label--or its corresponding icon--in the gutter.
204 Icons are enabled by setting the `icons` attribute on the document.
205
206 NOTE: Admonitions can also encapsulate any block content, which we'll cover later.
207
208 === Mild punctuation, strong impact
209
210 Just as we emphasize certain words and phrases when we speak, we can emphasize them in text by surrounding them with punctuation.
211 AsciiDoc refers to this markup as _quoted text_.
212
213 ==== Quoted text
214
215 For instance, in an e-mail, you might "`speak`" a word louder by enclosing it in asterisks.
216
217 [source]
218 I can't believe it, we *won*!
219
220 As you would expect, the asterisks make the text *won* bold.
221 You can almost sense the emotion.
222 This is one example of quoted (i.e., formatted) text.
223
224 NOTE: The term "`quote`" is used liberally here to apply to any symbols that surround text in order to apply emphasis or special meaning.
225
226 Here are the forms of quoted text that AsciiDoc recognizes:
227
228 .Bold, italic, and monospace formatting syntax
229 [source]
230 ----
231 bold *constrained* & **un**constrained
232
233 italic _constrained_ & __un__constrained
234
235 bold italic *_constrained_* & **__un__**constrained
236
237 monospace `constrained` & ``un``constrained
238
239 monospace bold `*constrained*` & ``**un**``constrained
240
241 monospace italic `_constrained_` & ``__un__``constrained
242
243 monospace bold italic `*_constrained_*` & ``**__un__**``constrained
244 ----
245
246 When you want to quote text (e.g., place emphasis) somewhere other than at the boundaries of a word, you need to double up the punctuation.
247
248 .Result: Bold, italic, and monospace text
249 ====
250 bold *constrained* & **un**constrained
251
252 italic _constrained_ & __un__constrained
253
254 bold italic *_constrained_* & **__un__**constrained
255
256 monospace `constrained` & ``un``constrained
257
258 monospace bold `*constrained*` & ``**un**``constrained
259
260 monospace italic `_constrained_` & ``__un__``constrained
261
262 monospace bold italic `*_constrained_*` & ``**__un__**``constrained
263 ====
264
265 Any quoted text can be prefixed with an attribute list.
266 The first positional attribute is treated as a role.
267 The role can be used to apply custom styling to the text.
268 For instance:
269
270 [source]
271 Type the word [.userinput]#asciidoc# into the search bar.
272
273 When converting to HTML, the word "`asciidoc`" is wrapped in `<span>` tags and the role is used as the element's CSS class:
274
275 [source,xml]
276 <span class="userinput">asciidoc</span>
277
278 You can apply styles to the text using CSS.
279
280 You may not always want these substitutions to take place.
281 In those cases, you'll need to use markup to escape the text.
282
283 ----------------------------------------------------
284
285 [
286 ["comment", "// View this document online at https://asciidoctor.org/docs/asciidoc-writers-guide/"],
287 ["title", [
288 ["punctuation", "="],
289 " AsciiDoc Writer's Guide"
290 ]],
291 "\r\nDan Allen <",
292 ["macro", [
293 ["function", "https"],
294 ["punctuation", ":"],
295 "//github.com/mojavelinux",
296 ["attributes", [
297 ["punctuation", "["],
298 ["attr-value", "@mojavelinux"],
299 ["punctuation", "]"]
300 ]]
301 ]],
302 ">; Sarah White <",
303 ["macro", [
304 ["function", "https"],
305 ["punctuation", ":"],
306 "//github.com/graphitefriction",
307 ["attributes", [
308 ["punctuation", "["],
309 ["attr-value", "@graphitefriction"],
310 ["punctuation", "]"]
311 ]]
312 ]],
313 ">\r\n",
314 ["attribute-entry", ":description: This guide describes the basic structure of an AsciiDoc document, how to create your first AsciiDoc document, how to add other structural elements such as lists, block quotes and source code, and how to convert an AsciiDoc document to HTML, DocBook and PDF."],
315 ["attribute-entry", ":keywords: AsciiDoc, Asciidoctor, syntax, reference, learn, how to, writers, authors"],
316 ["attribute-entry", ":page-description: {description}"],
317 ["attribute-entry", ":page-keywords: {keywords}"],
318 ["attribute-entry", ":page-layout: docs"],
319 ["macro", [
320 ["function", "ifndef"],
321 ["punctuation", "::"],
322 "env-site",
323 ["attributes", [
324 ["punctuation", "["],
325 ["punctuation", "]"]
326 ]]
327 ]],
328 ["attribute-entry", ":toc: left"],
329 ["attribute-entry", ":icons: font"],
330 ["attribute-entry", ":idprefix:"],
331 ["attribute-entry", ":idseparator: -"],
332 ["attribute-entry", ":sectanchors:"],
333 ["attribute-entry", ":source-highlighter: highlightjs"],
334 ["macro", [
335 ["function", "endif"],
336 ["punctuation", "::"],
337 ["attributes", [
338 ["punctuation", "["],
339 ["punctuation", "]"]
340 ]]
341 ]],
342 ["attribute-entry", ":experimental:"],
343 ["attribute-entry", ":mdash: &#8212;"],
344 ["attribute-entry", ":language: asciidoc"],
345 ["attribute-entry", ":source-language: {language}"],
346 ["attribute-entry", ":table-caption!:"],
347 ["attribute-entry", ":example-caption!:"],
348 ["attribute-entry", ":figure-caption!:"],
349 ["attribute-entry", ":imagesdir: ../images"],
350 ["comment", "// Refs"],
351 ["attribute-entry", ":url-docs-asciidoc: https://docs.asciidoctor.org/asciidoc/latest/"],
352 ["attribute-entry", ":url-quickref: {url-docs-asciidoc}syntax-quick-reference/"],
353 ["attribute-entry", ":user-ref: https://asciidoctor.org/docs/user-manual"],
354 ["attribute-entry", ":asciidoctor-ref: https://asciidoctor.org/"],
355 ["attribute-entry", ":asciidoctor-gem-ref: https://rubygems.org/gems/asciidoctor"],
356 ["attribute-entry", ":uri-install: https://asciidoctor.org/docs/install-toolchain/"],
357 ["attribute-entry", ":fopub-doc-ref: https://github.com/asciidoctor/asciidoctor-fopub#readme"],
358 ["attribute-entry", ":docs-ref: https://asciidoctor.org/docs"],
359 ["attribute-entry", ":gist-ref: https://gist.github.com"],
360 ["attribute-entry", ":snippets-ref: https://gitlab.com/explore/snippets"],
361 ["attribute-entry", ":publican-ref: https://fedorahosted.org/publican"],
362
363 "\r\n\r\nThis guide provides a gentle introduction to AsciiDoc, a ",
364 ["inline", [
365 ["italic", [
366 ["punctuation", "_"],
367 "plain text",
368 ["punctuation", "_"]
369 ]]
370 ]],
371 " documentation ",
372 ["inline", [
373 ["bold", [
374 ["punctuation", "*"],
375 "syntax",
376 ["punctuation", "*"]
377 ]]
378 ]],
379 " and ",
380 ["inline", [
381 ["bold", [
382 ["punctuation", "*"],
383 "processor",
384 ["punctuation", "*"]
385 ]]
386 ]],
387 ".\r\nThis introduction is intended for anyone who wants to reduce the effort required to write and publish content, whether for technical documentation, articles, web pages or good ol'-fashioned prose.\r\n\r\n",
388
389 ["admonition", "TIP:"],
390 " If you want to know what AsciiDoc is all about, find the answer in ",
391 ["inline", [
392 ["attribute-ref", [
393 ["punctuation", "{"],
394 ["variable", "url-docs-asciidoc"],
395 ["punctuation", "}"]
396 ]]
397 ]],
398 "#about-asciidoc[About AsciiDoc].\r\nIf you're looking for a concise survey of the AsciiDoc syntax, consult the ",
399 ["inline", [
400 ["attribute-ref", [
401 ["punctuation", "{"],
402 ["variable", "url-quickref"],
403 ["punctuation", "}"]
404 ]]
405 ]],
406 "[AsciiDoc Syntax Quick Reference].\r\n\r\nIn this guide, you'll learn:\r\n\r\n",
407
408 ["list-punctuation", "-"],
409 " The basic structure of an AsciiDoc document\r\n",
410
411 ["list-punctuation", "-"],
412 " How to create your first AsciiDoc document\r\n",
413
414 ["list-punctuation", "-"],
415 " How to add other structural elements such as lists, block quotes and source code\r\n",
416
417 ["list-punctuation", "-"],
418 " How to convert an AsciiDoc document to HTML, DocBook and PDF\r\n\r\nIn addition to covering the AsciiDoc basics, this guide also suggests a set of conventions to help you create more consistent documents and maximize your writing productivity.\r\n\r\nLet's dive in to AsciiDoc!\r\n\r\n",
419
420 ["title", [
421 ["punctuation", "=="],
422 " Writing in AsciiDoc"
423 ]],
424
425 "\r\n\r\nThe goal of this section is to teach you how to compose your first AsciiDoc document.\r\nHopefully, when you look back, you'll agree it just makes sense.\r\n\r\nYour adventure with AsciiDoc begins in your favorite text editor.\r\n\r\n",
426
427 ["title", [
428 ["punctuation", "==="],
429 " It's just text, mate."
430 ]],
431
432 "\r\n\r\nSince AsciiDoc syntax is just ",
433 ["inline", [
434 ["italic", [
435 ["punctuation", "_"],
436 "plain text",
437 ["punctuation", "_"]
438 ]]
439 ]],
440 ", you can write an AsciiDoc document using ",
441 ["inline", [
442 ["italic", [
443 ["punctuation", "_"],
444 "any",
445 ["punctuation", "_"]
446 ]]
447 ]],
448 " text editor.\r\nYou don't need complex word processing programs like Microsoft Word, OpenOffice Writer or Google Docs.\r\nIn fact, you ",
449 ["inline", [
450 ["italic", [
451 ["punctuation", "_"],
452 "shouldn't",
453 ["punctuation", "_"]
454 ]]
455 ]],
456 " use these programs because they add cruft to your document (that you can't see) and makes conversion tedious.\r\n\r\n",
457
458 ["admonition", "TIP:"],
459 " While it's true any text editor will do, I recommend selecting an editor that supports syntax highlighting for AsciiDoc.\r\nThe ",
460 ["inline", [
461 ["bold", [
462 ["punctuation", "*"],
463 "[red]##c##[green]##o##[purple]##l##[fuchsia]##o##[blue]##r##",
464 ["punctuation", "*"]
465 ]]
466 ]],
467 " brings contrast to the text, making it easier to read.\r\nThe highlighting also confirms when you've entered the correct syntax for an inline or block element.\r\n\r\nThe most popular application for editing plain text on macOS is ",
468 ["inline", [
469 ["bold", [
470 ["punctuation", "*"],
471 "TextMate",
472 ["punctuation", "*"]
473 ]]
474 ]],
475 ".\r\nA similar choice on Linux is ",
476 ["inline", [
477 ["bold", [
478 ["punctuation", "*"],
479 "GEdit",
480 ["punctuation", "*"]
481 ]]
482 ]],
483 ".\r\nOn Windows, stay away from Notepad and Wordpad because they produce plain text which is not cross-platform friendly.\r\nOpt instead for a competent text editor like ",
484 ["inline", [
485 ["bold", [
486 ["punctuation", "*"],
487 "Notepad++",
488 ["punctuation", "*"]
489 ]]
490 ]],
491 ".\r\nIf you're a programmer (or a writer with an inner geek), you'll likely prefer ",
492 ["inline", [
493 ["bold", [
494 ["punctuation", "*"],
495 "Vim",
496 ["punctuation", "*"]
497 ]]
498 ]],
499 ", ",
500 ["inline", [
501 ["bold", [
502 ["punctuation", "*"],
503 "Emacs",
504 ["punctuation", "*"]
505 ]]
506 ]],
507 ", or ",
508 ["inline", [
509 ["bold", [
510 ["punctuation", "*"],
511 "Sublime Text",
512 ["punctuation", "*"]
513 ]]
514 ]],
515 ", all of which are available cross-platform.\r\nThe key feature all these editors share is syntax highlighting for AsciiDoc.\r\n\r\nOpen up your favorite text editor and get ready to write some AsciiDoc!\r\n\r\n",
516
517 ["title", [
518 ["punctuation", "==="],
519 " Content is king!"
520 ]],
521
522 "\r\n\r\nThe bulk of the content in a document is paragraph text.\r\nThis is why Asciidoctor doesn't require any special markup or attributes to specify paragraph content.\r\nYou can just start typing.\r\n\r\nIn Asciidoctor, adjacent or consecutive lines of text form a paragraph element.\r\nTo start a new paragraph after another element, such as a section title or table, hit the ",
523 ["macro", [
524 ["function", "kbd"],
525 ["punctuation", ":"],
526 ["attributes", [
527 ["punctuation", "["],
528 ["attr-value", "RETURN"],
529 ["punctuation", "]"]
530 ]]
531 ]],
532 " key twice to insert a blank line, and then continue typing your content.\r\n\r\n",
533
534 ["title", [
535 ["punctuation", "."],
536 "Two paragraphs in an AsciiDoc document"
537 ]],
538 ["attributes", [
539 ["punctuation", "["],
540 ["attr-value", "source"],
541 ["punctuation", "]"]
542 ]],
543 ["literal-block", [
544 ["punctuation", "----"],
545 "\r\nThis journey begins one late Monday afternoon in Antwerp.\r\nOur team desperately needs coffee, but none of us dare open the office door.\r\n\r\nTo leave means code dismemberment and certain death.\r\n",
546 ["punctuation", "----"]
547 ]],
548
549 ["title", [
550 ["punctuation", "."],
551 "The two paragraphs rendered using the default (html5) converter and stylesheet (asciidoctor.css)"
552 ]],
553 ["other-block", [
554 ["punctuation", "===="],
555 "\r\nThis journey begins one late Monday afternoon in Antwerp.\r\nOur team desperately needs coffee, but none of us dare open the office door.\r\n\r\nTo leave means code dismemberment and certain death.\r\n",
556 ["punctuation", "===="]
557 ]],
558
559 "\r\n\r\nJust like that, ",
560 ["inline", [
561 ["bold", [
562 ["punctuation", "*"],
563 "you're writing in AsciiDoc!",
564 ["punctuation", "*"]
565 ]]
566 ]],
567
568 "\r\nAs you can see, it's just like writing an e-mail.\r\n\r\nSave the file with a file extension of ",
569 ["inline", [
570 ["punctuation", "`"],
571 ".adoc",
572 ["punctuation", "`"]
573 ]],
574 ".\r\n\r\n",
575
576 ["admonition", "TIP:"],
577 " If you want to find out how to convert the document to HTML, DocBook or PDF, skip ahead to the section on ",
578 ["inline", [
579 ["url", [
580 ["punctuation", "<<"],
581 "converting-your-document",
582 ["punctuation", ">>"]
583 ]]
584 ]],
585 ".\r\n\r\n",
586
587 ["title", [
588 ["punctuation", "===="],
589 " Wrapped text and hard line breaks"
590 ]],
591
592 "\r\n\r\nSince adjacent lines of text are combined into a single paragraph when Asciidoctor converts a document, that means you can wrap paragraph text or put each sentence or phrase on a separate line.\r\nThe line breaks won't appear in the output.\r\n\r\nHowever, if you want the line breaks in a paragraph to be preserved, you can either use a space followed by a plus sign (",
593 ["inline", [
594 ["punctuation", "`"],
595 "{plus}",
596 ["punctuation", "`"]
597 ]],
598 ") or set the ",
599 ["inline", [
600 ["punctuation", "`"],
601 "hardbreaks",
602 ["punctuation", "`"]
603 ]],
604 " option on the paragraph.\r\nThis results in a visible line break (e.g., ",
605 ["inline", [
606 ["punctuation", "`"],
607 "<br>",
608 ["punctuation", "`"]
609 ]],
610 ") following each line.\r\n\r\n",
611
612 ["attributes", [
613 ["punctuation", "["],
614 ["attr-value", "source"],
615 ["punctuation", "]"]
616 ]],
617 ["title", [
618 ["punctuation", "."],
619 "Line breaks preserved using a space followed by the plus sign (",
620 ["inline", [
621 ["attribute-ref", [
622 ["punctuation", "{"],
623 ["variable", "plus"],
624 ["punctuation", "}"]
625 ]]
626 ]],
627 ")"
628 ]],
629 ["literal-block", [
630 ["punctuation", "----"],
631 "\r\nRubies are red, +\r\nTopazes are blue.\r\n",
632 ["punctuation", "----"]
633 ]],
634
635 ["other-block", [
636 ["punctuation", "===="],
637 "\r\nRubies are red, ", ["line-continuation", "+"],
638 "\r\nTopazes are blue.\r\n",
639 ["punctuation", "===="]
640 ]],
641
642 ["attributes", [
643 ["punctuation", "["],
644 ["attr-value", "source"],
645 ["punctuation", "]"]
646 ]],
647 ["title", [
648 ["punctuation", "."],
649 "Line breaks preserved using the hardbreaks option"
650 ]],
651 ["literal-block", [
652 ["punctuation", "----"],
653 "\r\n[%hardbreaks]\r\nRuby is red.\r\nJava is black.\r\n",
654 ["punctuation", "----"]
655 ]],
656
657 ["other-block", [
658 ["punctuation", "===="],
659 ["attributes", [
660 ["punctuation", "["],
661 ["attr-value", "%hardbreaks"],
662 ["punctuation", "]"]
663 ]],
664 "\r\nRuby is red.\r\nJava is black.\r\n",
665 ["punctuation", "===="]
666 ]],
667
668 "\r\n\r\nTo preserve line breaks throughout your whole document, add the ",
669 ["inline", [
670 ["punctuation", "`"],
671 "hardbreaks",
672 ["punctuation", "`"]
673 ]],
674 " attribute to the document's header.\r\n\r\n",
675
676 ["title", [
677 ["punctuation", "."],
678 "Line breaks preserved throughout the document using the hardbreaks attribute"
679 ]],
680 ["attributes", [
681 ["punctuation", "["],
682 ["attr-value", "source"],
683 ["punctuation", "]"]
684 ]],
685 ["literal-block", [
686 ["punctuation", "----"],
687 "\r\n= Line Break Doc Title\r\n:hardbreaks:\r\n\r\nRubies are red,\r\nTopazes are blue.\r\n",
688 ["punctuation", "----"]
689 ]],
690
691 ["title", [
692 ["punctuation", "==="],
693 " Admonitions"
694 ]],
695
696 "\r\n\r\nThere are certain statements you may want to draw attention to by taking them out of the content's flow and labeling them with a priority.\r\nThese are called admonitions.\r\nIt's rendered style is determined by the assigned label (i.e., value).\r\nAsciidoctor provides five admonition style labels:\r\n\r\n",
697
698 ["list-punctuation", "*"],
699 ["inline", [
700 ["punctuation", "`"],
701 "NOTE",
702 ["punctuation", "`"]
703 ]],
704
705 ["list-punctuation", "*"],
706 ["inline", [
707 ["punctuation", "`"],
708 "TIP",
709 ["punctuation", "`"]
710 ]],
711
712 ["list-punctuation", "*"],
713 ["inline", [
714 ["punctuation", "`"],
715 "IMPORTANT",
716 ["punctuation", "`"]
717 ]],
718
719 ["list-punctuation", "*"],
720 ["inline", [
721 ["punctuation", "`"],
722 "CAUTION",
723 ["punctuation", "`"]
724 ]],
725
726 ["list-punctuation", "*"],
727 ["inline", [
728 ["punctuation", "`"],
729 "WARNING",
730 ["punctuation", "`"]
731 ]],
732
733 ["title", [
734 ["punctuation", "."],
735 "Caution vs. Warning"
736 ]],
737
738 ["attributes", [
739 ["punctuation", "["],
740 ["attr-value", "#caution-vs-warning"],
741 ["punctuation", "]"]
742 ]],
743
744 ["other-block", [
745 ["punctuation", "****"],
746 "\r\nWhen choosing the admonition type, you may find yourself getting confused between \"caution\" and \"warning\" as these words are often used interchangeably.\r\nHere's a simple rule to help you differentiate the two:\r\n\r\n",
747
748 ["list-punctuation", "*"],
749 " Use ",
750 ["inline", [
751 ["bold", [
752 ["punctuation", "*"],
753 "CAUTION",
754 ["punctuation", "*"]
755 ]]
756 ]],
757 " to advise the reader to ",
758 ["inline", [
759 ["italic", [
760 ["punctuation", "_"],
761 "act",
762 ["punctuation", "_"]
763 ]]
764 ]],
765 " carefully (i.e., exercise care).\r\n",
766
767 ["list-punctuation", "*"],
768 " Use ",
769 ["inline", [
770 ["bold", [
771 ["punctuation", "*"],
772 "WARNING",
773 ["punctuation", "*"]
774 ]]
775 ]],
776 " to inform the reader of danger, harm, or consequences that exist.\r\n\r\nTo find a deeper analysis, see https://www.differencebetween.com/difference-between-caution-and-vs-warning/.\r\n",
777
778 ["punctuation", "****"]
779 ]],
780
781 "\r\n\r\nWhen you want to call attention to a single paragraph, start the first line of the paragraph with the label you want to use.\r\nThe label must be uppercase and followed by a colon (",
782 ["inline", [
783 ["punctuation", "`"],
784 ":",
785 ["punctuation", "`"]
786 ]],
787 ").\r\n\r\n",
788
789 ["title", [
790 ["punctuation", "."],
791 "Admonition paragraph syntax"
792 ]],
793
794 ["attributes", [
795 ["punctuation", "["],
796 ["attr-value", "source"],
797 ["punctuation", "]"]
798 ]],
799
800 ["literal-block", [
801 ["punctuation", "----"],
802 "\r\nWARNING: Wolpertingers are known to nest in server racks. ",
803 ["callout", "<1>"],
804 ["callout", "<2>"],
805 "\r\nEnter at your own risk.\r\n",
806 ["punctuation", "----"]
807 ]],
808
809 ["callout", "<1>"],
810 " The label must be uppercase and immediately followed by a colon (",
811 ["inline", [
812 ["punctuation", "`"],
813 ":",
814 ["punctuation", "`"]
815 ]],
816 ").\r\n",
817
818 ["callout", "<2>"],
819 " Separate the first line of the paragraph from the label by a single space.\r\n\r\n",
820
821 ["title", [
822 ["punctuation", "."],
823 "Result: Admonition paragraph"
824 ]],
825 ["other-block", [
826 ["punctuation", "===="],
827 ["admonition", "WARNING:"],
828 " Wolpertingers are known to nest in server racks.\r\nEnter at your own risk.\r\n",
829 ["punctuation", "===="]
830 ]],
831
832 "\r\n\r\nAn admonition paragraph is rendered in a callout box with the admonition label--or its corresponding icon--in the gutter.\r\nIcons are enabled by setting the ",
833 ["inline", [
834 ["punctuation", "`"],
835 "icons",
836 ["punctuation", "`"]
837 ]],
838 " attribute on the document.\r\n\r\n",
839
840 ["admonition", "NOTE:"],
841 " Admonitions can also encapsulate any block content, which we'll cover later.\r\n\r\n",
842
843 ["title", [
844 ["punctuation", "==="],
845 " Mild punctuation, strong impact"
846 ]],
847
848 "\r\n\r\nJust as we emphasize certain words and phrases when we speak, we can emphasize them in text by surrounding them with punctuation.\r\nAsciiDoc refers to this markup as ",
849 ["inline", [
850 ["italic", [
851 ["punctuation", "_"],
852 "quoted text",
853 ["punctuation", "_"]
854 ]]
855 ]],
856 ".\r\n\r\n",
857
858 ["title", [
859 ["punctuation", "===="],
860 " Quoted text"
861 ]],
862
863 "\r\n\r\nFor instance, in an e-mail, you might \"",
864 ["inline", [
865 ["punctuation", "`"],
866 "speak",
867 ["punctuation", "`"]
868 ]],
869 "\" a word louder by enclosing it in asterisks.\r\n\r\n",
870
871 ["attributes", [
872 ["punctuation", "["],
873 ["attr-value", "source"],
874 ["punctuation", "]"]
875 ]],
876
877 "\r\nI can't believe it, we ",
878 ["inline", [
879 ["bold", [
880 ["punctuation", "*"],
881 "won",
882 ["punctuation", "*"]
883 ]]
884 ]],
885 "!\r\n\r\nAs you would expect, the asterisks make the text ",
886 ["inline", [
887 ["bold", [
888 ["punctuation", "*"],
889 "won",
890 ["punctuation", "*"]
891 ]]
892 ]],
893 " bold.\r\nYou can almost sense the emotion.\r\nThis is one example of quoted (i.e., formatted) text.\r\n\r\n",
894
895 ["admonition", "NOTE:"],
896 " The term \"",
897 ["inline", [
898 ["punctuation", "`"],
899 "quote",
900 ["punctuation", "`"]
901 ]],
902 "\" is used liberally here to apply to any symbols that surround text in order to apply emphasis or special meaning.\r\n\r\nHere are the forms of quoted text that AsciiDoc recognizes:\r\n\r\n",
903
904 ["title", [
905 ["punctuation", "."],
906 "Bold, italic, and monospace formatting syntax"
907 ]],
908 ["attributes", [
909 ["punctuation", "["],
910 ["attr-value", "source"],
911 ["punctuation", "]"]
912 ]],
913 ["literal-block", [
914 ["punctuation", "----"],
915 "\r\nbold *constrained* & **un**constrained\r\n\r\nitalic _constrained_ & __un__constrained\r\n\r\nbold italic *_constrained_* & **__un__**constrained\r\n\r\nmonospace `constrained` & ``un``constrained\r\n\r\nmonospace bold `*constrained*` & ``**un**``constrained\r\n\r\nmonospace italic `_constrained_` & ``__un__``constrained\r\n\r\nmonospace bold italic `*_constrained_*` & ``**__un__**``constrained\r\n",
916 ["punctuation", "----"]
917 ]],
918
919 "\r\n\r\nWhen you want to quote text (e.g., place emphasis) somewhere other than at the boundaries of a word, you need to double up the punctuation.\r\n\r\n",
920
921 ["title", [
922 ["punctuation", "."],
923 "Result: Bold, italic, and monospace text"
924 ]],
925
926 ["other-block", [
927 ["punctuation", "===="],
928
929 "\r\nbold ",
930 ["inline", [
931 ["bold", [
932 ["punctuation", "*"],
933 "constrained",
934 ["punctuation", "*"]
935 ]]
936 ]],
937 " & ",
938 ["inline", [
939 ["bold", [
940 ["punctuation", "**"],
941 "un",
942 ["punctuation", "**"]
943 ]]
944 ]],
945 "constrained\r\n\r\nitalic ",
946 ["inline", [
947 ["italic", [
948 ["punctuation", "_"],
949 "constrained",
950 ["punctuation", "_"]
951 ]]
952 ]],
953 " & ",
954 ["inline", [
955 ["italic", [
956 ["punctuation", "__"],
957 "un",
958 ["punctuation", "__"]
959 ]]
960 ]],
961 "constrained\r\n\r\nbold italic ",
962 ["inline", [
963 ["bold", [
964 ["punctuation", "*"],
965 "_constrained_",
966 ["punctuation", "*"]
967 ]]
968 ]],
969 " & ",
970 ["inline", [
971 ["bold", [
972 ["punctuation", "**"],
973 "__un__",
974 ["punctuation", "**"]
975 ]]
976 ]],
977 "constrained\r\n\r\nmonospace ",
978 ["inline", [
979 ["punctuation", "`"],
980 "constrained",
981 ["punctuation", "`"]
982 ]],
983 " & `",
984 ["inline", [
985 ["punctuation", "`"],
986 "un",
987 ["punctuation", "`"]
988 ]],
989 ["inline", [
990 ["punctuation", "`"],
991 "constrained\r\n\r\nmonospace bold `*constrained*",
992 ["punctuation", "`"]
993 ]],
994 " & `",
995 ["inline", [
996 ["punctuation", "`"],
997 "**un**",
998 ["punctuation", "`"]
999 ]],
1000 ["inline", [
1001 ["punctuation", "`"],
1002 "constrained\r\n\r\nmonospace italic `_constrained_",
1003 ["punctuation", "`"]
1004 ]],
1005 " & `",
1006 ["inline", [
1007 ["punctuation", "`"],
1008 "__un__",
1009 ["punctuation", "`"]
1010 ]],
1011 ["inline", [
1012 ["punctuation", "`"],
1013 "constrained\r\n\r\nmonospace bold italic `*_constrained_*",
1014 ["punctuation", "`"]
1015 ]],
1016 " & `",
1017 ["inline", [
1018 ["punctuation", "`"],
1019 "**__un__**",
1020 ["punctuation", "`"]
1021 ]],
1022 "`constrained\r\n",
1023
1024 ["punctuation", "===="]
1025 ]],
1026
1027 "\r\n\r\nAny quoted text can be prefixed with an attribute list.\r\nThe first positional attribute is treated as a role.\r\nThe role can be used to apply custom styling to the text.\r\nFor instance:\r\n\r\n",
1028
1029 ["attributes", [
1030 ["punctuation", "["],
1031 ["attr-value", "source"],
1032 ["punctuation", "]"]
1033 ]],
1034
1035 "\r\nType the word ",
1036 ["inline", [
1037 ["attributes", [
1038 ["punctuation", "["],
1039 ["attr-value", ".userinput"],
1040 ["punctuation", "]"]
1041 ]],
1042 ["punctuation", "#"],
1043 "asciidoc",
1044 ["punctuation", "#"]
1045 ]],
1046 " into the search bar.\r\n\r\nWhen converting to HTML, the word \"",
1047 ["inline", [
1048 ["punctuation", "`"],
1049 "asciidoc",
1050 ["punctuation", "`"]
1051 ]],
1052 "\" is wrapped in ",
1053 ["inline", [
1054 ["punctuation", "`"],
1055 "<span>",
1056 ["punctuation", "`"]
1057 ]],
1058 " tags and the role is used as the element's CSS class:\r\n\r\n",
1059
1060 ["attributes", [
1061 ["punctuation", "["],
1062 ["attr-value", "source"],
1063 ["punctuation", ","],
1064 ["attr-value", "xml"],
1065 ["punctuation", "]"]
1066 ]],
1067 "\r\n<span class=\"userinput\">asciidoc</span>\r\n\r\nYou can apply styles to the text using CSS.\r\n\r\nYou may not always want these substitutions to take place.\r\nIn those cases, you'll need to use markup to escape the text."
1068 ]