From fbf540c27ea913762dcd77f0e9aef1dd676be8ef Mon Sep 17 00:00:00 2001 From: Justin Ross Date: Wed, 30 Oct 2024 06:05:58 -0400 Subject: [PATCH] WIP --- input/commands/index.md | 3 ++- python/commands.py | 26 +++++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/input/commands/index.md b/input/commands/index.md index ba38ac9..ed7d43e 100644 --- a/input/commands/index.md +++ b/input/commands/index.md @@ -108,6 +108,7 @@ links: #### Other operations - +
VersionOverview of version commands
Version

Display versions of Skupper components

+
diff --git a/python/commands.py b/python/commands.py index 2cd264b..3afb2f8 100644 --- a/python/commands.py +++ b/python/commands.py @@ -31,20 +31,28 @@ def append(line=""): append() for command in group.commands: - title = command.title.removesuffix(" command") - description = f"Overview of {command.name} commands" - append("") - append(f"") - for subcommand in command.subcommands: - title = subcommand.title.removesuffix(" commands") - title = title.removesuffix(" command") - description = nvl(subcommand.description, "").replace("\n", " ") + if command.subcommands: + title = command.title.removesuffix(" command") + description = f"Overview of {command.name} commands" + + append(f"") + + for subcommand in command.subcommands: + title = subcommand.title.removesuffix(" command") + description = nvl(subcommand.description, "").replace("\n", " ") + description = description.split(".")[0] + description = mistune.html(description) + + append(f"") + else: + title = command.title.removesuffix(" command") + description = nvl(command.description, "").replace("\n", " ") description = description.split(".")[0] description = mistune.html(description) - append(f"") + append(f"") append("
{title}{description}
{title}{description}
{title}{description}
{title}{description}
{title}{description}
") append()