Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ssorj committed Oct 30, 2024
1 parent 3ca7cc1 commit fbf540c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
3 changes: 2 additions & 1 deletion input/commands/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ links:
#### Other operations

<table class="objects">
<tr><th><a href="{{site_prefix}}/commands/version.html">Version</a></th><td>Overview of version commands</td></tr>
<tr><th><a href="{{site_prefix}}/commands/version.html">Version</a></th><td><p>Display versions of Skupper components</p>
</td></tr>
</table>

26 changes: 17 additions & 9 deletions python/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("<table class=\"objects\">")
append(f"<tr><th><a href=\"{command.href}\">{title}</a></th><td>{description}</td></tr>")

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"<tr><th><a href=\"{command.href}\">{title}</a></th><td>{description}</td></tr>")

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"<tr><th><a href=\"{subcommand.href}\">{title}</a></th><td>{description}</td></tr>")
else:
title = command.title.removesuffix(" command")
description = nvl(command.description, "").replace("\n", " ")
description = description.split(".")[0]
description = mistune.html(description)

append(f"<tr><th><a href=\"{subcommand.href}\">{title}</a></th><td>{description}</td></tr>")
append(f"<tr><th><a href=\"{command.href}\">{title}</a></th><td>{description}</td></tr>")

append("</table>")
append()
Expand Down

0 comments on commit fbf540c

Please sign in to comment.