Linux Documentation
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Joe Stringer <joe@isovalent.com>, linux-doc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH linux-doc] docs/doc-guide: Clarify how to write tables
Date: Sun, 12 Mar 2023 14:24:26 -0600	[thread overview]
Message-ID: <875yb5wwed.fsf@meer.lwn.net> (raw)
In-Reply-To: <20230312201712.367545-1-joe@isovalent.com>

Joe Stringer <joe@isovalent.com> writes:

Thanks for working to improve the docs...I have a couple of questions,
though.

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

There's all kinds of things you can do in RST, but we've deliberately
not tried to create a new RST guide in the kernel docs.  I'm not sure
that tables merit an exception to that?  If people really need help,
perhaps a link to (say)

  https://docutils.sourceforge.io/docs/user/rst/quickref.html#tables

would suffice?

> Signed-off-by: Joe Stringer <joe@isovalent.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             | ...        | ...      |          |
> +   +------------------------+------------+----------+----------+

...and if they do merit an exception, why would we prefer the full grid
format (which is harder to create and maintain) than the simple table
format?  Most of the time, the simple format can do what's needed, and I
don't think it's less readable.

Thanks,

jon

  reply	other threads:[~2023-03-12 20:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-12 20:17 [PATCH linux-doc] docs/doc-guide: Clarify how to write tables Joe Stringer
2023-03-12 20:24 ` Jonathan Corbet [this message]
2023-03-12 21:11   ` Joe Stringer
2023-03-14 18:14     ` Jonathan Corbet
2023-03-16  1:55       ` Joe Stringer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875yb5wwed.fsf@meer.lwn.net \
    --to=corbet@lwn.net \
    --cc=joe@isovalent.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox