使用 reStructuredText 制作 html(二)

列表:
1, '* ' * +空格 表示实心圆
2, '1' 数字表示数字列表
3, '# ' # + 空格 表示 延续上一个列表形式
we can also be autonumbered using a '#' sign

* This is a bulleted list.
* It has two items, the second
  item uses two lines.

1. This is a numbered list.
2. It has two items too.

#. This is a numbered list.
#. It has two items too.
列表是可以镶嵌的:
* this is
* a list

  * with a nested list
  * and some subitems

* and here the parent list continues
表格的制作:
+------------------------+------------+----------+----------+
| Header row, column 1   | Header 2   | Header 3 | Header 4 |
| (header rows optional) |            |          |          |
+========================+============+==========+==========+
| body row 1, column 1   | column 2   | column 3 | column 4 |
+------------------------+------------+----------+----------+
| body row 2             | ...        | ...      |          |
+------------------------+------------+----------+----------+
csv 的制作
.. csv-table:: Frozen Delights!
   :header: "Treat", "Quantity", "Description"
   :widths: 15, 10, 30

   "Albatross", 2.99, "On a stick!"
   "Crunchy Frog", 1.49, "If we took the bones out, it wouldn't be
   crunchy, now would it?"
   "Gannet Ripple", 1.99, "On a stick!"
Python 函数的生成!
* cription about the api function
* argument, key, keyword: Description of a parameter.
* type: Type of a parameter. Creates a link if possible.
* raises, raise, except, exception: That (and when) a specific exception is raised.
* var, ivar, cvar: Description of a variable.
* vartype: Type of a variable. Creates a link if possible.
* returns, return: Description of the return value.
* rtype: Return type. Creates a link if possible.

.. py:function:: send_message(sender, recipient, message_body, [priority=1])

   Send a message to a recipient

   :param str sender: The person sending the message
   :param str recipient: The recipient of the message
   :param str message_body: The body of the message
   :param priority: The priority of the message, can be a number 1-5
   :type priority: integer or None
   :return: the message id
   :rtype: int
   :raises ValueError: if the message_body exceeds 160 characters
   :raises TypeError: if the message_body is not a basestring
可以参考我的githup
https://github.com/shiqilouyang/sphinx_doc

 

posted @ 2018-10-09 22:27  十七楼的羊  阅读(272)  评论(0编辑  收藏  举报