From 844a05aea38c97dd06703eade27751d386019a84 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Wed, 6 Nov 2019 22:23:44 +0100 Subject: [PATCH] fix multiline default value template --- CHANGELOG.md | 2 ++ ansibledoctor/templates/readme/_vars.j2 | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0940cbf..80dfd1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ * BUGFIX * add missing default for `role_dir` * fix value mapping in jinja2 source dict + * add missing exception handling for dict merge + * fix handling of multiline default values in template * FEATURE * use explicit marker to convert annotation values to json diff --git a/ansibledoctor/templates/readme/_vars.j2 b/ansibledoctor/templates/readme/_vars.j2 index 9777336..afea397 100644 --- a/ansibledoctor/templates/readme/_vars.j2 +++ b/ansibledoctor/templates/readme/_vars.j2 @@ -14,7 +14,13 @@ #### Default value ```YAML +{% if item.value is mapping %} {{ item.value | to_nice_yaml(indent=2) }} +{% else %} +{% for ve_line in item.example %} +{{ ve_line }} +{% endfor %} +{% endif %} ``` {% endif %} {% if item.example is defined and item.example %}