From: Markus Heiser <markus.heiser@darmarit.de>
To: Jani Nikula <jani.nikula@linux.intel.com>,
Jonathan Corbet <corbet@lwn.net>,
linux-doc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Matthew Wilcox <willy@infradead.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: Re: [PATCH 1/2] Docs: An initial automarkup extension for sphinx
Date: Fri, 26 Apr 2019 13:31:15 +0200 [thread overview]
Message-ID: <d0190209-ce72-1107-8012-a521984f2d0f@darmarit.de> (raw)
In-Reply-To: <87tvelrv8d.fsf@intel.com>
Am 26.04.19 um 11:06 schrieb Jani Nikula:
> On Thu, 25 Apr 2019, Jonathan Corbet<corbet@lwn.net> wrote:
>> Rather than fill our text files with :c:func:`function()` syntax, just do
>> the markup via a hook into the sphinx build process. As is always the
>> case, the real problem is detecting the situations where this markup should
>> *not* be done.
> This is basically a regex based pre-processing step in front of Sphinx,
> but it's not independent as it embeds a limited understanding/parsing of
> reStructuredText syntax. This is similar to what we do in kernel-doc the
> Perl monster, except slightly different.
>
> I understand the motivation, and I sympathize with the idea of a quick
> regex hack to silence the mob. But I fear this will lead to hard to
> solve corner cases and the same style of "impedance mismatches" we had
> with the kernel-doc/docproc/docbook Rube Goldberg machine of the past.
>
> It's more involved, but I think the better place to do this (as well as
> the kernel-doc transformations) would be in the doctree-read event,
> after the rst parsing is done. You can traverse the doctree and find the
> places which weren't special for Sphinx, and replace the plain text
> nodes in-place. I've toyed with this in the past, but alas I didn't have
> (and still don't) have the time to finish the job. There were some
> unresolved issues with e.g. replacing nodes that had syntax highlighting
> (because I wanted to make the references work also within preformatted
> blocks).
>
> If you decide to go with regex anyway, I'd at least consider pulling the
> transformations/highlights from kernel-doc the script to the Sphinx
> extension, and use the exact same transformations for stuff in source
> code comments and rst files.
FWIW mentioning: I fully agree with Jan.
-- Markus --
next prev parent reply other threads:[~2019-04-26 11:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-25 20:01 [PATCH 0/2] RFC: Automatic :c:func: annotation in the sphinx build Jonathan Corbet
2019-04-25 20:01 ` [PATCH 1/2] Docs: An initial automarkup extension for sphinx Jonathan Corbet
2019-04-26 9:06 ` Jani Nikula
2019-04-26 11:31 ` Markus Heiser [this message]
2019-04-26 16:52 ` Jonathan Corbet
2019-04-26 17:54 ` Mauro Carvalho Chehab
2019-04-26 18:58 ` Jani Nikula
2019-04-26 18:32 ` Mauro Carvalho Chehab
2019-04-26 19:16 ` Mauro Carvalho Chehab
2019-04-26 19:37 ` Jonathan Corbet
2019-04-26 20:51 ` Mauro Carvalho Chehab
2019-04-25 20:01 ` [PATCH 2/2] docs: remove :c:func: annotations from xarray.rst Jonathan Corbet
2019-04-25 20:43 ` Matthew Wilcox
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=d0190209-ce72-1107-8012-a521984f2d0f@darmarit.de \
--to=markus.heiser@darmarit.de \
--cc=corbet@lwn.net \
--cc=jani.nikula@linux.intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@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
all inboxes | Powered by JetHome®