How to create table output in reStructuredText without using the RST table format?

I am trying to port our API documents and their documentation generator schema to reStructuredText. The piece that gives the hardest time is a tabular representation of the API information encoded directly in HTML, a la:

--------+------------+--------+--------------------------------+
Param   |  Required  |  Type  |  Description
----------------------------------------------------------------
id      |     Yes    | int    | This is the ID of the record...
content |     No     | string | Optional string contents...

(i.e. it is currently encoded as <tr><td class='param'>id</td><td class='required'>Yes</td>...)

I want to do this in RST, but do it semantically, and not just use the RST table format. But I can't find any good examples of custom directives to handle it the way I want it to be something like

:.. parameter-table:: My Parameter Table
    .. item::
       :param: "id"
       :required: true
       :type: "int"
       :desc: "This is the ID of the record..."

How can I accomplish this in reStructuredText?

+5
1

, . ?

( ):

.. list-table:: Frozen Delights!
   :widths: 15 10 30
   :header-rows: 1

   * - Treat
     - Quantity
     - Description
   * - 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!

( , ). , , , 90% .

+3

All Articles