章节标题
在此页面上,您将学习:
-
如何使用 AsciiDoc 标记章节标题。
标题层级语法
章节将页面划分为内容层次结构。 在 AsciiDoc 中,章节通过章节标题来定义。
Example 1. Section title syntax
== Level 1 Section Title
=== Level 2 Section Title
==== Level 3 Section Title
===== Level 4 Section Title
====== Level 5 Section Title
== Another Level 1 Section Title
当页面转换为 HTML 时,每个章节标题会变成一个标题元素,标题级别与等号的数量相匹配。例如,一级章节(==
)对应于 <h2>
HTML 标签。
章节标题必须使用 Atx 风格(单行)定义,以一个或多个等号开头。Antora 不支持以前由 AsciiDoc 支持的 Setext 风格(两行)语法。如果使用 Setext 风格语法,页面中的交叉引用将无法解析,其他 AsciiDoc 功能也将不可用。
AsciiDoc 和 Asciidoctor 资源