From: Akira Yokosawa <akiyks@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-doc@vger.kernel.org, Akira Yokosawa <akiyks@gmail.com>
Subject: Re: How to cross-link to another document?
Date: Thu, 7 Jul 2022 17:10:34 +0900 [thread overview]
Message-ID: <e9aa6aec-7f2b-da3e-84d7-00ca6cfeff06@gmail.com> (raw)
In-Reply-To: <YsXDP3r59jlOTXGb@casper.infradead.org>
Hi Matthew,
On Wed, 6 Jul 2022 18:15:43 +0100, Matthew Wilcox wrote:
> I've tried several variants of this without success. What's the
> correct incantation?
>
> +++ b/Documentation/core-api/idr.rst
> @@ -17,6 +17,8 @@ solution to the problem to avoid everybody inventing their own. The IDR
> provides the ability to map an ID to a pointer, while the IDA provides
> only ID allocation, and as a result is much more memory-efficient.
>
> +The IDR interface is deprecated; please use the _`XArray` instead.
You can cross-link using .rst file's path, in this case the relative path.
(This is an extension to Sphinx for kernel documentation.)
+The IDR interface is deprecated; please use the xarray.rst instead.
If you think "the xarray.rst" looks weird in plain-text, then maybe:
+The IDR interface is deprecated; please use :doc:`the XArray <xarray>`
+instead.
Here, <xarray> points xarray.rst. <xarray.rst> doesn't work behind
:doc:.
Or simply drop "the":
+The IDR interface is deprecated; please use xarray.rst instead.
In this case, as both idr.rst and xarray.rst are under core-api/,
the relative path would be a reasonable option. As a bonus, it
works in both full and partial (subdirectory-wise) builds.
Cross-links using absolute paths don't work in partial builds.
> +
> IDR usage
> =========
>
> +++ b/Documentation/core-api/xarray.rst
> @@ -1,4 +1,5 @@
> .. SPDX-License-Identifier: GPL-2.0+
> +.. XArray_
In any case, a reference label at the top of a .rst file is pointless.
Please don't add a new one.
See: https://www.kernel.org/doc/html/latest/doc-guide/sphinx.html#cross-referencing
Hope this helps.
Thanks, Akira
>
> ======
> XArray
>
> I first tried "named reference, reStructuredText_;"
> and then "_`inline internal target`" and I've tried both prefixing and
> suffixing both destination and target with an underscore. Nothing seems
> to work and sometimes I get error messages telling me it won't work,
> and sometimes I just get non-hyperlinks.
>
> Do I have to do something like
>
> :ref:`Documentation/core-api/xarray.rst <XArray>`
> ? That would seem unnecessarily verbose.
prev parent reply other threads:[~2022-07-07 8:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 17:15 How to cross-link to another document? Matthew Wilcox
2022-07-07 8:10 ` Akira Yokosawa [this message]
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=e9aa6aec-7f2b-da3e-84d7-00ca6cfeff06@gmail.com \
--to=akiyks@gmail.com \
--cc=linux-doc@vger.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;
as well as URLs for NNTP newsgroup(s).