AsciiDoc语法参考

学习笔记

由招文桃在2020年2月12日发布

段落

段落不需要特别的格式,直接写就是了。 然后呢

自然段

这是普通段落

开始至少空一格就成为自然段,同一个自然段里面的内容必须相邻,
即不能隔空行。
隔空行就是另一个自然段了。自然段文字是等宽字体,然后会保留空格和新行。
例如    保留了前边的空格,
然后这样,保留了换新行。

现在这里又是一个普通段落了。

然后呢

杂记

使用 Travis CI 也挺好玩的,搭建起持续集成的工作流。在这里也添加个动图吧:

一个普通图:

City

一个专用动图:

travis 真香!

bold constrained & unconstrained

italic constrained & unconstrained

bold italic constrained & unconstrained

monospace constrained & unconstrained

monospace bold constrained & unconstrained

monospace italic constrained & unconstrained

monospace bold italic constrained & unconstrained

C++ is valid syntax in the programming language by the same name.

WHERE id <= 20 AND value = "{name}" is a SQL WHERE clause.

public class Hello {
  public static void main(String[] args) {
    System.out.println("Hello");
  }
}

Werewolves are allergic to cassia cinnamon.

Did the werewolves read the small print?

Where did all the cores run off to?

We need ten make that twenty VMs.

Once upon an infinite loop.

superscript phrase

subscript phrase

“double curved quotes”

‘single curved quotes’

Olaf’s desk was a mess.

All of the werewolves’ desks were a mess.

Olaf had been with the company since the ’60s.

Rubies are red,
Topazes are blue.

Ruby is red.
Java is black.

Lists

  • Edgar Allen Poe

  • Sheri S. Tepper

  • Bill Bryson

max nesting

  • level 1

    • level 2

      • level 3

        • level 4

          • level 5

  • level 1

Ordered, basic

  1. Step 1

  2. Step 2

  3. Step 3

Ordered, max nesting

  1. level 1

    1. level 2

      1. level 3

        1. level 4

          1. level 5

  2. level 1

Checklist

  • checked

  • also checked

  • not checked

  • normal list item

Description, single-line

first term

definition of first term

second term

definition of second term

Description, multi-line

first term

definition of first term

second term

definition of second term

Q & A

  1. What is Asciidoctor?

    An implementation of the AsciiDoc processor in Ruby.

  2. What is the answer to the Ultimate Question?

    42

Complex content in outline lists

  • Every list item has at least one paragraph of content, which may be wrapped, even using a hanging indent.

    Additional paragraphs or blocks are adjoined by putting a list continuation on a line adjacent to both blocks.

    list continuation

    a plus sign (+) on a line by itself

  • A literal paragraph does not require a list continuation.

    $ gem install asciidoctor
  • AsciiDoc lists may contain any complex content.

    Application Language

    AsciiDoc

    Python

    Asciidoctor

    Ruby

超链接

See 自然段 to learn how to write paragraphs.

Learn how to organize the document into sections.

图片

GitHub mascot

UI Macro

Shortcut Purpose

F11

Toggle fullscreen

Ctrl+T

Open a new tab

Ctrl+Shift+N

New incognito window

\

Used to escape characters

Ctrl+]

Jump to keyword

Ctrl++

Increase zoom

Content in a passthrough block is passed to the output unprocessed. That means you can include raw HTML, like this embedded Gist:

Four score and seven years ago our fathers brought forth on this continent a new nation…​

— Abraham Lincoln
Address delivered at the dedication of the Cemetery at Gettysburg
A person who never made a mistake never tried anything new.
— Albert Einstein

A person who never made a mistake never tried anything new.

If you don’t know where you are going, any road will get you there.

— Charles Lutwidge Dodgson
Mathematician and author, also known as Lewis Carroll
AsciiDoc history

AsciiDoc was first released in Nov 2002 by Stuart Rackham. It was designed from the start to be a shorthand syntax for producing professional documents like DocBook and LaTeX.

Example 1. Sample document

Here’s a sample AsciiDoc document:

= Title of Document
Doc Writer
:toc:

This guide provides...

The document header is useful, but not required.

An admonition block may contain complex content.

A list
  • one

  • two

  • three

Another paragraph.

line of code  (1)
line of code  (2)
line of code  (3)
line of code  (4)
1 A callout behind a line comment for C-style languages.
2 A callout behind a line comment for Ruby, Python, Perl, etc.
3 A callout behind a line comment for Clojure.
4 A callout behind a line comment for XML or SGML languages like HTML.
<section>
  <title>Section Title</title> (1)
</section>
1 The section title is required.

插入视频

Table 1. Table Title
Name of Column 1 Name of Column 2 Name of Column 3

Cell in column 1, row 1

Cell in column 2, row 1

Cell in column 3, row 1

Cell in column 1, row 2

Cell in column 2, row 2

Cell in column 3, row 2

Artist Track Genre

Baauer

Harlem Shake

Hip Hop

The Lumineers

Ho Hey

Folk Rock

Artist Track Genre

Baauer

Harlem Shake

Hip Hop

1

2

3

4

5

6

7

8

9

10

To save the file, select File  Save.

Select View  Zoom  Reset to reset the zoom level to the default setting.