"Fossies" - the Fresh Open Source Software Archive

Member "asciidoctor-2.0.10/data/reference/syntax.adoc" (1 Jun 2019, 6253 Bytes) of package /linux/www/asciidoctor-2.0.10.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 = AsciiDoc Syntax
    2 :icons: font
    3 :stem:
    4 :toc: left
    5 :url-docs: https://asciidoctor.org/docs
    6 :url-gem: https://rubygems.org/gems/asciidoctor
    7 
    8 A brief reference of the most commonly used AsciiDoc syntax.
    9 You can find the full documentation for the AsciiDoc syntax at {url-docs}.
   10 
   11 == Paragraphs
   12 
   13 A normal paragraph.
   14 Line breaks are not preserved.
   15 // line comments, which are lines that start with //, are skipped
   16 
   17 A blank line separates paragraphs.
   18 
   19 [%hardbreaks]
   20 This paragraph carries the `hardbreaks` option.
   21 Notice how line breaks are now preserved.
   22 
   23  An indented (literal) paragraph disables text formatting,
   24  preserves spaces and line breaks, and is displayed in a
   25  monospaced font.
   26 
   27 [sidebar#id.role]
   28 A style, ID, and/or role gives a paragraph (or block) special meaning, like this sidebar.
   29 
   30 NOTE: An admonition paragraph, like this note, grabs the reader's attention.
   31 
   32 TIP: Convert this document using the `asciidoctor` command to see the output produced from it.
   33 
   34 == Text Formatting
   35 :hardbreaks:
   36 
   37 .Constrained (applied at word boundaries)
   38 *strong importance* (aka bold)
   39 _stress emphasis_ (aka italic)
   40 `monospaced` (aka typewriter text)
   41 "`double`" and '`single`' typographic quotes
   42 +passthrough text+ (substitutions disabled)
   43 `+literal text+` (monospaced with substitutions disabled)
   44 
   45 .Unconstrained (applied anywhere)
   46 **C**reate+**R**ead+**U**pdate+**D**elete
   47 fan__freakin__tastic
   48 ``mono``culture
   49 
   50 .Replacements
   51 A long time ago in a galaxy far, far away...
   52 (C) 1976 Arty Artisan
   53 I believe I shall--no, actually I won't.
   54 
   55 .Macros
   56 // where c=specialchars, q=quotes, a=attributes, r=replacements, m=macros, p=post_replacements, etc.
   57 The European icon:flag[role=blue] is blue & contains pass:[************] arranged in a icon:circle-o[role=yellow].
   58 The pass:c[->] operator is often referred to as the stabby lambda.
   59 Since `pass:[++]` has strong priority in AsciiDoc, you can rewrite pass:c,a,r[C++ => C{pp}].
   60 // activate stem support by adding `:stem:` to the document header
   61 stem:[sqrt(4) = 2]
   62 
   63 :!hardbreaks:
   64 == Attributes
   65 
   66  // define attributes in the document header; must be flush with left margin
   67  :name: value
   68 
   69 You can download and install Asciidoctor {asciidoctor-version} from {url-gem}.
   70 C{pp} is not required, only Ruby.
   71 Use a leading backslash to output a word enclosed in curly braces, like \{name}.
   72 
   73 == Links
   74 
   75 [%hardbreaks]
   76 https://example.org/page[A webpage]
   77 link:../path/to/file.txt[A local file]
   78 xref:document.adoc[A sibling document]
   79 mailto:hello@example.org[Email to say hello!]
   80 
   81 == Anchors
   82 
   83 [[idname,reference text]]
   84 // or written using normal block attributes as `[#idname,reftext=reference text]`
   85 A paragraph (or any block) with an anchor (aka ID) and reftext.
   86 
   87 See <<idname>> or <<idname,optional text of internal link>>.
   88 
   89 xref:document.adoc#idname[Jumps to anchor in another document].
   90 
   91 This paragraph has a footnote.footnote:[This is the text of the footnote.]
   92 
   93 == Lists
   94 
   95 === Unordered
   96 
   97 * level 1
   98 ** level 2
   99 *** level 3
  100 **** level 4
  101 ***** etc.
  102 * back at level 1
  103 +
  104 Attach a block or paragraph to a list item using a list continuation (which you can enclose in an open block).
  105 
  106 .Some Authors
  107 [circle]
  108 - Edgar Allen Poe
  109 - Sheri S. Tepper
  110 - Bill Bryson
  111 
  112 === Ordered
  113 
  114 . Step 1
  115 . Step 2
  116 .. Step 2a
  117 .. Step 2b
  118 . Step 3
  119 
  120 .Remember your Roman numerals?
  121 [upperroman]
  122 . is one
  123 . is two
  124 . is three
  125 
  126 === Checklist
  127 
  128 * [x] checked
  129 * [ ] not checked
  130 
  131 === Callout
  132 
  133 // enable callout bubbles by adding `:icons: font` to the document header
  134 [,ruby]
  135 ----
  136 puts 'Hello, World!' # <1>
  137 ----
  138 <1> Prints `Hello, World!` to the console.
  139 
  140 === Description
  141 
  142 first term:: description of first term
  143 second term::
  144 description of second term
  145 
  146 == Document Structure
  147 
  148 === Header
  149 
  150  // header must be flush with left margin
  151  = Document Title
  152  Author Name <author@example.org>
  153  v1.0, 2019-01-01
  154 
  155 === Sections
  156 
  157  // must be flush with left margin
  158  = Document Title (Level 0)
  159  == Level 1
  160  === Level 2
  161  ==== Level 3
  162  ===== Level 4
  163  ====== Level 5
  164  == Back at Level 1
  165 
  166 === Includes
  167 
  168  // must be flush with left margin
  169  include::basics.adoc[]
  170 
  171  // define -a allow-uri-read to allow content to be read from URI
  172  include::https://example.org/installation.adoc[]
  173 
  174 == Blocks
  175 
  176 --
  177 open - a general-purpose content wrapper; useful for enclosing content to attach to a list item
  178 --
  179 
  180 // recognized types include CAUTION, IMPORTANT, NOTE, TIP, and WARNING
  181 // enable admonition icons by setting `:icons: font` in the document header
  182 [NOTE]
  183 ====
  184 admonition - a notice for the reader, ranging in severity from a tip to an alert
  185 ====
  186 
  187 ====
  188 example - a demonstration of the concept being documented
  189 ====
  190 
  191 .Toggle Me
  192 [%collapsible]
  193 ====
  194 collapsible - these details are revealed by clicking the title
  195 ====
  196 
  197 ****
  198 sidebar - auxiliary content that can be read independently of the main content
  199 ****
  200 
  201 ....
  202 literal - an exhibit that features program output
  203 ....
  204 
  205 ----
  206 listing - an exhibit that features program input, source code, or the contents of a file
  207 ----
  208 
  209 [,language]
  210 ----
  211 source - a listing that is embellished with (colorized) syntax highlighting
  212 ----
  213 
  214 ```language
  215 fenced code - a shorthand syntax for the source block
  216 ```
  217 
  218 [,attribution,citetitle]
  219 ____
  220 quote - a quotation or excerpt; attribution with title of source are optional
  221 ____
  222 
  223 [verse,attribution,citetitle]
  224 ____
  225 verse - a literary excerpt, often a poem; attribution with title of source are optional
  226 ____
  227 
  228 ++++
  229 pass - content passed directly to the output document; often raw HTML
  230 ++++
  231 
  232 // activate stem support by adding `:stem:` to the document header
  233 [stem]
  234 ++++
  235 x = y^2
  236 ++++
  237 
  238 ////
  239 comment - content which is not included in the output document
  240 ////
  241 
  242 == Tables
  243 
  244 .Table Attributes
  245 [cols=>1h;2d,width=50%,frame=topbot]
  246 |===
  247 | Attribute Name | Values
  248 
  249 | options
  250 | header,footer,autowidth
  251 
  252 | cols
  253 | colspec[;colspec;...]
  254 
  255 | grid
  256 | all \| cols \| rows \| none
  257 
  258 | frame
  259 | all \| sides \| topbot \| none
  260 
  261 | stripes
  262 | all \| even \| odd \| none
  263 
  264 | width
  265 | (0%..100%)
  266 
  267 | format
  268 | psv {vbar} csv {vbar} dsv
  269 |===
  270 
  271 == Multimedia
  272 
  273 image::screenshot.png[block image,800,450]
  274 
  275 Press image:reload.svg[reload,16,opts=interactive] to reload the page.
  276 
  277 video::movie.mp4[width=640,start=60,end=140,options=autoplay]
  278 
  279 video::aHjpOzsQ9YI[youtube]
  280 
  281 video::300817511[vimeo]
  282 
  283 == Breaks
  284 
  285 // thematic break (aka horizontal rule)
  286 ---
  287 
  288 // page break
  289 <<<