From 1865179dce804a27c4c360ffa89b90e33b6fabaa Mon Sep 17 00:00:00 2001 From: Olivier Le Thanh Duong Date: Wed, 23 Oct 2024 11:04:39 +0200 Subject: [PATCH] doc: Generate link for sub commands --- scripts/gendoc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/gendoc.py b/scripts/gendoc.py index 74a577b..58b5f6d 100755 --- a/scripts/gendoc.py +++ b/scripts/gendoc.py @@ -229,7 +229,8 @@ def get_docs_for_click( for command in commands: command_obj = group.get_command(ctx, command) assert command_obj - docs += f"* `{command_obj.name}`" + anchor_name = f"{command_name.replace(' ', '-')}-{command_obj.name}" + docs += f"* [`{command_obj.name}`](#{anchor_name})" command_help = command_obj.get_short_help_str(limit=1000) if command_help: docs += f": {command_help}"