在 reStructuredText CSV 中创建引用 table

Create a reference inside a reStructuredText CSV table

我有一个这样的 CSV table

.. csv-table::
   :header: Name, BrowseName, DataType, Description
   :widths: 16,16,16,52

   "Enabled", "Enabled", "Boolean", "Alarm can..."

并且我想在 HTML 输出中创建对一行的引用。我试图将 .. _reference: 放入 table 中的每个位置,但要么出现编译错误,要么单元格为空。我也尝试使用 reST 替换定义,但没有成功。

您知道是否有办法在那种 table 中添加这样的引用,或者引用只在网格 table 中起作用?

您可以在 CSV 中插入任意 reST,类似于 this answer. The alignment is tricky, so I recommend indenting everything uniformly by 4 spaces. The label is inserted in the second row and the :ref: directive must be given both a title and the label, per Sphinx's documentation on the :ref: role

:ref:`link to hello <mylabel>`

.. csv-table:: Test csv-table with multi-paragraph
    :header: "a", "b", "c"

    Cat,"Chunk that is updated periodically via copy-and-paste.

    Line #2, #3, etc", "Kitten"
    Dog,".. _mylabel:

    Hello", "Puppy"
    Walrus,"#.  List Item 1
    #.  List Item 2
    #.  List Item 3", "Pup"