文档的标题及其部分使用非字母数字的字符下划线。它们可以是上划线和下划线,并
且通常的做法是,在标题中使用这种双标记,在章节中使用一个简单的下划线。
最常用的字符下划线的标题是以下列顺序进行排序:=、- 、_、:、#、+、^。
当一个字符用于章节时,它与其级别相关联,并且必须在整个文档中始终使用。考虑下面的代码
Document title
Introduction to the document content.
Section 1
First document section with two subsections.
Note the “=” used as heading underline.
Subsection A
First subsection (A) of Section 1.
Note the “-” used as heading underline.
Subsection B
Second subsection (B) of Section 1.
Section 2
Second section of document with one subsection.
Subsection C
Subsection © of Section 2.
列表
reST 提供了易读的自动枚举特性的列表语法(运行结果参见图 9-2),主要有:无序列
表,枚举列表和自定义列表
Bullet list:
- one
- two
- three
- Enumerated list:
- one
- two
#. auto-enumerated
Definition list:
one
one is a number.
two
two is also a number.
行内标记
文本可以使用行内标记来设置样式。
● 强调:斜体。
● 加粗强调:粗体。
●行内预格式化
:行内预格式化文本(通常为等宽,终端样式)。
●带有链接的文本
_:只要文档中提供了超链接,这将被替换为超链接(参见链接部分)。
文字块
当你需要呈现一些代码示例时,可以使用文字块。两个冒号用于标记代码块,代码块
需要进行缩进,如下所示:
This is a code example
::
1 + 1
2
Let’s continue our text
请注意,冒号字符可以放在文本行中。在这种情况下,它将被渲染为单个冒号
This is a code example::
1 + 1
2
Let’s continue our text
如果不想保留单个冒号,可以在前面的文本和::之间插入一个空格。在这种情况下,::
将被解释并且完全删除。