reStructuredText

http://docutils.sourceforge.net/rst.html

reST是易读所见即所得的文本标记语言,格式类似markdown。

python的reST参考pep12和pep287:

https://www.python.org/dev/peps/pep-0012/

https://www.python.org/dev/peps/pep-0287/

主标题:

1
2
3
4
5
6
title
=====

=====
title
=====

副标题:

1
2
3
4
5
6
Subtitle
-----

--------
Subtitle
--------

次级标题:

1
2
Content
^^^^^^^

星号斜体强调:

1
*text*

双星号加粗重点强调:

1
**text**

四个或以上的-表示分割线:

1
----

参考式链接:

1
2
3
`hyperlink`_

.. _hyperlink: http://hyperlink.org

行内式链接:

1
`link <https://link.com>`_

图片:

1
2
3
4
5
.. image:: https://path/image.png
    :alt: HTTPie compared to cURL
    :width: 679
    :heigh: 781
    :align: center

原样引用块:

双冒号加四个空格

1
2
3
4
source code::

    print("source")
    return 0

文档测试块:

1
>>> print doctest block.

无序列表:

1
2
3
4
bullet lists:

- This is item 1
- This is item 2

有序列表:

1
2
3
4
enumerated lists:

1. this is first item
2. this is second item

定义列表:

1
2
3
4
5
6
7
definition lists:

what
    Definition lists.

how
    The term is a one-line phrase.

域列表:

1
2
3
4
5
6
field lists:

:Authors:
    Canux

:Version: 1.0.0

选项列表:

1
2
3
4
option lists:

-a    option "a"
-b file    option for filename

评论:

1
2
.. This is commnet.
   As well.