mirror of
https://github.com/esphome/esphome.git
synced 2025-10-21 11:13:46 +01:00
9 lines
325 B
Django/Jinja
9 lines
325 B
Django/Jinja
{#- Macro for formatting symbol names in tables -#}
|
|
{%- macro format_symbol(symbol, max_length, truncate_length) -%}
|
|
{%- if symbol|length <= max_length -%}
|
|
`{{ symbol }}`
|
|
{%- else -%}
|
|
<details><summary><code>{{ symbol[:truncate_length] }}...</code></summary><code>{{ symbol }}</code></details>
|
|
{%- endif -%}
|
|
{%- endmacro -%}
|