reStructuredText Intro
我看着 reStructuredText 的文档绝望极了,真的比 markdown 复杂多了 T_T。我尝试着在这里做点笔记。
1 与 markdown 的比较¶
reStructuredText 对中文的体验极其不友好, 因为它很多结构(表格/标题)要求宽度对应,但是中文毕竟和英文跨度不同, 很多编辑器甚至处理器可能都有不同的处理方式…… 不爽。 所以下面的表格用英文了。
相邻的两个块之间要用空行隔开。
/ | Markdown | reStructuredText |
---|---|---|
Title | # h1 ## h2 ### h3 etc. | ========== h1 ========== or: h2 ---------- Must be wider than the text # * = - ^ ” could be used [1] |
Bold |
|
|
Italic |
|
|
Blockquote | > quote1 > quote2 | not blockquote here indent and you get one another line nested another |
Inline Code |
|
|
Block Code | ``` code ``` | :: code |
Footnote 2 |
and later the page: .. [1] footnote could be indented | |
Link 2 |
|
|
In-page links 2 |
| |
Lists |
| same, same. |
Images |
| .. image:: link :alt: alttext |

2 其它¶
2.1 生成目录¶
使用:
2.2 表格¶
一个方便的编辑表格的方法是使用 CSV 表格:
显示出来就是这个样子:
第一行第一列 | 示范一个内嵌代码块: |
2.3 自动章节编号¶
在文章里找个地方放下:
这么一行就可以了。不要放在最前面和 meta 信息混在一起,会无效。至少空一行。
2.4 Admonition¶
支持的有 attention, caution, danger, error, hint, important, note, tip, warning
,例如:
注解
这样渲染起来会使这个样子。
3 在 Nikola 的特殊用法¶
因为我用的是 Nikola 这个静态博客生成系统,而在博客相关的功能方面它提供了一些特殊语法。
This work is licensed under Creative Commons Attribution-ShareAlike 4.0 International
评论