> {% macro getConfirmation() %} {{ [ "Okay.", "If you insist.", "I am afraid I can't do that Dave,,,I am kidding,", "Leave it to me.", "As you wish.", "By your command.", "Affirmative.", "No Problem.", "I think I can handle that.", "Working on it now." ] | random }} {% endmacro %} {# a macro that removes all newline characters, empty spaces, and returns formatted text #} {%- macro cleanup(data) -%} {%- for item in data.split("\n") if item | trim != "" -%} {{ item | trim }} {% endfor -%} {%- endmacro -%} {# a macro to call all macros :) #} {%- macro mother_of_all_macros() -%} {{ getConfirmation() }} {%- endmacro -%} {# Call the macro #} {{- cleanup(mother_of_all_macros()) -}}