asciidoctor格式
格式化文本
加粗斜体等宽
加粗斜体等宽可组合叠加
例如:
_italic phrase_
__i__talic le__tt__ers
*bold phrase*
**b**old le**tt**ers
*_bold italic phrase_*
**__b__**old italic le**__tt__**ers
`monospace phrase` and le``tt``ers
`_monospace italic phrase_` and le``__tt__``ers
`*monospace bold phrase*` and le``**tt**``ers
`*_monospace bold italic phrase_*` and le``**__tt__**``ers
italic phrase
italic letters
bold phrase
bold letters
bold italic phrase
bold italic letters
monospace phrase
and lett
ers
monospace italic phrase
and lett
ers
monospace bold phrase
and lett
ers
monospace bold italic phrase
and lett
ers
警告
书写内容:
1
2
3
4
5
6
7
8
9
NOTE: 这是一个NOTE信息
TIP: 提示信息
IMPORTANT: 重要信息..
WARNING: 警告信息
CAUTION: 注意信息
展示结果如下:
这是一个NOTE信息 |
提示信息 |
重要信息.. |
警告信息 |
注意信息 |
还可添加侧边栏:
1
2
3
4
[NOTE]
====
There are things to note!
====
输出结果如下:
There are things to note! |
画图
参考地址: asciidoctor-diagram
ditaa
[ditaa]
....
+-------------+
| Asciidoctor |-------+
| diagram | |
+-------------+ | PNG out
^ |
| ditaa in |
| v
+--------+ +--------+----+ /---------------\
| | --+ Asciidoctor +--> | |
| Text | +-------------+ | Beautiful |
|Document| | !magic! | | Output |
| {d}| | | | |
+---+----+ +-------------+ \---------------/
: ^
| Lots of work |
+-----------------------------------+
....
效果:
+-------------+ | Asciidoctor |-------+ | diagram | | +-------------+ | PNG out ^ | | ditaa in | | v +--------+ +--------+----+ /---------------\ | | --+ Asciidoctor +--> | | | Text | +-------------+ | Beautiful | |Document| | !magic! | | Output | | {d}| | | | | +---+----+ +-------------+ \---------------/ : ^ | Lots of work | +-----------------------------------+
plantuml
[plantuml, diagram-classes, png]
....
class BlockProcessor
class DiagramBlock
class DitaaBlock
class PlantUmlBlock
BlockProcessor <|-- DiagramBlock
DiagramBlock <|-- DitaaBlock
DiagramBlock <|-- PlantUmlBlock
....
效果:
class BlockProcessor class DiagramBlock class DitaaBlock class PlantUmlBlock BlockProcessor <|-- DiagramBlock DiagramBlock <|-- DitaaBlock DiagramBlock <|-- PlantUmlBlock
文件操作
图片
语法:
image::http://asciidoctor.org/images/octocat.jpg[GitHub mascot]
效果:
本地图片:
image::/img/test.png[alt]
效果:
包含文件
包含文件会直接在构建后的结果文件中展示加入包含的文件内容。
include::hgf.adoc[]
从URL中链接
:asciidoctor-source: https://raw.githubusercontent.com/asciidoctor/asciidoctor/master include::{asciidoctor-source}/README.adoc[]