_includes/cli.md: add support for per-flag detail URLs or anchors

The YAML files now support a new "details_url" property for flags, which
can be set if there's an anchor on the same page, or an URL where to
find a detailed description of the flag (Currently only anchors are used).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2021-03-26 16:50:02 +01:00
parent e2dda5884d
commit 68f77423a1
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 5 additions and 1 deletions

View File

@ -124,7 +124,11 @@ For example uses of this command, refer to the [examples section](#examples) bel
{% assign defaults-to-skip = "[],map[],false,0,0s,default,'',\"\"" | split: ',' %}
{% capture option-default %}{% if option.default_value %}{% unless defaults-to-skip contains option.default_value or defaults-to-skip == blank %}`{{ option.default_value }}`{% endunless %}{% endif %}{% endcapture %}
<tr>
<td markdown="span">`--{{ option.option }}{% if option.shorthand %} , -{{ option.shorthand }}{% endif %}`</td>
{% if option.details_url and option.details_url != '' -%}
<td markdown="span">[`--{{ option.option }}`]({{ option.details_url }}){% if option.shorthand %} , [`-{{ option.shorthand }}`]({{ option.details_url }}){% endif %}</td>
{%- else -%}
<td markdown="span">`--{{ option.option }}`{% if option.shorthand %} , `-{{ option.shorthand }}`{% endif %}</td>
{%- endif %}
<td markdown="span">{{ option-default }}</td>
<td markdown="span">{% if all-badges != '' %}{{ all-badges | strip }}<br />{% endif %}{{ option.description | strip | escape }}</td>
</tr>