diff mbox series

[net-next] docs: netlink: link to family documentations from spec info

Message ID 20231127205642.2293153-1-kuba@kernel.org (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net-next] docs: netlink: link to family documentations from spec info | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/codegen success Generated files up to date
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 28 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jakub Kicinski Nov. 27, 2023, 8:56 p.m. UTC
To increase the chances of people finding the rendered docs
add a link to specs.rst. Add a label in the generated index.rst
and while at it adjust the title a little bit.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: corbet@lwn.net
CC: leitao@debian.org
CC: linux-doc@vger.kernel.org
---
 Documentation/userspace-api/netlink/specs.rst | 2 +-
 tools/net/ynl/ynl-gen-rst.py                  | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

Comments

kernel test robot Nov. 28, 2023, 3:01 a.m. UTC | #1
Hi Jakub,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Jakub-Kicinski/docs-netlink-link-to-family-documentations-from-spec-info/20231128-050136
base:   net-next/main
patch link:    https://lore.kernel.org/r/20231127205642.2293153-1-kuba%40kernel.org
patch subject: [PATCH net-next] docs: netlink: link to family documentations from spec info
reproduce: (https://download.01.org/0day-ci/archive/20231128/202311280834.lYzXIFc4-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311280834.lYzXIFc4-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> Warning: Documentation/userspace-api/netlink/specs.rst references a file that doesn't exist: Documentation/networking/netlink_spec/index.rst
Jakub Kicinski Nov. 28, 2023, 3:06 a.m. UTC | #2
On Tue, 28 Nov 2023 11:01:55 +0800 kernel test robot wrote:
> Hi Jakub,
> 
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on net-next/main]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Jakub-Kicinski/docs-netlink-link-to-family-documentations-from-spec-info/20231128-050136
> base:   net-next/main
> patch link:    https://lore.kernel.org/r/20231127205642.2293153-1-kuba%40kernel.org
> patch subject: [PATCH net-next] docs: netlink: link to family documentations from spec info
> reproduce: (https://download.01.org/0day-ci/archive/20231128/202311280834.lYzXIFc4-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202311280834.lYzXIFc4-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
> >> Warning: Documentation/userspace-api/netlink/specs.rst references a file that doesn't exist: Documentation/networking/netlink_spec/index.rst  

Is it possible that the build bot is missing python-yaml support and
the generation of Documentation/networking/netlink_spec/index.rst
fails?

Or is this an ordering issue?
Breno Leitao Nov. 28, 2023, 9:39 a.m. UTC | #3
On Mon, Nov 27, 2023 at 12:56:42PM -0800, Jakub Kicinski wrote:

> diff --git a/tools/net/ynl/ynl-gen-rst.py b/tools/net/ynl/ynl-gen-rst.py
> index b6292109e236..2c0b80071bcd 100755
> --- a/tools/net/ynl/ynl-gen-rst.py
> +++ b/tools/net/ynl/ynl-gen-rst.py
> @@ -122,6 +122,11 @@ SPACE_PER_LEVEL = 4
>      return "\n".join(lines)
>  
>  
> +def rst_label(title) -> str:

Please add the type hinting to the "title" argument. Something as:

  def rst_label(title: str) -> str:

Other than that I am good, and feel free to add:

Reviewed-by: Breno Leitao <leitao@debian.org>
Donald Hunter Nov. 28, 2023, 10:21 a.m. UTC | #4
Jakub Kicinski <kuba@kernel.org> writes:

> To increase the chances of people finding the rendered docs
> add a link to specs.rst. Add a label in the generated index.rst
> and while at it adjust the title a little bit.

It might be useful to also link to the rendered docs directly from the
"Netlink Handbook" at Documentation/userspace-api/netlink/index.rst?

Reviewed-by: Donald Hunter <donald.hunter@gmail.com>

> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: corbet@lwn.net
> CC: leitao@debian.org
> CC: linux-doc@vger.kernel.org
> ---
>  Documentation/userspace-api/netlink/specs.rst | 2 +-
>  tools/net/ynl/ynl-gen-rst.py                  | 8 +++++++-
>  2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/userspace-api/netlink/specs.rst b/Documentation/userspace-api/netlink/specs.rst
> index c1b951649113..1b50d97d8d7c 100644
> --- a/Documentation/userspace-api/netlink/specs.rst
> +++ b/Documentation/userspace-api/netlink/specs.rst
> @@ -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
>  
> diff --git a/tools/net/ynl/ynl-gen-rst.py b/tools/net/ynl/ynl-gen-rst.py
> index b6292109e236..2c0b80071bcd 100755
> --- a/tools/net/ynl/ynl-gen-rst.py
> +++ b/tools/net/ynl/ynl-gen-rst.py
> @@ -122,6 +122,11 @@ SPACE_PER_LEVEL = 4
>      return "\n".join(lines)
>  
>  
> +def rst_label(title) -> str:
> +    """Return a formatted label"""
> +    return f".. _{title}:\n\n"
> +
> +
>  # Parsers
>  # =======
>  
> @@ -349,7 +354,8 @@ SPACE_PER_LEVEL = 4
>      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)
Yujie Liu Nov. 30, 2023, 8:52 a.m. UTC | #5
On Mon, Nov 27, 2023 at 07:06:11PM -0800, Jakub Kicinski wrote:
> On Tue, 28 Nov 2023 11:01:55 +0800 kernel test robot wrote:
> > Hi Jakub,
> > 
> > kernel test robot noticed the following build warnings:
> > 
> > [auto build test WARNING on net-next/main]
> > 
> > url:    https://github.com/intel-lab-lkp/linux/commits/Jakub-Kicinski/docs-netlink-link-to-family-documentations-from-spec-info/20231128-050136
> > base:   net-next/main
> > patch link:    https://lore.kernel.org/r/20231127205642.2293153-1-kuba%40kernel.org
> > patch subject: [PATCH net-next] docs: netlink: link to family documentations from spec info
> > reproduce: (https://download.01.org/0day-ci/archive/20231128/202311280834.lYzXIFc4-lkp@intel.com/reproduce)
> > 
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202311280834.lYzXIFc4-lkp@intel.com/
> > 
> > All warnings (new ones prefixed by >>):
> > 
> > >> Warning: Documentation/userspace-api/netlink/specs.rst references a file that doesn't exist: Documentation/networking/netlink_spec/index.rst  
> 
> Is it possible that the build bot is missing python-yaml support and
> the generation of Documentation/networking/netlink_spec/index.rst
> fails?

Hi Jakub, this is indeed due to missing pyyaml module in the bot so the
doc file is not generated. We've installed it now and the warning is
gone. Sorry for the noise and please ignore this report.

> 
> Or is this an ordering issue?
>
Jakub Kicinski Nov. 30, 2023, 3:05 p.m. UTC | #6
On Thu, 30 Nov 2023 16:52:10 +0800 Yujie Liu wrote:
> > Is it possible that the build bot is missing python-yaml support and
> > the generation of Documentation/networking/netlink_spec/index.rst
> > fails?  
> 
> Hi Jakub, this is indeed due to missing pyyaml module in the bot so the
> doc file is not generated. We've installed it now and the warning is
> gone. Sorry for the noise and please ignore this report.

No worries at all, thanks for confirming!
diff mbox series

Patch

diff --git a/Documentation/userspace-api/netlink/specs.rst b/Documentation/userspace-api/netlink/specs.rst
index c1b951649113..1b50d97d8d7c 100644
--- a/Documentation/userspace-api/netlink/specs.rst
+++ b/Documentation/userspace-api/netlink/specs.rst
@@ -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
 
diff --git a/tools/net/ynl/ynl-gen-rst.py b/tools/net/ynl/ynl-gen-rst.py
index b6292109e236..2c0b80071bcd 100755
--- a/tools/net/ynl/ynl-gen-rst.py
+++ b/tools/net/ynl/ynl-gen-rst.py
@@ -122,6 +122,11 @@  SPACE_PER_LEVEL = 4
     return "\n".join(lines)
 
 
+def rst_label(title) -> str:
+    """Return a formatted label"""
+    return f".. _{title}:\n\n"
+
+
 # Parsers
 # =======
 
@@ -349,7 +354,8 @@  SPACE_PER_LEVEL = 4
     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)