From: Jonathan Corbet <corbet@lwn.net>
To: "Nícolas F. R. A. Prado" <nfraprado@protonmail.com>
Cc: Randy Dunlap <rdunlap@infradead.org>,
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Miguel Ojeda <ojeda@kernel.org>,
Andrew Klychkov <andrew.a.klychkov@gmail.com>,
lkcamp@lists.libreplanetbr.org, andrealmeid@collabora.com
Subject: Re: [PATCH 0/2] docs: Add support for relative paths in automarkup
Date: Thu, 04 Feb 2021 16:28:14 -0700 [thread overview]
Message-ID: <87o8gzxvjl.fsf@meer.lwn.net> (raw)
In-Reply-To: <20210128010028.58541-1-nfraprado@protonmail.com>
Nícolas F. R. A. Prado <nfraprado@protonmail.com> writes:
> As Jon previously noted [1], it would be nice if automarkup supported relative
> paths as well when cross-referencing to other documents. This adds the support
> for it, and documents it.
>
> Jon, after applying this, 43bc3ed73639 ("docs: dt: Use full path to enable
> cross-reference") could be reverted without the link stopping to work.
>
> [1] https://lore.kernel.org/linux-doc/20201130142404.6ef6689e@lwn.net/
>
> Nícolas F. R. A. Prado (2):
> docs: Enable usage of relative paths to docs on automarkup
> docs: Document cross-referencing using relative path
>
> Documentation/doc-guide/sphinx.rst | 30 ++++++++++++++++++++----------
> Documentation/sphinx/automarkup.py | 7 +++++--
> 2 files changed, 25 insertions(+), 12 deletions(-)
So I finally got around to playing with this set. One thing I found is
that some of the references that were being caught before were not
now... after far too much time, I figured out that the problem was
references to .txt files, of which we have quite a few in the docs.
admin-guide/kernel-parameters.txt in particular is quite popular.
Before this change, those were being turned into xrefs, afterward not.
To address that, I applied this little tweak:
-RE_doc = re.compile(r'(\bDocumentation/)?((\.\./)*[\w\-/]+)\.rst')
+RE_doc = re.compile(r'(\bDocumentation/)?((\.\./)*[\w\-/]+)\.(rst|txt)')
That seems to make things work properly again.
While tracking this down I put in a print for failing cross references,
and noted that we have quite a few; it's a useful way to see where the
stale references are. Maybe I'll try to hack together something to make
those stand out so we can fix them.
Thanks,
jon
next prev parent reply other threads:[~2021-02-04 23:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-28 1:01 [PATCH 0/2] docs: Add support for relative paths in automarkup Nícolas F. R. A. Prado
2021-01-28 1:01 ` [PATCH 1/2] docs: Enable usage of relative paths to docs on automarkup Nícolas F. R. A. Prado
2021-01-28 1:01 ` [PATCH 2/2] docs: Document cross-referencing using relative path Nícolas F. R. A. Prado
2021-02-04 23:28 ` Jonathan Corbet [this message]
2021-02-04 23:48 ` [PATCH 0/2] docs: Add support for relative paths in automarkup Randy Dunlap
2021-02-04 23:53 ` Jonathan Corbet
2021-02-05 1:07 ` Nícolas F. R. A. Prado
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=87o8gzxvjl.fsf@meer.lwn.net \
--to=corbet@lwn.net \
--cc=andrealmeid@collabora.com \
--cc=andrew.a.klychkov@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkcamp@lists.libreplanetbr.org \
--cc=mchehab+huawei@kernel.org \
--cc=nfraprado@protonmail.com \
--cc=ojeda@kernel.org \
--cc=rdunlap@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