[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230312201712.367545-1-joe@isovalent.com>
Date: Sun, 12 Mar 2023 13:17:12 -0700
From: Joe Stringer <joe@...valent.com>
To: linux-doc@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, corbet@....net
Subject: [PATCH linux-doc] docs/doc-guide: Clarify how to write tables
Prior to this commit, the kernel docs writing guide spent over a page
describing exactly how *not* to write tables into the kernel docs,
without providing a example about the desired format.
This patch provides a positive example first in the guide so that it's
harder to miss, then leaves the existing less desirable approach below
for contributors to follow if they have some stronger justification for
why to use that approach.
Signed-off-by: Joe Stringer <joe@...valent.com>
---
Documentation/doc-guide/sphinx.rst | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/Documentation/doc-guide/sphinx.rst b/Documentation/doc-guide/sphinx.rst
index 23edb427e76f..9c2210b6ea3f 100644
--- a/Documentation/doc-guide/sphinx.rst
+++ b/Documentation/doc-guide/sphinx.rst
@@ -313,9 +313,25 @@ the documentation build system will automatically turn a reference to
function name exists. If you see ``c:func:`` use in a kernel document,
please feel free to remove it.
+Tables
+------
+
+Tables should be written in cell grid form unless there is a strong
+justification for using an alternate format:
+
+.. code-block:: rst
+
+ +------------------------+------------+----------+----------+
+ | 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 | ... | ... | |
+ +------------------------+------------+----------+----------+
list tables
------------
+~~~~~~~~~~~
The list-table formats can be useful for tables that are not easily laid
out in the usual Sphinx ASCII-art formats. These formats are nearly
--
2.34.1
Powered by blists - more mailing lists