使用 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

 

转载于:https://www.cnblogs.com/shi-qi/articles/9763537.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Sphinx是一个开源的文档生成工具,它可以帮助你创建高质量的文档,并支持多种输出格式,包括HTML。Ubuntu是一个基于Linux的操作系统,而HTML是一种用于创建网页的标记语言。 在Ubuntu上使用Sphinx生成HTML文档的步骤如下: 1. 首先,确保你已经安装了Python和pip。可以通过在终端中运行以下命令来检查: ``` python --version pip --version ``` 如果没有安装,请根据官方文档进行安装。 2. 安装Sphinx。在终端中运行以下命令: ``` pip install sphinx ``` 3. 创建一个新的Sphinx项目。在终端中进入你想要创建项目的目录,并运行以下命令: ``` sphinx-quickstart ``` 在交互式提示中,你可以选择配置一些选项,如项目名称、作者等。 4. 编写文档。在Sphinx项目的根目录下,你会看到一个名为"source"的文件夹。在该文件夹中,你可以使用reStructuredText或Markdown编写你的文档。 5. 配置Sphinx。在"source"文件夹中,你会看到一个名为"conf.py"的文件。你可以编辑该文件来配置Sphinx的各种选项,如主题、输出格式等。 6. 生成HTML文档。在终端中进入Sphinx项目的根目录,并运行以下命令: ``` make html ``` 这将会在"build"文件夹中生成HTML文档。 7. 查看生成的HTML文档。在"build/html"文件夹中,你可以找到生成的HTML文档。你可以在浏览器中打开"index.html"文件来查看文档。 希望以上介绍对你有帮助!如果你有任何相关问题,请随时提问。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值