Skip to content

Commit b2bf463

Browse files
committed
docs: rust: improve main page introducing a "Code documentation" section
Clean the "Rust" main page by introducing a 'Code documentation" section to separate it from the rest of the text above. In addition, introduce the "Rust code documentation" term, which may be clearer than referring to a potentially unknown tool. Furthermore, for the HTML case, homogenize both `rustdoc` and non-`rustdoc` cases and use the term introduced above instead. Then, always generate the pregenerated version part, since now there is a section that is always generated and thus makes sense to do so. Finally, finish the new section with a link to more details about the Rust code documentation. The intention is that: - The non-HTML case mentions the code documentation too, making it more prominent for readers of non-HTML docs. - Both HTML cases read more naturally. - The pregenerated version is always mentioned, since it is likely useful for readers of non-HTML docs. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 0eef6ec commit b2bf463

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

Documentation/rust/general-information.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ but not `std <https://doc.rust-lang.org/std/>`_. Crates for use in the
1515
kernel must opt into this behavior using the ``#![no_std]`` attribute.
1616

1717

18+
.. _rust_code_documentation:
19+
1820
Code documentation
1921
------------------
2022

Documentation/rust/index.rst

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,27 @@ support is still in development/experimental, especially for certain kernel
2525
configurations.
2626

2727

28+
Code documentation
29+
------------------
30+
31+
Given a kernel configuration, the kernel may generate Rust code documentation,
32+
i.e. HTML rendered by the ``rustdoc`` tool.
33+
2834
.. only:: rustdoc and html
2935

30-
You can also browse `rustdoc documentation <rustdoc/kernel/index.html>`_.
36+
This kernel documentation was built with `Rust code documentation
37+
<rustdoc/kernel/index.html>`_.
3138

3239
.. only:: not rustdoc and html
3340

34-
This documentation does not include rustdoc generated information.
35-
A pregenerated version is provided at:
41+
This kernel documentation was not built with Rust code documentation.
42+
43+
A pregenerated version is provided at:
44+
45+
https://rust.docs.kernel.org
3646

37-
https://rust.docs.kernel.org
47+
Please see the :ref:`Code documentation <rust_code_documentation>` section for
48+
more details.
3849

3950
.. toctree::
4051
:maxdepth: 1

0 commit comments

Comments
 (0)