1. 介绍

Asciidoctor是一个快速、开源、基于Ruby的文本处理器,用于将AsciiDoc®解析为文档模型并将其转换为输出格式,例如HTML5、DocBook5、手册页、PDF、EPUB3和其他格式。

2. 官方地址

3. 应用场景

1.需要撰写复杂结构文档,如技术规范、手册、书籍等。
2.需要生成多种输出格式,并保持格式的一致性。
3.需要文档中包含复杂元素,如表格、脚注、图表等。

4. 快速入门

4.1. 标题

= 文档标题
== 一级标题
=== 二级标题
==== 三级标题
===== 四级标题
====== 五级标题

4.2. 无序列表

语法 => * 文字
  • 无序列表

    • 无序列表

      • 无序列表

4.3. 图片

区块图片,语法 => image::图片地址[图片描述,长度,高度,对齐=左对齐/居中/右对齐](在HTML页面上面查看有问题)
image::image/tools/img.png[目录,100,100,align=left]
image::image/tools/img.png[目录,100,100,align=center]
image::image/tools/img.png[目录,100,100,align=right]
目录
目录
目录
行内图片,语法 => image:图片地址[图片描述,长度,位置,标题(鼠标移至图片上方看到的描述)]
image:image/tools/img.png[目录,100,role=left,title="role=left"]
image:image/tools/img.png[目录,100,role=right,title="role=right"]
image:image/tools/img.png[目录,100,role=thumb,title="role=thumb"]
image:image/tools/img.png[目录,100,role=related,title="role=related"]

目录 目录 目录 目录

图片浮动,语法
           => [.左浮动/右浮动]
           => image:[图片描述,长度]
  [.float-group]
-
  [.left]
  image:image/tools/img.png[目录,100]
-
  [.right]
  image::image/tools/img.png[目录,100]

目录

目录

4.4. 网络链接

语法 => 链接[描绘]
https://github.com/KouShenhai/KCloud-Platform-IoT[老寇IoT云平台 Github 地址]

4.5. 文件链接

语法 => link:文件地址[描述]
link:index.html[链接首页HTML]

4.6. 表格

[长度,百分比]
|===
|内容 |内容
|===
[width=100%,cols="1,1"]
|===
|内容 |内容
|===

内容

内容

4.7. 代码块

默认不换行,语法
             => [source,语言]
             => ----
             => 代码块
             => ----
[source,java]
----
public static void test() {
    String str = "1234567890qwertyuiopasdfghjklzxcvbnm";
}
----
public static void test() {
    String str = "1234567890qwertyuiopasdfghjklzxcvbnm";
}
自动换行,语法
        => [source%nowrap,语言]
        => ----
        => 代码块
        => ----
[source%nowrap,java]
----
public static void test() {
    String str = "1234567890qwertyuiopasdfghjklzxcvbnm";
}
----
public static void test() {
    String str = "1234567890qwertyuiopasdfghjklzxcvbnm";
}

4.8. 小技巧

// 清除图片浮动
++++
<br style="clear: both;">
++++