public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
* Links to sources in docs
@ 2026-01-09 17:31 Petr Vorel
  2026-01-12 11:06 ` Jani Nikula
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2026-01-09 17:31 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: linux-doc

Hi Jonathan, all,

I wonder how links in sources work.

Documentation/userspace-api/check_exec.rst has:

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Links to sources in docs
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Jani Nikula @ 2026-01-12 11:06 UTC (permalink / raw)
  To: Petr Vorel, Jonathan Corbet; +Cc: linux-doc

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.


HTH,
Jani.


[1] https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#hyperlinks


>
> 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
>

-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Links to sources in docs
  2026-01-12 11:06 ` Jani Nikula
@ 2026-01-12 13:26   ` Petr Vorel
  2026-01-13 12:32     ` Petr Vorel
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2026-01-12 13:26 UTC (permalink / raw)
  To: Jani Nikula; +Cc: Jonathan Corbet, linux-doc

> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Links to sources in docs
  2026-01-12 13:26   ` Petr Vorel
@ 2026-01-13 12:32     ` Petr Vorel
  2026-01-13 13:26       ` Jani Nikula
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2026-01-13 12:32 UTC (permalink / raw)
  To: Jani Nikula, Jonathan Corbet, linux-doc

> > 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.

And I also wonder what does clickable links (e.g. [1]) in
Documentation/process/adding-syscalls.rst [2]

    - commit 75069f2b5bfb ("vfs: renumber FMODE_NONOTIFY and add to uniqueness
      check")
    - commit 12ed2e36c98a ("fanotify: FMODE_NONOTIFY and __O_SYNC in sparc
      conflict")
    - commit bb458c644a59 ("Safer ABI for O_TMPFILE")

I haven't found anything in the document itself, nor in conf.py.

Kind regards,
Petr

[1] https://git.kernel.org/torvalds/c/75069f2b5bfb
[2] https://docs.kernel.org/process/adding-syscalls.html#references-and-sources
...

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Links to sources in docs
  2026-01-13 12:32     ` Petr Vorel
@ 2026-01-13 13:26       ` Jani Nikula
  0 siblings, 0 replies; 5+ messages in thread
From: Jani Nikula @ 2026-01-13 13:26 UTC (permalink / raw)
  To: Petr Vorel, Jonathan Corbet, linux-doc

On Tue, 13 Jan 2026, Petr Vorel <pvorel@suse.cz> wrote:
>> > 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.
>
> And I also wonder what does clickable links (e.g. [1]) in
> Documentation/process/adding-syscalls.rst [2]
>
>     - commit 75069f2b5bfb ("vfs: renumber FMODE_NONOTIFY and add to uniqueness
>       check")
>     - commit 12ed2e36c98a ("fanotify: FMODE_NONOTIFY and __O_SYNC in sparc
>       conflict")
>     - commit bb458c644a59 ("Safer ABI for O_TMPFILE")
>
> I haven't found anything in the document itself, nor in conf.py.

It's the automarkup extension, configured in conf.py extensions, and
implemented in Documentation/sphinx/automarkup.py.

BR,
Jani.

>
> Kind regards,
> Petr
>
> [1] https://git.kernel.org/torvalds/c/75069f2b5bfb
> [2] https://docs.kernel.org/process/adding-syscalls.html#references-and-sources
> ...

-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-01-13 13:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2026-01-13 12:32     ` Petr Vorel
2026-01-13 13:26       ` Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox