Skip to content

Commit

Permalink
docs: netlink: link to family documentations from spec info
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jakub Kicinski committed Dec 1, 2023
1 parent 981239e commit e8c780a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Documentation/userspace-api/netlink/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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>`
2 changes: 1 addition & 1 deletion Documentation/userspace-api/netlink/specs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion tools/net/ynl/ynl-gen-rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
# =======

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e8c780a

Please sign in to comment.