From: Randy Dunlap <rdunlap@infradead.org>
To: "Nícolas F. R. A. Prado" <nfraprado@protonmail.com>,
"Jonathan Corbet" <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
lkcamp@lists.libreplanetbr.org, andrealmeid@collabora.com
Subject: Re: [PATCH 0/2] docs: Add automatic cross-reference for C types
Date: Wed, 2 Sep 2020 19:43:08 -0700 [thread overview]
Message-ID: <1a03c65e-6fbc-25f9-e553-61259a310f29@infradead.org> (raw)
In-Reply-To: <20200903005747.3900333-1-nfraprado@protonmail.com>
On 9/2/20 5:58 PM, Nícolas F. R. A. Prado wrote:
> In order to cross-reference C types in the documentation, Sphinx
> requires the syntax :c:type:`type_name`, or even :c:type:`struct
> type_name <type_name>` in order to have the link text different from the
> target text.
> This patch series removes the need for that markup.
>
> The first commit extends the automarkup script to enable automatic
> cross-reference of C types by matching any "struct|union|enum|typedef type_name"
> expression.
> This makes the documentation's plain text cleaner and adds cross-reference to
> types without any additional effort by the author.
>
> The second commit updates the "Cross-referencing from
> reStructuredText" section in Documentation/doc-guide/kernel-doc.rst
> to reflect that no additional syntax is needed when cross-referencing both types
> and functions anymore.
>
> When testing this, I did find an edge-case from the output of
> Documentation/output/scsi/scsi_mid_low_api.rst on the "typedef struct scsi_cmnd
> Scsi_Cmnd;", where 'typedef struct' is being identified as a reference, but
> there isn't any named 'struct', so it renders bold.
There also isn't any file name scsi_typedefs.h any longer,
so maybe we can update scsi_mid_low_api.rst as well.
Thanks.
> I thought of adding an ignore_names list just like there is one for functions,
> with 'struct' in it, to workaround this edge case, but since it was the only
> one I found, and also because it was unclear what the desired output was
> (cross-reference 'struct scsi_cmnd' or leave the whole expression as plain text)
> I wanted to get some feedback beforehand.
>
> After getting this merged I intend to start removing the occurrences of :c:type.
>
> Thanks,
> Nícolas
>
> Nícolas F. R. A. Prado (2):
> docs: Add automatic cross-reference for C types
> kernel-doc: Update "cross-referencing from rST" section to use
> automarkup
>
> Documentation/doc-guide/kernel-doc.rst | 33 ++++++++++++-----------
> Documentation/sphinx/automarkup.py | 37 +++++++++++++++++---------
> 2 files changed, 41 insertions(+), 29 deletions(-)
>
--
~Randy
next prev parent reply other threads:[~2020-09-03 2:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-03 0:58 [PATCH 0/2] docs: Add automatic cross-reference for C types Nícolas F. R. A. Prado
2020-09-03 0:58 ` [PATCH 1/2] " Nícolas F. R. A. Prado
2020-09-03 0:58 ` [PATCH 2/2] kernel-doc: Update "cross-referencing from rST" section to use automarkup Nícolas F. R. A. Prado
2020-09-03 2:43 ` Randy Dunlap [this message]
2020-09-03 21:33 ` [PATCH 0/2] docs: Add automatic cross-reference for C types Jonathan Corbet
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=1a03c65e-6fbc-25f9-e553-61259a310f29@infradead.org \
--to=rdunlap@infradead.org \
--cc=andrealmeid@collabora.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkcamp@lists.libreplanetbr.org \
--cc=nfraprado@protonmail.com \
/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;
as well as URLs for NNTP newsgroup(s).