diff --git a/ansibledoctor/templates/hugo-book/_requirements.j2 b/ansibledoctor/templates/hugo-book/_requirements.j2 new file mode 100644 index 0000000..b8d8715 --- /dev/null +++ b/ansibledoctor/templates/hugo-book/_requirements.j2 @@ -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 %} diff --git a/ansibledoctor/templates/hugo-book/_toc.j2 b/ansibledoctor/templates/hugo-book/_toc.j2 index 7e0a931..c4ac816 100644 --- a/ansibledoctor/templates/hugo-book/_toc.j2 +++ b/ansibledoctor/templates/hugo-book/_toc.j2 @@ -1,3 +1,4 @@ +- [Requirements](#requirements) {% set var = role.var | default({}) %} {% if var %} - [Default Variables](#default-variables) diff --git a/ansibledoctor/templates/hugo-book/index.md.j2 b/ansibledoctor/templates/hugo-book/index.md.j2 index 831e236..f7894fd 100644 --- a/ansibledoctor/templates/hugo-book/index.md.j2 +++ b/ansibledoctor/templates/hugo-book/index.md.j2 @@ -19,6 +19,9 @@ summary: {{ meta.summary.value | safe_join(" ") }} {# TOC #} {% include '_toc.j2' %} +{# Requirements #} +{% include '_requirements.j2' %} + {# Vars #} {% include '_vars.j2' %} diff --git a/ansibledoctor/templates/readme/README.md.j2 b/ansibledoctor/templates/readme/README.md.j2 index 247c90f..80c08ec 100644 --- a/ansibledoctor/templates/readme/README.md.j2 +++ b/ansibledoctor/templates/readme/README.md.j2 @@ -11,6 +11,9 @@ {# TOC #} {% include '_toc.j2' %} +{# Requirements #} +{% include '_requirements.j2' %} + {# Vars #} {% include '_vars.j2' %} diff --git a/ansibledoctor/templates/readme/_requirements.j2 b/ansibledoctor/templates/readme/_requirements.j2 new file mode 100644 index 0000000..b8d8715 --- /dev/null +++ b/ansibledoctor/templates/readme/_requirements.j2 @@ -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 %} diff --git a/ansibledoctor/templates/readme/_toc.j2 b/ansibledoctor/templates/readme/_toc.j2 index fc47a29..6dd3108 100644 --- a/ansibledoctor/templates/readme/_toc.j2 +++ b/ansibledoctor/templates/readme/_toc.j2 @@ -1,5 +1,6 @@ ## Table of content +- [Requirements](#requirements) {% set var = role.var | default({}) %} {% if var %} - [Default Variables](#default-variables)