From dcced7300a3abfd2cde2eee2879d27fa30b50694 Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdx@users.noreply.github.com> Date: Sat, 28 Sep 2024 18:04:34 -0500 Subject: [PATCH] fix: minor whitespace bug in md output --- lib/src/docs/markdown/templates/cmd_template.md.tera | 4 ++-- lib/src/docs/markdown/templates/index_template.md.tera | 4 ++-- lib/src/docs/markdown/templates/spec_template.md.tera | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/src/docs/markdown/templates/cmd_template.md.tera b/lib/src/docs/markdown/templates/cmd_template.md.tera index 32d9dae..95ae9f0 100644 --- a/lib/src/docs/markdown/templates/cmd_template.md.tera +++ b/lib/src/docs/markdown/templates/cmd_template.md.tera @@ -2,7 +2,7 @@ {%- if cmd.help_md %}{% set help = cmd.help_md %}{% elif cmd.help_long %}{% set help = cmd.help_long %}{% else %}{% set help = cmd.help %}{% endif %} {%- if cmd.after_help_md %}{% set after_help = cmd.after_help_md %}{% elif cmd.after_help_long %}{% set after_help = cmd.after_help_long %}{% else %}{% set after_help = cmd.after_help %}{% endif %} {%- if multi -%} -{{ "#" | repeat(count=header_level) }} `{{ spec.bin }} {{ cmd.usage }}` +{{ "#" | repeat(count=header_level) }} `{{ spec.bin ~ " " ~ cmd.usage | trim }}` {%- endif %} {%- if before_help %} @@ -59,7 +59,7 @@ {{ "#" | repeat(count=header_level) }}# Subcommands {% endif %} -* [`{{ spec.bin }} {{ cmd.usage }}`]({{ url_prefix }}/{{ cmd.full_cmd | join(sep="/") }}.md) +* [`{{ spec.bin ~ " " ~ cmd.usage | trim }}`]({{ url_prefix }}/{{ cmd.full_cmd | join(sep="/") }}.md) {%- endif -%} {%- endfor -%} {%- endif -%} diff --git a/lib/src/docs/markdown/templates/index_template.md.tera b/lib/src/docs/markdown/templates/index_template.md.tera index d39a1c7..a8672a3 100644 --- a/lib/src/docs/markdown/templates/index_template.md.tera +++ b/lib/src/docs/markdown/templates/index_template.md.tera @@ -1,6 +1,6 @@ {%- set about = spec.about_long | default(value=spec.about) %} {%- set cmd = spec.cmd %} -{{- "#" | repeat(count=header_level) }} `{{ spec.cmd.usage }}` +{{- "#" | repeat(count=header_level) }} `{{ spec.bin ~ " " ~ spec.cmd.usage | trim }}` {%- if spec.version %} * **version**: {{ spec.version }}{% endif %} @@ -14,5 +14,5 @@ {{ "#" | repeat(count=header_level) }} Subcommands {% endif %} -* [`{{ spec.bin }} {{ cmd.usage }}`]({{ url_prefix }}/{{ cmd.full_cmd | join(sep="/") }}.md) +* [`{{ spec.bin ~ " " ~ cmd.usage | trim }}`]({{ url_prefix }}/{{ cmd.full_cmd | join(sep="/") }}.md) {%- endfor -%} diff --git a/lib/src/docs/markdown/templates/spec_template.md.tera b/lib/src/docs/markdown/templates/spec_template.md.tera index 49be3a5..e5cd193 100644 --- a/lib/src/docs/markdown/templates/spec_template.md.tera +++ b/lib/src/docs/markdown/templates/spec_template.md.tera @@ -1,6 +1,6 @@ {%- set about = spec.about_long | default(value=spec.about) %} {%- set cmd = spec.cmd %} -{{- "#" | repeat(count=header_level) }} `{{ spec.bin }} {{ spec.cmd.usage }}` +{{- "#" | repeat(count=header_level) }} `{{ spec.bin ~ " " ~ spec.cmd.usage | trim }}` {%- if spec.version %} * **version**: {{ spec.version }}{% endif %} @@ -15,7 +15,7 @@ {%- for cmd in all_commands %} -{{ "#" | repeat(count=header_level) }} `{{ spec.bin }} {{ cmd.usage }}` +{{ "#" | repeat(count=header_level) }} `{{ spec.bin ~ " " ~ cmd.usage | trim }}` {%- include "cmd_template.md.tera" %} {%- endfor -%}