Remove unnecessary repeated definitions of the cleanup macro
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
>
|
||||
{# Welcome Home #}
|
||||
{%- macro getReport() -%}
|
||||
{% from 'formatting.jinja' import cleanup %}
|
||||
{% from 'speech.jinja' import dadjoke %}
|
||||
{% from 'time.jinja' import input_datetime_read %}
|
||||
{% from 'status.jinja' import emma_sleep %}
|
||||
@ -174,17 +175,4 @@
|
||||
</p>
|
||||
|
||||
{%- 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() -%}
|
||||
{{ getReport() }}
|
||||
{%- endmacro -%}
|
||||
|
||||
{# Call the macro #}
|
||||
{{- cleanup(mother_of_all_macros()) -}}
|
||||
{{- cleanup(getReport()) -}}
|
Reference in New Issue
Block a user