Linux Documentation
 help / color / mirror / Atom feed
From: "Nícolas F. R. A. Prado" <nfraprado@protonmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	lkcamp@lists.libreplanetbr.org, andrealmeid@collabora.com
Subject: Re: [PATCH] docs: Make automarkup ready for Sphinx 3.1+
Date: Thu, 08 Oct 2020 02:15:24 +0000	[thread overview]
Message-ID: <C674RBXSO9XN.1LXXU71QQNTF1@ArchWay> (raw)

On Wed Oct 7, 2020 at 8:40 PM -03, Matthew Wilcox wrote:
>
> On Wed, Oct 07, 2020 at 11:12:25PM +0000, Nícolas F. R. A. Prado wrote:
> > While Sphinx 2 used a single c:type role for struct, union, enum and
> > typedef, Sphinx 3 uses a specific role for each one.
> > To keep backward compatibility, detect the Sphinx version and use the
> > correct roles for that version.
> >
> > Also, Sphinx 3 is more strict with its C domain and generated warnings,
> > exposing issues in the parsing.
> > To fix the warnings, make the C regexes use ASCII, ensure the
> > expressions only match the beginning of words and skip trying to
> > cross-reference C reserved words.
>
> Thank you for doing this!
>
> I have a feature request ... could you automarkup NULL as being
> :c:macro?
> Or maybe just anything matching \<[[:upper:]_[:digit:]]*\>
> (i may have my regex syntax confused ... a word composed of any
> arrangement of upper-case, digits and underscores.)

I think what you are suggesting are two separate things.

For NULL, what you're interested in is that it appears in a monospaced font, as
if written ``NULL``, right? As I don't think a cross-reference to "the NULL
macro definition" would make much sense.

While "anything containing only upper-case, digits and underscores" would
actually be for cross-referencing to the definition of the macro symbol in
question, right?

At the moment, this automarkup script is being used only for cross-referencing,
but it is indeed a generic automarkup script, and could be used for the
formatting of NULL.  But we also can't just make every upper-case word written
in monospaced font, as that doesn't always makes sense.

So if I understood your two requests correctly, I think we could:
1. Always automatically format NULL using a literal ``.
2. Try to cross-reference every upper-case word with the macro definition using
:c:macro, but if the cross-reference doesn't exist, format it normally, since
it's just normal text (this is what we're doing for C references at the moment).

What do you think?

Thanks,
Nícolas


             reply	other threads:[~2020-10-08  2:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-08  2:15 Nícolas F. R. A. Prado [this message]
2020-10-08  2:47 ` [PATCH] docs: Make automarkup ready for Sphinx 3.1+ Matthew Wilcox
2020-10-08  6:03   ` Mauro Carvalho Chehab
2020-10-08 11:31     ` Matthew Wilcox
2020-10-08 12:25       ` Mauro Carvalho Chehab
  -- strict thread matches above, loose matches on Subject: below --
2020-10-08 13:54 Nícolas F. R. A. Prado
2020-10-09  5:53 ` Mauro Carvalho Chehab
2020-10-07 23:12 Nícolas F. R. A. Prado
2020-10-07 23:40 ` Matthew Wilcox
2020-10-08  5:27 ` Mauro Carvalho Chehab

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=C674RBXSO9XN.1LXXU71QQNTF1@ArchWay \
    --to=nfraprado@protonmail.com \
    --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=mchehab+huawei@kernel.org \
    --cc=willy@infradead.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