Created
March 7, 2016 14:34
-
-
Save blarghmatey/57aaa63ad6cf3da5f981 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{%- macro fluent_config_block(settings, offset=0) -%} | |
{%- for setting in settings %} | |
{{ ''|indent(offset, true) }}<{{ setting.directive }} {{ setting.get('directive_arg', '')}}> | |
{% for attr in setting.attrs -%} | |
{%- if 'nested_directives' in attr.keys() -%} | |
{{ fluent_config_block(attr.nested_directives, offset + 2) }} | |
{% else -%} | |
{{ attr.keys()[0]|indent(offset + 2, true) }} {{ attr.values()[0] }} | |
{% endif -%} | |
{% endfor -%} | |
{{ ''|indent(offset, true) }}</{{ setting['directive'] }}> | |
{% endfor -%} | |
{%- endmacro -%} | |
{{ fluent_config_block(settings) }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment