### Ruby Sinatra Hello World Example Source: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference Demonstrates a basic 'Hello World' web application using the Sinatra framework in Ruby. It defines a GET route for '/hi' that returns the string 'Hello World!'. This snippet is presented within a fenced code block with Ruby syntax highlighting. ```ruby require 'sinatra' get '/hi' do "Hello World!" end ``` -------------------------------- ### AsciiDoc Example Block Source: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference Shows how to define an example block in AsciiDoc, which can contain other blocks like source code. The example includes a document header structure. ```asciidoc ==== Here's a sample AsciiDoc document: ---- = Title of Document Doc Writer :toc: This guide provides... ---- The document header is useful, but not required. ==== ``` -------------------------------- ### AsciiDoc Example Block Syntax Source: https://docs.asciidoctor.org/asciidoc/latest/blocks/example-blocks Demonstrates how to apply the 'example' block style to a paragraph in AsciiDoc. This is achieved by placing the style name directly in an attribute list when the example content is contiguous. ```asciidoc .Optional title [example] This is an example of an example block. ``` -------------------------------- ### DocBook 5.0 Head Docinfo Example Source: https://docs.asciidoctor.org/asciidoc/latest/docinfo This example shows content suitable for a DocBook 5.0 head docinfo file. It includes author information, keyword sets, and print history, which are appended to the root `` element in DocBook output. ```xml Karma Chameleon Word SWAT Team Leader open source documentation adventure April, 2021. Twenty-sixth printing. ``` -------------------------------- ### Asciidoctor kbd Macro Syntax and Examples Source: https://docs.asciidoctor.org/asciidoc/latest/macros/keyboard-macro Demonstrates the AsciiDoc `kbd` macro for defining keyboard shortcuts. Explains syntax, key separators (like `+` or `,`), and special character escaping for backslash and closing brackets. Includes examples of common shortcuts and edge cases. ```asciidoc |=== |Shortcut |Purpose |kbd:[F11] |Toggle fullscreen |kbd:[Ctrl+T] |Open a new tab |kbd:[Ctrl+Shift+N] |New incognito window |kbd:[\ ] |Used to escape characters |kbd:[Ctrl+\]] |Jump to keyword |kbd:[Ctrl + +] |Increase zoom |=== ``` -------------------------------- ### Delimited Example Block Syntax Source: https://docs.asciidoctor.org/asciidoc/latest/blocks/example-blocks Demonstrates the Asciidoctor syntax for creating a delimited example block. This syntax is used to enclose blocks of content, often for code or examples, and can include an optional title. The content within the delimiters is treated as a distinct block. ```asciidoc .Onomatopoeia ==== The book hit the floor with a *thud*. He could hear doves *cooing* in the pine trees`' branches. ==== ``` -------------------------------- ### AsciiDoc Formatting Examples Source: https://docs.asciidoctor.org/asciidoc/latest/text/troubleshoot-unconstrained-formatting Demonstrates AsciiDoc formatting rules for constrained vs. unconstrained pairs, showing how adjacent characters affect rendering. Includes examples with letters, numbers, semicolons, and spaces. ```asciidoc AsciiDoc | Result | Formatting Pair | Reason | --- | --- | --- | --- | `Sara__h__` | Sara*h* | Unconstrained | The letter `a` is directly adjacent to the opening mark. | | `**B**old` | **B**old | Unconstrained | The `o` is directly adjacent to the closing mark. | | `–**2016**` | –**2016** | Unconstrained | The `;` is directly adjacent to the opening mark. | | `** bold **` | **bold** | Unconstrained | There are spaces directly inside the formatting marks. | | `*2016*–` | *2016*– | Constrained | The adjacent `&` is not a letter, number, underscore, colon, or semicolon. | | `*9*-to-*5*` | *9*-to-*5* | Constrained | The adjacent hyphen is not a letter, number, underscore, colon, or semicolon. | ``` -------------------------------- ### Icon Macro Image Mode Alt and Width Example Source: https://docs.asciidoctor.org/asciidoc/latest/macros/icon-macro Provides an example of setting the `alt` text and `width` for an icon when using the image icon mode. ```asciidoc icon:tags[Tags,width=16] ruby, asciidoctor ``` -------------------------------- ### Icon Macro Link and Window Example Source: https://docs.asciidoctor.org/asciidoc/latest/macros/icon-macro Shows how to use the `link` and `window` attributes to make an icon clickable and open in a new browser tab. ```asciidoc icon:download[link=https://rubygems.org/downloads/whizbang-1.0.0.gem, window=_blank] ``` -------------------------------- ### AsciiDoc Unordered Description List Source: https://docs.asciidoctor.org/asciidoc/latest/lists/description-with-marker Demonstrates the basic syntax for creating an unordered description list with markers in AsciiDoc. Each item starts with a term followed by '::' and its description. ```asciidoc [unordered] boolean:: use true and false, not 1 and 0 or T and F number:: use Arabic numerals without punctuation (other than the decimal point to make a floating point number) enumerated value:: use only one of the allowed values, respecting case ``` -------------------------------- ### Asciidoctor Image Sizing Example Source: https://docs.asciidoctor.org/asciidoc/latest/macros/image-size Demonstrates how to control the size of an image in various output formats using Asciidoctor's image attributes. This example shows specific sizing for PDF and scaled width. ```asciidoc image::flower.jpg[Flower,640,480,pdfwidth=50%,scaledwidth=50%] ``` -------------------------------- ### AsciiDoc Paragraph Structure Example Source: https://docs.asciidoctor.org/asciidoc/latest/blocks/paragraphs Demonstrates how adjacent or consecutive lines of text form a paragraph element in AsciiDoc. To start a new paragraph, an empty line is required. ```asciidoc Paragraphs don't require any special markup in AsciiDoc. A paragraph is just one or more lines of consecutive text. To begin a new paragraph, separate it by at least one empty line from the previous paragraph or block. ``` -------------------------------- ### AsciiDoc Preamble Example Source: https://docs.asciidoctor.org/asciidoc/latest/blocks/preamble-and-lead Demonstrates the structure of an AsciiDoc document with a preamble. The preamble content appears before the first section title. ```asciidoc = The Intrepid Chronicles This adventure begins on a frigid morning. We've run out of coffee beans, but leaving our office means venturing into certain peril. Yesterday, a colony of ravenous Wolpertingers descended from the foothills. No one can find the defensive operations manual, and our security experts are on an off-the-grid team-building retreat in Katchanga. What are we going to do? == Certain Peril Daylight trickles across the cobblestones... ``` -------------------------------- ### Console Command Example with AsciiDoc Source: https://docs.asciidoctor.org/asciidoc/latest/verbatim/source-highlighter Illustrates the use of the 'console' language identifier in AsciiDoc for representing commands typed into a terminal. This example shows a simple command with its prompt. ```console $ asciidoctor -v ``` -------------------------------- ### AsciiDoc Highlight Syntax Example Source: https://docs.asciidoctor.org/asciidoc/latest/text/highlight Demonstrates the AsciiDoc syntax for highlighting text using a pair of hash symbols. This syntax is used for notation purposes and is rendered as marked text. ```asciidoc Mark my words, #automation is essential#. ``` -------------------------------- ### Asciidoc Revision Line Structure Examples Source: https://docs.asciidoctor.org/asciidoc/latest/document/revision-line Demonstrates various valid formats for Asciidoc revision lines, including optional revision dates and remarks. These examples adhere to specific ordering and separation syntax required for processor detection. ```asciidoc = Document Title author revision number, revision date: revision remark ``` ```asciidoc v7.5 ``` ```asciidoc 7.5, 1-29-2020 ``` ```asciidoc 7.5: A new analysis ``` ```asciidoc 7.5, 1-29-2020: A new analysis ``` -------------------------------- ### Ordered List with 'start' Attribute Source: https://docs.asciidoctor.org/asciidoc/latest/lists/ordered Explains how to use the `[start=N]` attribute to define the starting number for an ordered list, providing a more robust way to control numbering offsets compared to manual prefixing. ```asciidoc [start=4] . Step four . Step five . Step six ``` -------------------------------- ### Asciidoc Document Structure Example Source: https://docs.asciidoctor.org/asciidoc/latest/macros/xref-text-and-style Demonstrates a basic Asciidoc document structure including a section title and an image reference, used to illustrate cross-reference styling. ```asciidoc == Installation .Big Cats image::big-cats.png[] ``` -------------------------------- ### Icon Macro Role Example Source: https://docs.asciidoctor.org/asciidoc/latest/macros/icon-macro Demonstrates how to use the `role` attribute with the icon macro to apply styling, such as color, to the icon. ```asciidoc icon:tags[role=blue] ruby, asciidoctor ``` -------------------------------- ### Icon Macro Example with Attributes Source: https://docs.asciidoctor.org/asciidoc/latest/macros/icon-macro Illustrates how to use attributes within the icon macro to customize its appearance, such as setting the size and role (color). ```asciidoc icon:heart[2x,role=red] ``` -------------------------------- ### Asciidoctor SVG Image Options Examples Source: https://docs.asciidoctor.org/asciidoc/latest/macros/image-svg Demonstrates the usage of different options for referencing SVG images in Asciidoctor, showing how 'none', 'interactive', and 'inline' affect the output and interactivity. ```asciidoc image::sample.svg[Static,300] ``` ```asciidoc image::sample.svg[Interactive,300,opts=interactive] ``` ```asciidoc image::sample.svg[Embedded,300,opts=inline] ``` -------------------------------- ### Asciidoctor Keyboard Macro Source: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference Shows the Asciidoctor keyboard macro (`kbd:`) for representing keyboard shortcuts. Requires the `experimental` attribute to be enabled. Examples include single keys and key combinations. ```asciidoc |=== |Shortcut |Purpose |kbd:[F11] |Toggle fullscreen |kbd:[Ctrl+T] |Open a new tab |=== ``` -------------------------------- ### AsciiDoc Revision Line Example 1 Source: https://docs.asciidoctor.org/asciidoc/latest/document/revision-line Demonstrates a standard AsciiDoc revision line including author, version, date, and a remark. It shows the required structure and formatting for these elements. ```asciidoc = The Intrepid Chronicles Kismet Lee (1) 2.9, October 31, 2021: Fall incarnation (2) (3) (4) ``` -------------------------------- ### Block with Style, Role, and Options (Shorthand) Source: https://docs.asciidoctor.org/asciidoc/latest/attributes/options Example of combining block style, role, and options using shorthand syntax. The block style is positional, role is prefixed with '.', and options use '%'. ```asciidoc [horizontal.properties%step] property 1:: does stuff property 2:: does different stuff ``` -------------------------------- ### Asciidoctor Sidebar Block Example Source: https://docs.asciidoctor.org/asciidoc/latest/blocks Demonstrates the syntax for defining a sidebar block in AsciiDoc, including a title and an ID. This showcases how metadata lines are applied to blocks. ```asciidoc .Styles of music [#music-styles] **** Go off on a tangent to describe what a style of music is. **** ``` -------------------------------- ### AsciiDoc reftext Attribute Output Example Source: https://docs.asciidoctor.org/asciidoc/latest/macros/xref-text-and-style When the `reftext` attribute is used, the specified text ('Installation Procedure' in this case) becomes the visible text for the cross-reference link, overriding the section's title ('Installation'). ```asciidoc Installation Procedure ``` -------------------------------- ### AsciiDoc Default Cross Reference Text Source: https://docs.asciidoctor.org/asciidoc/latest/macros/xref-text-and-style By default, the text of an AsciiDoc cross-reference link matches the title of the referenced element. For example, a link to a section titled 'Installation' will display 'Installation' as the link text. ```asciidoc Installation ``` -------------------------------- ### Asciidoctor Block Audio Macro Source: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference Demonstrates the Asciidoctor block audio macro syntax (`audio::`). Shows basic usage and how to control playback with attributes like `start` and `opts` (e.g., `autoplay`). ```asciidoc audio::ocean-waves.wav[] audio::ocean-waves.wav[start=60,opts=autoplay] ``` -------------------------------- ### Invalid AsciiDoc IDs Source: https://docs.asciidoctor.org/asciidoc/latest/attributes/id Examples of identifiers that are not recommended or may cause issues due to spaces or invalid starting characters, especially when considering cross-format portability. ```asciidoc install the gem 3 blind mice -about-the-author ``` -------------------------------- ### Icon Macro DocBook Conversion Example Source: https://docs.asciidoctor.org/asciidoc/latest/macros/icon-macro Presents the DocBook XML output for an icon macro. This format uses specific elements like and to represent the icon. ```docbook tags ruby, asciidoctor ``` -------------------------------- ### Asciidoctor Glossary Description List Syntax Example Source: https://docs.asciidoctor.org/asciidoc/latest/sections/glossary Demonstrates the Asciidoctor syntax for creating a glossary using description lists. It shows how to apply the `glossary` attribute to both the section and the list itself, defining terms and their descriptions. ```asciidoc [glossary] == Glossary [glossary] mud:: wet, cold dirt rain:: water falling from the sky ``` -------------------------------- ### Example with Titled and Untitled Tables Source: https://docs.asciidoctor.org/asciidoc/latest/tables/customize-title-label Illustrates using the `table-caption` attribute with multiple tables, including titled and untitled ones. Shows how the caption is applied and numbered sequentially to titled tables. ```asciidoc = Document Title :table-caption: Data Set .A table with a title [cols="2,1"] |=== |Lots and lots of data |A little data |834,734 |3 |3,999,271.5601 |5 |=== |=== |Group |Climate |Example |A |Tropical |Suva, Fiji |B |Arid |Lima, Peru |=== .Another table with a title |=== |Value |Result |Notes |Null |A mystery |See Appendix R |=== ``` -------------------------------- ### HTML Head Docinfo Example Source: https://docs.asciidoctor.org/asciidoc/latest/docinfo This snippet demonstrates content that can be placed in an HTML head docinfo file. It includes meta tags for keywords and descriptions, and links for stylesheets and scripts, which are injected into the `` element of the HTML output. ```html ``` -------------------------------- ### Asciidoc Block Macro Example Source: https://docs.asciidoctor.org/asciidoc/latest/key-concepts Demonstrates the syntax for a block macro in AsciiDoc, used for non-text elements that reside on a line by themselves. It typically includes a name, target, and an optional attribute list. ```asciidoc image::sunset.jpg[Sunset] ``` -------------------------------- ### Block with Style, Role, and Options (Formal Syntax) Source: https://docs.asciidoctor.org/asciidoc/latest/attributes/options Demonstrates setting block style, role, and options using formal syntax with commas separating attributes. This provides explicit naming for each attribute. ```asciidoc [horizontal,role=properties,opts=step] property 1:: does stuff property 2:: does different stuff ``` -------------------------------- ### AsciiDoc Multi-Part Book with Special Sections Source: https://docs.asciidoctor.org/asciidoc/latest/sections/parts Demonstrates structuring a multi-part AsciiDoc book. Includes a book-level preface, multiple parts, and part-specific sections like glossaries and prefaces. Shows how to define special sections within different parts of the book. ```asciidoc = Multi-Part Book with Parts that Have Special Sections Author Name :doctype: book [preface] = Book Preface This is the preface for the whole book. === Preface Subsection Chinchillas rule the world. = Part 1 This is the introduction to the first part of our mud-encrusted journey. == Chapter 1 There was mud... == Chapter 2 Great gobs of mud... [glossary] == Part 1 Glossary [glossary] mud:: wet, cold dirt = Part 2 [preface] == Part 2 Preface This is a preface just for part 2. == Chapter 3 The mud had turned to cement... ``` -------------------------------- ### AsciiDoc Ordered List Styling with Start Number Source: https://docs.asciidoctor.org/asciidoc/latest/lists/ordered Demonstrates how to control the starting number and style of ordered list items in AsciiDoc. The `start` attribute sets the initial number, and the block style (e.g., `lowerroman`, `loweralpha`) defines the numeration format for each level. ```asciidoc [lowerroman,start=5] . Five . Six [loweralpha] .. a .. b .. c . Seven ``` -------------------------------- ### Asciidoctor Attribute Undefined Example Source: https://docs.asciidoctor.org/asciidoc/latest/attributes/unresolved-references Demonstrates the syntax for an expression that undefines an attribute in Asciidoctor. This example is used to illustrate the behavior controlled by the 'attribute-undefined' attribute. ```asciidoc {set:name!} ``` -------------------------------- ### AsciiDoc Link using Windows UNC Path Source: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference Shows how to create a link to a network resource using a Windows UNC path. ```asciidoc link:\\server\share\whitepaper.pdf[Whitepaper] ``` -------------------------------- ### Asciidoctor: Question and Answer List Syntax (`[qanda]`) Source: https://docs.asciidoctor.org/asciidoc/latest/lists/qanda Demonstrates the AsciiDoc syntax for creating question and answer lists using the `[qanda]` block. Each entry uses `::` to separate the question(s) from the answer, allowing for multiple questions per answer. ```asciidoc [qanda] What is the answer?:: This is the answer. Are cameras allowed?:: Are backpacks allowed?:: No. ``` -------------------------------- ### Override imagesdir in AsciiDoc document Source: https://docs.asciidoctor.org/asciidoc/latest/attributes/assignment-precedence Example of overriding an attribute (`imagesdir`) within an AsciiDoc document. This is possible when the CLI assignment uses the `@` modifier, as shown in the preceding examples. ```asciidoc = Document Title :imagesdir: new/path/to/images ``` -------------------------------- ### Asciidoctor Counter Initialization Source: https://docs.asciidoctor.org/asciidoc/latest/attributes/counters Shows how to initialize an Asciidoctor counter with a specific starting value, which can be a number or a character. This allows for custom sequences, such as starting a list with 'A)' instead of '1)'. ```asciidoc Dessert calls for {counter:seq1:A}) mangoes, {counter:seq1}) grapes and {counter:seq1}) cherries. ``` -------------------------------- ### Bibliography with References in AsciiDoc Source: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference Demonstrates how to define and reference bibliography entries in AsciiDoc. It shows the syntax for creating citations and linking them to detailed reference entries. ```asciidoc _The Pragmatic Programmer_ <> should be required reading for all developers. To learn all about design patterns, refer to the book by the "`Gang of Four`" <>. [bibliography] == References * [[[pp]]] Andy Hunt & Dave Thomas. The Pragmatic Programmer: From Journeyman to Master. Addison-Wesley. 1999. * [[[gof,gang]]] Erich Gamma, Richard Helm, Ralph Johnson & John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley. 1994. ``` -------------------------------- ### Basic Captioned Title Example Source: https://docs.asciidoctor.org/asciidoc/latest/blocks/add-title Demonstrates how to add a title to an example block in AsciiDoc. When the corresponding caption attribute is set, Asciidoctor prefixes the title with a caption label and number. ```asciidoc .Block that supports captioned title ==== Block content ==== ``` -------------------------------- ### Unset Automatically Declared Attribute 'example-caption' Source: https://docs.asciidoctor.org/asciidoc/latest/attributes/unset-attributes Illustrates unsetting the 'example-caption' attribute, which is automatically set by Asciidoctor to label example blocks. Unsetting it prevents example blocks from being labeled and numbered. ```asciidoc = Title :!example-caption: (1) ``` -------------------------------- ### Asciidoc Description List Syntax Source: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference Demonstrates the syntax for description lists in Asciidoc, where terms are followed by their definitions. Supports multi-line descriptions. ```asciidoc First term:: The description can be placed on the same line as the term. Second term:: Description of the second term. The description can also start on its own line. ``` -------------------------------- ### Shell Script Example with AsciiDoc Source: https://docs.asciidoctor.org/asciidoc/latest/verbatim/source-highlighter Demonstrates the usage of the 'shell' language identifier in AsciiDoc for highlighting shell scripts. This example shows a typical shell script structure, including a shebang and a function. ```shell #!/bin/sh fail () { echo echo "$*" echo exit 1 } >&2 JAVACMD=java which java >/dev/null 2>&1 || fail "ERROR: no 'java' command could be found in your PATH. exec "$JAVACMD" "$@" ``` -------------------------------- ### Asciidoctor Menu Macro Source: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference Demonstrates the Asciidoctor menu macro (`menu:`) for representing menu paths and actions in software interfaces. Requires the `experimental` attribute. Examples show single-level and multi-level menu navigation. ```asciidoc To save the file, select menu:File[Save]. Select menu:View[Zoom > Reset] to reset the zoom level to the default setting. ``` -------------------------------- ### AsciiDoc Table Cell Spanning Example Source: https://docs.asciidoctor.org/asciidoc/latest/tables/span-cells Demonstrates how to span multiple columns and rows in an AsciiDoc table using the `.+` syntax for cell specifiers. This example shows the markup and the resulting table structure. ```asciidoc |=== |Column 1, header row |Column 2, header row |Column 3, header row |Column 4, header row |Cell in column 1, row 2 2.3+|This cell spans columns 2 and 3 and rows 2, 3, and 4 because its specifier contains a span of `2.3+` |Cell in column 4, row 2 |Cell in column 1, row 3 |Cell in column 4, row 3 |Cell in column 1, row 4 |Cell in column 4, row 4 |=== ``` -------------------------------- ### Basic AsciiDoc Description List Source: https://docs.asciidoctor.org/asciidoc/latest/lists/description Demonstrates the fundamental structure of an AsciiDoc description list using the '::' delimiter to define terms and their descriptions. Each term is followed by its content. ```asciidoc CPU:: The brain of the computer. Hard drive:: Permanent storage for operating system and/or user files. RAM:: Temporarily stores information the CPU uses during operation. Keyboard:: Used to enter text or control items on the screen. Mouse:: Used to point to and select items on your computer screen. Monitor:: Displays information in visual form using text and graphics. ``` -------------------------------- ### Asciidoc Question and Answer List Syntax Source: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference Illustrates the syntax for creating question and answer lists in Asciidoc. Supports multiple questions and answers within a single list block. ```asciidoc [qanda] What is the answer?:: This is the answer. Are cameras allowed?:: Are backpacks allowed?:: No. ``` -------------------------------- ### AsciiDoc Callout Syntax Example Source: https://docs.asciidoctor.org/asciidoc/latest/verbatim/callouts Demonstrates the AsciiDoc syntax for adding callouts to a source block. Callout numbers are placed at the end of lines within the block and defined below. This example uses a Ruby source block. ```asciidoc [source,ruby] ---- ``` ```ruby require 'sinatra' <1> get '/hi' do <2> <3> "Hello World!" end ``` ```asciidoc ---- <1> Library import <2> URL mapping <3> Response block ``` -------------------------------- ### AsciiDoc: Table with Title, Header, and Content Source: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference Demonstrates creating a basic AsciiDoc table with a title, a header row, and multiple rows of content. The number of columns is inferred from the first non-empty line. ```asciidoc .Table Title |=== |Column 1, Header Row |Column 2, Header Row (1) (2) |Cell in column 1, row 1 |Cell in column 2, row 1 |Cell in column 1, row 2 |Cell in column 2, row 2 |=== ``` -------------------------------- ### AsciiDoc Paragraph Starting with Hard Break Source: https://docs.asciidoctor.org/asciidoc/latest/blocks/hard-line-breaks Demonstrates how to make an AsciiDoc paragraph start with a hard line break. This is achieved by placing the `{empty}` attribute reference followed by the hard break syntax (`+`) at the beginning of the first line. ```asciidoc {empty} + line two ``` -------------------------------- ### AsciiDoc Implicit Part Intro Source: https://docs.asciidoctor.org/asciidoc/latest/sections/parts Illustrates an implicit part introduction in AsciiDoc. The content following the part title and before the first chapter section serves as the part intro without explicit styling. ```asciidoc = Book Title :doctype: book = Part I This is the implicit partintro. == Chapter A ``` -------------------------------- ### Asciidoc Ordered List Syntax Source: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference Demonstrates the syntax for creating ordered lists in Asciidoc. It shows how to define numbered steps and nested ordered lists. ```asciidoc . Step 1 . Step 2 .. Step 2a .. Step 2b . Step 3 ``` -------------------------------- ### AsciiDoc Quotes Substitution Examples Source: https://docs.asciidoctor.org/asciidoc/latest/subs/quotes Demonstrates AsciiDoc syntax for inline formatting and its corresponding HTML output after the quotes substitution step. Includes common formatting like emphasis, strong, monospace, and quotes. ```asciidoc Happy werewolves are *really* slobbery. ``` ```html Happy werewolves are really slobbery. ``` ```APIDOC AsciiDoc Quotes Substitution Mapping: | Name | AsciiDoc | HTML | | --- | --- | --- | | emphasis | _word_ | word | | strong | *word* | word | | monospace | `word` | word | | superscript | ^word^ | word | | subscript | ~word~ | word | | double curved quotes | "`word`" | “word” | | single curved quotes | '`word`' | ‘word’ ``` -------------------------------- ### AsciiDoc Hard Wrap Attribute Example Source: https://docs.asciidoctor.org/asciidoc/latest/attributes/wrap-values This example demonstrates how to define an AsciiDoc attribute (`haiku`) that preserves hard line breaks within its value. It uses the `+ \` syntax at the end of each line to indicate a hard line break, ensuring newlines are maintained in the output. ```asciidoc :haiku: Write your docs in text, + \ AsciiDoc makes it easy, + \ Now get back to work! ``` -------------------------------- ### Sidebar Syntax Source: https://docs.asciidoctor.org/asciidoc/latest/asciidoc-vs-markdown Demonstrates how to create a sidebar block in AsciiDoc. ```asciidoc .Lightweight Markup **** Writing languages that let you type less and express more. **** ``` -------------------------------- ### Italic Syntax Comparison Source: https://docs.asciidoctor.org/asciidoc/latest/asciidoc-vs-markdown Compares the syntax for applying italic formatting in AsciiDoc and Markdown, including constrained and unconstrained examples. ```markdown *italic* ``` ```asciidoc _italic_ ``` ```asciidoc __i__talic ``` -------------------------------- ### AsciiDoc Line Comment Syntax Source: https://docs.asciidoctor.org/asciidoc/latest/comments Demonstrates the basic syntax for a single-line comment in AsciiDoc. Lines starting with '//' are ignored by the processor. ```AsciiDoc // A single-line comment. ``` -------------------------------- ### Inline Pass Macro Usage Example Source: https://docs.asciidoctor.org/asciidoc/latest/pass/pass-macro Demonstrates the usage of the AsciiDoc 'pass' macro for passing content directly or with specific substitutions applied. ```asciidoc pass:[content like #{variable} passed directly to the output] followed by normal content. content with only select substitutions applied: pass:c,a[__<{email}>__] ``` -------------------------------- ### Docinfo File for HTML Head with License Attributes Source: https://docs.asciidoctor.org/asciidoc/latest/docinfo An example of a docinfo file (`docinfo.html`) designed for HTML output, including attribute references for license URL and title. This shows how to inject dynamic content into the HTML ``. ```asciidoc ``` -------------------------------- ### Icon Macro Font Rotate and Flip Example Source: https://docs.asciidoctor.org/asciidoc/latest/macros/icon-macro Shows how to apply rotation and flipping transformations to font icons using named attributes. ```asciidoc icon:shield[rotate=90, flip=vertical] ``` -------------------------------- ### Asciidoctor ifndef Basic Example Source: https://docs.asciidoctor.org/asciidoc/latest/directives/ifdef-ifndef Demonstrates the `ifndef` directive, which is the logical opposite of `ifdef`. Content is included only if the specified attribute (`env-github`) is *not* set. ```asciidoc ifndef::env-github[] This content is not shown on GitHub. endif::[] ``` -------------------------------- ### Asciidoctor Button Macro Source: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference Illustrates the Asciidoctor button macro (`btn:`) for representing buttons in user interfaces. Requires the `experimental` attribute. Examples show common button labels like 'OK' and 'Open'. ```asciidoc Press the btn:[OK] button when you are finished. Select a file in the file navigator and click btn:[Open]. ``` -------------------------------- ### Asciidoctor ifdef Basic Example Source: https://docs.asciidoctor.org/asciidoc/latest/directives/ifdef-ifndef Demonstrates the basic `ifdef` directive. Content within this block is included only if the specified attribute (`env-github`) is set. ```asciidoc ifdef::env-github[] This content is for GitHub only. endif::[] ``` -------------------------------- ### AsciiDoc Basic Unordered List Source: https://docs.asciidoctor.org/asciidoc/latest/lists/unordered Demonstrates creating a basic unordered list using the asterisk (*) marker. Each list item must be offset from the marker by at least one space, and empty lines are required before and after the list. ```asciidoc * Edgar Allan Poe * Sheri S. Tepper * Bill Bryson ``` -------------------------------- ### DSV Table Example Source: https://docs.asciidoctor.org/asciidoc/latest/tables/data-format Illustrates populating an AsciiDoc table with colon-separated values (DSV). The `format=dsv` attribute is used, and the default separator for DSV is a colon. ```asciidoc [%header,format=dsv] |=== Artist:Track:Genre Robyn:Indestructible:Dance The Piano Guys:Code Name Vivaldi:Classical |=== ``` -------------------------------- ### Rouge line highlighting with Asciidoctor Source: https://docs.asciidoctor.org/asciidoc/latest/verbatim/highlight-lines Illustrates setting up Asciidoctor with Rouge for source highlighting and applying line highlighting via the `highlight` attribute. This requires supplemental CSS to be included, typically via a docinfo file. ```asciidoc = Document Title :source-highlighter: rouge :docinfo: shared [,ruby,highlight=2..5] ---- ``` -------------------------------- ### Specify Only Mailto Subject Source: https://docs.asciidoctor.org/asciidoc/latest/macros/mailto-macro Example of creating a mailto link where only the subject is specified, omitting the email body. The second positional attribute is used for the subject. ```mailto mailto:join@discuss.example.org[,Subscribe me] ``` -------------------------------- ### Asciidoc Keywords Attribute Example Source: https://docs.asciidoctor.org/asciidoc/latest/document/metadata Demonstrates the usage of the 'keywords' attribute in AsciiDoc to define comma-separated values that are later translated into HTML meta tags. ```asciidoc = The Intrepid Chronicles Kismet Lee; Lazarus Draeke :keywords: team, obstacles, journey, victory This journey begins on a bleary Monday morning. ``` -------------------------------- ### AsciiDoc Description List Whitespace Handling Source: https://docs.asciidoctor.org/asciidoc/latest/lists/description Illustrates AsciiDoc's leniency with whitespace in description lists, showing how indentation and blank lines can be used to improve readability without affecting the rendered output. ```asciidoc Dairy:: * Milk * Eggs Bakery:: * Bread Produce:: * Bananas ``` -------------------------------- ### AsciiDoc: Line and Block Comments Source: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference Illustrates how to add comments in AsciiDoc. Single-line comments start with `//`, while multi-line comments are enclosed within `////`. ```asciidoc // A single-line comment //// A multi-line comment. Notice it's a delimited block. //// ``` -------------------------------- ### Asciidoctor Include Directive Syntax Source: https://docs.asciidoctor.org/asciidoc/latest/directives/include Demonstrates the general syntax for the Asciidoctor include directive, highlighting the required target and optional attributes for controlling content inclusion. ```asciidoc include::target[leveloffset=offset,lines=ranges,tag(s)=name(s),indent=depth,encoding=encoding,opts=optional] ``` -------------------------------- ### AsciiDoc Inline Anchors and Cross References Source: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference Provides examples of defining inline anchors using `[[id]]` or `[#id]` and creating cross-references to these anchors using `<>`. ```asciidoc [[bookmark-a]]Inline anchors make arbitrary content referenceable. [#bookmark-b]#Inline anchors can be applied to a phrase like this one.# anchor:bookmark-c[]Use a cross reference to link to this location. [[bookmark-d,last paragraph]]The xreflabel attribute will be used as link text in the cross-reference link. See <> to learn how to write paragraphs. Learn how to organize the document into <>. ``` -------------------------------- ### AsciiDoc: Table from CSV Data (Formal) Source: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference Demonstrates creating an AsciiDoc table from CSV data using the `format=csv` attribute. The `[%header]` option ensures the first row is used as the table header. ```asciidoc [%header,format=csv] |=== Artist,Track,Genre Baauer,Harlem Shake,Hip Hop The Lumineers,Ho Hey,Folk Rock |=== ``` -------------------------------- ### Asciidoc Highlight, Underline, Strikethrough, Custom Role Source: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference Applies semantic formatting like highlighting, underlining, and strikethrough, and allows custom styling via roles. Highlight uses `#text#`, underline `[.underline]#text#`, strikethrough `[.line-through]#text#`, and custom roles `[.myrole]#text#`. ```asciidoc Mark my words, #automation is essential#. ##Mark##up refers to text that contains formatting ##mark##s. Where did all the [.underline]#cores# go? We need [.line-through]#ten# twenty VMs. A [.myrole]#custom role# must be fulfilled by the theme. ``` -------------------------------- ### Asciidoctor: Abstract Block on Paragraph Source: https://docs.asciidoctor.org/asciidoc/latest/sections/abstract-block Example showing the `abstract` block style applied directly to a paragraph in AsciiDoc, including a document title and a subsequent section. ```asciidoc = Document Title [abstract] .Abstract Documentation is a distillation of many long adventures. == First Section ``` -------------------------------- ### AsciiDoc Listing Style Syntax Example Source: https://docs.asciidoctor.org/asciidoc/latest/verbatim/listing-blocks Demonstrates applying the `listing` style to a paragraph using an attribute list in AsciiDoc. This preserves monospace formatting and line breaks for the content within the block. ```asciidoc [listing] This is an example of a paragraph assigned the `listing` style in an attribute list. Notice that the monospace marks are preserved in the output. ``` -------------------------------- ### Icon Macro Font Size Example Source: https://docs.asciidoctor.org/asciidoc/latest/macros/icon-macro Illustrates how to increase the size of a font icon using the `size` attribute, showing both positional and named attribute usage. ```asciidoc icon:heart[2x] or icon:heart[size=2x] ``` -------------------------------- ### Asciidoctor ifdef Long-Form Example Source: https://docs.asciidoctor.org/asciidoc/latest/directives/ifdef-ifndef Illustrates the long-form `ifdef` directive, which is useful for multi-line conditional content. The attribute name is repeated in the `endif` directive for clarity. ```asciidoc ifdef::env-github[] This content is for GitHub only. So much content in this section, I'd get confused reading the source without the closing `ifdef` directive. It isn't necessary for short blocks, but if you are conditionally including a section it may be something worth considering. Other readers reviewing your docs source code may go cross-eyed when reading your source docs if you don't. endif::env-github[] ``` -------------------------------- ### AsciiDoc Preface Section Example Source: https://docs.asciidoctor.org/asciidoc/latest/sections/preface Demonstrates how to define a preface section in an AsciiDoc document. This style is applicable when the `doctype` is set to `book`. It shows the required section level (`==`) for the preface and (`===`) for its subsections. ```asciidoc = Book Title :doctype: book [preface] == Our Preface I awoke one morning and was confronted by the dark and stormy eyes of the chinchilla. She had conquered the mountain of government reports that had eroded into several minor foothills and a creeping alluvial plain of loose papers. === Preface Subsection Chinchillas rule the world. == Chapter 1 ... ```