docs: netlink: link to family documentations from spec info
authorJakub Kicinski <kuba@kernel.org>
Wed, 29 Nov 2023 04:14:27 +0000 (20:14 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 1 Dec 2023 07:17:53 +0000 (23:17 -0800)
To increase the chances of people finding the rendered docs
add a link to specs.rst and index.rst.

Add a label in the generated index.rst and while at it adjust
the title a little bit.

Reviewed-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20231129041427.2763074-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/userspace-api/netlink/index.rst
Documentation/userspace-api/netlink/specs.rst
tools/net/ynl/ynl-gen-rst.py

index 62725dafbbdb5dd6bd51bda71ff8519c8b39bd49..c1b6765cc963e26b97c20df0e67f943bdcaaa9d7 100644 (file)
@@ -16,4 +16,6 @@ Netlink documentation for users.
    genetlink-legacy
    netlink-raw
 
-See also :ref:`Documentation/core-api/netlink.rst <kernel_netlink>`.
+See also:
+ - :ref:`Documentation/core-api/netlink.rst <kernel_netlink>`
+ - :ref:`Documentation/networking/netlink_spec/index.rst <specs>`
index c1b9516491132447e0fa3041ea87b8cb1a502580..1b50d97d8d7c3f6b9a7ff08b93b48bb0bc2c90ef 100644 (file)
@@ -15,7 +15,7 @@ kernel headers directly.
 Internally kernel uses the YAML specs to generate:
 
  - the C uAPI header
- - documentation of the protocol as a ReST file
+ - documentation of the protocol as a ReST file - see :ref:`Documentation/networking/netlink_spec/index.rst <specs>`
  - policy tables for input attribute validation
  - operation tables
 
index b6292109e23694d64cf3ddb58e3a1e8bdc0beab8..8c62e040df5dce3e608bf058506cf71668a3dfbb 100755 (executable)
@@ -122,6 +122,11 @@ def rst_toctree(maxdepth: int = 2) -> str:
     return "\n".join(lines)
 
 
+def rst_label(title: str) -> str:
+    """Return a formatted label"""
+    return f".. _{title}:\n\n"
+
+
 # Parsers
 # =======
 
@@ -349,7 +354,8 @@ def generate_main_index_rst(output: str) -> None:
     lines = []
 
     lines.append(rst_header())
-    lines.append(rst_title("Netlink Specification"))
+    lines.append(rst_label("specs"))
+    lines.append(rst_title("Netlink Family Specifications"))
     lines.append(rst_toctree(1))
 
     index_dir = os.path.dirname(output)