Remove unnecessary repeated definitions of the cleanup macro
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
>
|
||||
{# Kallen Morning Briefing #}
|
||||
{%- macro getReport() -%}
|
||||
{% from 'formatting.jinja' import cleanup %}
|
||||
{% from 'time.jinja' import current_time, current_date_readout, input_datetime_read %}
|
||||
{% from 'speech.jinja' import dadjoke, inspirational_quote %}
|
||||
{% from 'easy_time.jinja' import count_the_days, custom_time %}
|
||||
@ -191,17 +192,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