用于生成sphinx RST表的sublimetext的一些在线工具或自动化插件

时间:2014-10-28 13:37:47

标签: python-sphinx restructuredtext

我使用sphinx作为文档。

我想基于例如CSV文件或复制粘贴文本轻松地进行基因创建,如下所示: http://sphinx-doc.org/rest.html

+------------------------+------------+----------+----------+
| 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             | ...        | ...      |          |
+------------------------+------------+----------+----------+

请帮助我指出我可以使用哪个sublimeText插件,或者可能存在一些在线工具

3 个答案:

答案 0 :(得分:12)

好吧,我发现了类似http://www.tablesgenerator.com/text_tables

的内容

它可以创建我想要的内容,您可以轻松导入CSV文件,或只是复制粘贴。

答案 1 :(得分:8)

使用CSV列表可以在ReST中定义表而无需任何额外的工具(很多人不知道这一点,包括我直到最近)。您可以将文件或URL链接为资源,或者只提供文本:

.. 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!"

创建此表:

result of CSV table in restructuredText

可以在此处找到文档:http://docutils.sourceforge.net/docs/ref/rst/directives.html#id4

答案 2 :(得分:0)

另一种选择是内置 sphinx List Table

<块引用>

列表表 (ref) 是一个两级列表,其中第一级是行,第二级是列列表。列数必须统一(无列跨度),但单元格可以包含结构化标记。

.. list-table:: Weather forecast
   :header-rows: 1
   :widths: 7 7 7 7 60
   :stub-columns: 1

   *  -  Day
      -  Min Temp
      -  Max Temp
      -
      -  Summary
   *  -  Monday
      -  11C
      -  22C
      -  .. image:: _static/sunny.svg
            :width: 30
      -  A clear day with lots of sunshine.
         However, the strong breeze will bring
         down the temperatures.
   *  -  Tuesday
      -  9C
      -  10C
   ...

导致此表​​:

List Table Example

进一步documentation

相关问题