public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Jonathan Corbet <corbet@lwn.net>, linux-doc@vger.kernel.org
Subject: Re: Links to sources in docs
Date: Mon, 12 Jan 2026 14:26:13 +0100	[thread overview]
Message-ID: <20260112132613.GA266368@pevik> (raw)
In-Reply-To: <7b0539f874af71c899c21acfd71288fe7a2d8246@intel.com>

> On Fri, 09 Jan 2026, Petr Vorel <pvorel@suse.cz> wrote:
> > Hi Jonathan, all,

> > I wonder how links in sources work.

> > Documentation/userspace-api/check_exec.rst has:

> > `samples/check-exec/inc.c`_ example.

> There's this bit at the end of check_exec.rst that defines the link:

> .. _samples/check-exec/inc.c:
>    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/samples/check-exec/inc.c

> The content within the backticks is just the link text, and has no
> filename semantics. See [1] for details.

Thanks for a hint, I overlooked it.

We use in LTP sphinx.ext.extlinks [2]:

	'master': (f'{ltp_repo}/blob/master/%s', '%s')

to make file clickable [3]:

	:master:`include/lapi/posix_clocks.h`

then leads to file in git repository. I wonder if this could be useful for
kernel as well.

Kind regards,
Petr

> HTH,
> Jani.


> [1] https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#hyperlinks
[2] https://github.com/linux-test-project/ltp/blob/master/doc/conf.py
[3] https://linux-test-project.readthedocs.io/en/latest/developers/writing_tests.html#backwards-compatibility
[4] https://github.com/linux-test-project/ltp/blob/master/include/lapi/posix_clocks.h


> > which leads to link to the source [1]. But if i try to use the same pattern in
> > Documentation/trace/fprobe.rst:

> > -See Filter Commands in `Documentation/trace/ftrace.rst`.
> > +See Filter Commands in Documentation/trace/ftrace.rst.

> > it does not work:

> > Documentation/admin-guide/bug-hunting.rst:54: ERROR: Unknown target name: "scripts/decode_stacktrace.sh". [docutils]

> > Kind regards,
> > Petr

> > [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/samples/check-exec/inc.c

  reply	other threads:[~2026-01-12 13:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-09 17:31 Links to sources in docs Petr Vorel
2026-01-12 11:06 ` Jani Nikula
2026-01-12 13:26   ` Petr Vorel [this message]
2026-01-13 12:32     ` Petr Vorel
2026-01-13 13:26       ` Jani Nikula

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=20260112132613.GA266368@pevik \
    --to=pvorel@suse.cz \
    --cc=corbet@lwn.net \
    --cc=jani.nikula@linux.intel.com \
    --cc=linux-doc@vger.kernel.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