Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

some online tool or automation plugin for sublimetext for generating sphinx RST tables

I am using Sphinx for documentation.

I would like to easily genearate based e.g on CSV file or copy-paste text the table like shown here: reStructuredText Tables.

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

Which SublimeText plugin can I use for it or maybe there exists some online tool?

like image 557
andilabs Avatar asked Oct 28 '14 13:10

andilabs


2 Answers

Using a CSV list to define a table is possible in ReST without any extra tools (many people don't know that though, including me until recently). You can link to a file or URL as resource, or just provide the text:

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

Creates this table:

result of CSV table in restructuredText

Documentation can be found here: http://docutils.sourceforge.net/docs/ref/rst/directives.html#id4

like image 97
Iodnas Avatar answered Nov 20 '22 17:11

Iodnas


All right I found something like this http://www.tablesgenerator.com/text_tables

It creates eaxctly what I wanted and you can easily import CSV file, or just copy-paste.

like image 43
andilabs Avatar answered Nov 20 '22 16:11

andilabs