{#- How a value that is one of a few is drawn: a badge in the tone its field gives it, or nothing where the field draws that value with no badge. -#} {% macro badge(item, raw, text) -%} {%- set tone = item.tone_of(raw) if item.tone_of is defined else 3 -%} {%- if tone is not none -%} {{ text }} {%- endif -%} {%- endmacro %}