Merge pull request #1168 from Salamandar/helper_template

Enhance the jinja template for bash helpers
This commit is contained in:
Alexandre Aubin 2021-03-01 18:13:18 +01:00 committed by GitHub
commit 4a20cf8003
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,30 +12,31 @@ Doc auto-generated by [this script](https://github.com/YunoHost/yunohost/blob/{{
{% for category, helpers in data.helpers %} {% for category, helpers in data.helpers %}
### {{ category.upper() }} ### {{ category.upper() }}
{% for h in helpers %} {% for h in helpers %}
**{{ h.name }}** **{{ h.name }}**<br/>
[details summary="<i>{{ h.brief }}</i>" class="helper-card-subtitle text-muted"] [details summary="<i>{{ h.brief }}</i>" class="helper-card-subtitle text-muted"]
<p></p> <p></p>
**Usage**: `{{ h.usage }}` **Usage**: `{{ h.usage }}`
{% if h.args %} {%- if h.args %}
**Arguments**: **Arguments**:
{% for infos in h.args %} {%- for infos in h.args %}
{% if infos|length == 2 %} {%- if infos|length == 2 %}
- `{{ infos[0] }}`: {{ infos[1] }} - `{{ infos[0] }}`: {{ infos[1] }}
{% else %} {%- else %}
- `{{ infos[0] }}`, `{{ infos[1] }}`: {{ infos[2] }} - `{{ infos[0] }}`, `{{ infos[1] }}`: {{ infos[2] }}
{% endif %} {%- endif %}
{% endfor %} {%- endfor %}
{% endif %} {%- endif %}
{% if h.ret %} {%- if h.ret %}
**Returns**: {{ h.ret }} **Returns**: {{ h.ret }}
{% endif %} {%- endif %}
{% if "example" in h.keys() %} {%- if "example" in h.keys() %}
**Example**: `{{ h.example }}` **Example**: `{{ h.example }}`
{% endif %} {%- endif %}
{% if "examples" in h.keys() %} {%- if "examples" in h.keys() %}
**Examples**: **Examples**:
{% for example in h.examples %} {% for example in h.examples %}
@ -45,12 +46,12 @@ Doc auto-generated by [this script](https://github.com/YunoHost/yunohost/blob/{{
- `{{ example.strip("# ") }}` - `{{ example.strip("# ") }}`
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {%- endif %}
{% if h.details %} {%- if h.details %}
**Details**: **Details**:<br/>
{{ h.details.replace('\n', '</br>').replace('_', '\_') }} {{ h.details }}
{% endif %} {%- endif %}
[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/{{ current_commit }}/data/helpers.d/{{ category }}#L{{ h.line + 1 }}) [Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/{{ current_commit }}/data/helpers.d/{{ category }}#L{{ h.line + 1 }})
[/details] [/details]