Skip to content

Commit

Permalink
feat: add role requirements to templates (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
germainlefebvre4 authored Mar 27, 2023
1 parent d47427e commit 26d7a3c
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ansibledoctor/templates/hugo-book/_requirements.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

## Requirements

{% if meta | deep_get(meta, "min_ansible_version.value") %}
- Minimum Ansible version: `{{ meta.min_ansible_version.value }}`
{% else %}
None.
{% endif %}
1 change: 1 addition & 0 deletions ansibledoctor/templates/hugo-book/_toc.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- [Requirements](#requirements)
{% set var = role.var | default({}) %}
{% if var %}
- [Default Variables](#default-variables)
Expand Down
3 changes: 3 additions & 0 deletions ansibledoctor/templates/hugo-book/index.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ summary: {{ meta.summary.value | safe_join(" ") }}
{# TOC #}
{% include '_toc.j2' %}

{# Requirements #}
{% include '_requirements.j2' %}

{# Vars #}
{% include '_vars.j2' %}

Expand Down
3 changes: 3 additions & 0 deletions ansibledoctor/templates/readme/README.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
{# TOC #}
{% include '_toc.j2' %}

{# Requirements #}
{% include '_requirements.j2' %}

{# Vars #}
{% include '_vars.j2' %}

Expand Down
8 changes: 8 additions & 0 deletions ansibledoctor/templates/readme/_requirements.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

## Requirements

{% if meta | deep_get(meta, "min_ansible_version.value") %}
- Minimum Ansible version: `{{ meta.min_ansible_version.value }}`
{% else %}
None.
{% endif %}
1 change: 1 addition & 0 deletions ansibledoctor/templates/readme/_toc.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Table of content

- [Requirements](#requirements)
{% set var = role.var | default({}) %}
{% if var %}
- [Default Variables](#default-variables)
Expand Down

0 comments on commit 26d7a3c

Please sign in to comment.