reStructuredText 备忘单: 语法提醒¶
- 信息
 有关介绍性文档,请参阅<http://docutils.sf.net/rst.html>。
- 作者
 David Goodger <goodger@python.org>
- Date
 $Date: 2013-02-20 02:10:53 +0100 (Mi, 20. Feb 2013) $
- 调整
 $Revision: 7612 $
- 描述
 这是一个 “docinfo块” ,或书目字段列表
注解
如果您将其作为HTML阅读,请阅读`<cheatsheet.txt>`_而不是查看输入语法示例!
部分结构¶
章节标题带有下划线或带标题和下划线。
身体元素¶
网格表:
Paragraphs are flush-left, separated by blank lines. 
  | 
Literal block, preceded by “::”: Indented
or: > Quoted
 | 
>>> print 'Doctest block'
Doctest block
 | 
|
Line blocks preserve line breaks & indents. [new in 0.3.6] 
Useful for addresses, verse, and adornment-free lists; long
lines can be wrapped with continuation lines. 
 | 
|
Simple tables:
List Type  | 
Examples (syntax in the text source)  | 
|---|---|
Bullet list  | 
  | 
Enumerated list  | 
  | 
Definition list  | 
  | 
Field list  | 
  | 
Option list  | 
  | 
Explicit Markup  | 
Examples (visible in the text source)  | 
|---|---|
Footnote  | 
  | 
Citation  | 
  | 
Hyperlink Target  | 
|
Anonymous Target  | 
|
Directive (“::”)  | 
 
 | 
Substitution Def  | 
|
Comment  | 
|
Empty Comment  | 
(“..” on a line by itself, with blank lines before & after, used to separate indentation contexts)  | 
内联标记¶
emphasis; strong emphasis; interpreted text; interpreted text
with role; inline literal text; standalone hyperlink,
http://docutils.sourceforge.net; named reference, reStructuredText;
anonymous reference; footnote reference, 1; citation reference,
[CIT2002]; like an inline directive; inline internal target.
指令快速参考¶
See <http://docutils.sf.net/docs/ref/rst/directives.html> for full info.
指令名称  | 
说明(在[方括号]中添加了Docutils版本)  | 
|---|---|
attention  | 
具体的告诫;还有”caution”, “danger”, “error”, “hint”, “important”, “note”, “tip”, “warning”  | 
admonition  | 
通用标题的箴言:   | 
image  | 
  | 
figure  | 
喜欢 “image” ,但带有可选的标题和图例  | 
topic  | 
  | 
sidebar  | 
  | 
parsed-literal  | 
A literal block with parsed inline markup  | 
rubric  | 
  | 
epigraph  | 
使用class = “epigraph” 阻止引用  | 
highlights  | 
使用class = “highlight” 阻止引用  | 
pull-quote  | 
使用class = “pull-quote” 阻止引用  | 
compound  | 
复合段落[0.3.6]  | 
container  | 
通用块级容器元素 [0.3.10]  | 
table  | 
创建一个标题表 [0.3.1]  | 
list-table  | 
从统一的两级项目符号列表中创建一个表 [0.3.8]  | 
csv-table  | 
从CSV数据创建表 [0.3.4]  | 
contents  | 
生成目录  | 
sectnum  | 
自动编号部分,子部分等。  | 
header, footer  | 
创建文档装饰 [0.3.8]  | 
target-notes  | 
为每个外部目标创建一个明确的脚注  | 
math  | 
数学符号(以LaTeX格式输入)  | 
meta  | 
特定于HTML的元数据  | 
include  | 
读取外部reST文件,就像它是内联的一样  | 
raw  | 
非reST数据未经传递给Writer  | 
replace  | 
替换定义的替换文本  | 
unicode  | 
用于替换defs的Unicode字符代码转换  | 
date  | 
生成今天的日期;替代定义  | 
class  | 
在下一个元素上设置 “class” 属性  | 
role  | 
创建自定义解释文本角色[0.3.2]  | 
default-role  | 
设置默认的解释文本角色 [0.3.10]  | 
title  | 
设置元数据文档标题 [0.3.10]  | 
解释文本角色快速参考¶
看到 <http://docutils.sf.net/docs/ref/rst/roles.html> 获取完整信息。
角色名称  | 
描述  | 
|---|---|
重点  | 
相当于*强调*  | 
文字  | 
相当于``literal``但处理反斜杠转义  | 
math  | 
数学符号(以LaTeX格式输入)  | 
PEP  | 
参考编号的Python增强建议  | 
RFC  | 
参考编号的Internet请求注释  | 
raw  | 
对于非reST数据;不能直接使用(参见文档) [0.3.6]  | 
strong  | 
相当于**强**  | 
sub  | 
Subscript  | 
sup  | 
Superscript  | 
title  | 
标题参考(书籍等);标准默认角色  |