Skip to content

Commit

Permalink
feat(template): add description to markdown template
Browse files Browse the repository at this point in the history
  • Loading branch information
rndmh3ro authored and schurzi committed Oct 4, 2024
1 parent 993fb62 commit 8b5fadd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions aar_doc/templates/markdown.j2
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ Tags: {{ metadata.galaxy_info.galaxy_tags | join(', ') }}

{{ argument_specs[entrypoint].short_description }}

{% if "description" in argument_specs[entrypoint] %}
{%- if argument_specs[entrypoint].description is string -%}
{{ argument_specs[entrypoint].description }}
{% else %}
{%- for line in argument_specs[entrypoint].description -%}
{{ line }}
{% endfor -%}
{% endif -%}
{% endif -%}

{% if entrypoint_options[entrypoint] %}
{%- set path, options=entrypoint_options[entrypoint][0] -%}
|Option|Description|Type|Required|Default|
Expand Down
6 changes: 6 additions & 0 deletions tests/fixtures/roles/extended/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Tags: ansible, docs

The main entrypoint for the extended role

A longer description of the entrypoint.

Reaching multiple lines.

This contains the various parameters one can give in argument_specs that do not get tested below.

|Option|Description|Type|Required|Default|
|---|---|---|---|---|
| name | This one contains option-name, which should override the name given for the option. | str | no | |
Expand Down
6 changes: 6 additions & 0 deletions tests/fixtures/roles/meta_main_yaml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ Test role with a minimum amount of metadata

The main entrypoint for the extended role

A longer description of the entrypoint.

Reaching multiple lines.

This contains the various parameters one can give in argument_specs that do not get tested below.

|Option|Description|Type|Required|Default|
|---|---|---|---|---|
| name | This one contains option-name, which should override the name given for the option. | str | no | |
Expand Down

0 comments on commit 8b5fadd

Please sign in to comment.