<#1269 fix(cli/docs): emit markdown-safe CLI refer...
# flyte-github
a
#1269 fix(cli/docs): emit markdown-safe CLI reference (fenced examples, inline aliases) Pull request opened by ppiegaze Problem
flyte gen docs --type markdown
produces the CLI reference page (
flyte-cli.md
) for the docs site. For plugin commands it wraps each command in a
{{< variant >}}{{< markdown >}}
block (variant-gating). Two constructs it emits then break the Hugo build inside that block: 1. Multi-name/alias options are rendered with the
{{< multiline >}}
shortcode (
_gen.py
), which outputs raw `<div>`/`<br/>` HTML. Inside `{{< markdown >}}`'s
.Page.RenderString
(goldmark
unsafe=false
, build run with
--panicOnWarning
) that is a fatal "Raw HTML omitted". 2.
Examples:
blocks
come through as indentation-based code, which doesn't survive
RenderString
and renders inconsistently. Core commands sit in plain page markdown (shortcode HTML passes straight through, never re-rendered), so this only bites plugin commands — and only surfaced now because flyte 2.5.6's new
flyte connect
plugin command is the first with multi-alias options + an Examples block. It took down the entire
Build and deploy docs
job (see unionai-docs#1153). Fix (
src/flyte/cli/_gen.py
)
• Aliases inline: render multi-name options as ``
--a
--b
`` instead of the
{{< multiline >}}
shortcode — works in both plain and
{{< markdown >}}
contexts, no raw HTML. • Fenced examples: new
_format_command_help()
formats command help with
inspect.cleandoc
(handles the first-line-on-
"""
docstring case that
textwrap.dedent
can't) and wraps indented blocks in fenced ```bash code blocks instead of relying on indentation. Docs-pipeline plumbing only; no runtime/behavior change. Verified the formatter output on the
connect ssh
help (prose dedented, examples fenced,
<…>
placeholders now safe inside the fence). 🤖 Generated with Claude Code flyteorg/flyte-sdk