Remove unnecessary repeated definitions of the cleanup macro
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
>
|
||||
{# Morning Briefing #}
|
||||
{%- macro getReport() -%}
|
||||
{% from 'formatting.jinja' import cleanup %}
|
||||
{% from 'speech.jinja' import greeting_nodate, dadjoke, inspirational_quote %}
|
||||
{% from 'status.jinja' import tonyStatusReport, tinaStatusReport, kallenStatusReport, emmaStatusReport %}
|
||||
{% from 'easy_time.jinja' import count_the_days %}
|
||||
@ -187,18 +188,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