
* use position in vardata to mark internal hooks * update all render to use position * use macros for rendering * reduce number of iterations over hooks during rendering * cleanup code and add typing * add __future__ * use new macros to render component maps in markdown * remove calls to _get_all_hooks_internal * fix typo * forgot to replace this * unnecessary expand in utils.py
38 lines
901 B
Django/Jinja
38 lines
901 B
Django/Jinja
{% macro renderHooks(hooks) %}
|
|
{% set sorted_hooks = sort_hooks(hooks) %}
|
|
|
|
{# Render the grouped hooks #}
|
|
{% for hook, _ in sorted_hooks[const.hook_position.INTERNAL] %}
|
|
{{ hook }}
|
|
{% endfor %}
|
|
|
|
{% for hook, _ in sorted_hooks[const.hook_position.PRE_TRIGGER] %}
|
|
{{ hook }}
|
|
{% endfor %}
|
|
|
|
{% for hook, _ in sorted_hooks[const.hook_position.POST_TRIGGER] %}
|
|
{{ hook }}
|
|
{% endfor %}
|
|
{% endmacro %}
|
|
|
|
{% macro renderHooksWithMemo(hooks, memo)%}
|
|
{% set sorted_hooks = sort_hooks(hooks) %}
|
|
|
|
{# Render the grouped hooks #}
|
|
{% for hook, _ in sorted_hooks[const.hook_position.INTERNAL] %}
|
|
{{ hook }}
|
|
{% endfor %}
|
|
|
|
{% for hook, _ in sorted_hooks[const.hook_position.PRE_TRIGGER] %}
|
|
{{ hook }}
|
|
{% endfor %}
|
|
|
|
{% for hook in memo %}
|
|
{{ hook }}
|
|
{% endfor %}
|
|
|
|
{% for hook, _ in sorted_hooks[const.hook_position.POST_TRIGGER] %}
|
|
{{ hook }}
|
|
{% endfor %}
|
|
|
|
{% endmacro %} |