{% macro stat_section(panel, heading, aria_label, panel_class, rows) -%} {%- if !rows.is_empty() %}
{{ heading }}
{%- for row in rows %} {{- stat_row(row) -}} {%- endfor %}
{%- endif %} {%- endmacro %} {% macro language_section(panel, panel_class, languages, total) -%} {%- if !languages.is_empty() %}
Languages
{%- for lang in languages %} {{- lang_row(lang) -}} {%- endfor %} {{- language_total_row(total) -}}
{%- endif %} {%- endmacro %} {% macro stat_row(row) -%}
{%- if !row.icon.is_empty() %} {%- endif %} {{ row.label }}
{%- if !row.items.is_empty() -%} {{- stat_sublist(row.items.as_slice()) -}} {%- else if !row.href.is_empty() -%} {{ row.value }} {%- else -%} {{ row.value }} {%- endif -%}
{%- endmacro %} {% macro stat_sublist(items) -%}
{%- for item in items %}
{%- if !item.href.is_empty() -%} {{ item.label }} {%- else -%} {{ item.label }} {%- endif -%}
{%- if !item.metrics.is_empty() -%} {{- stat_metrics(item.metrics.as_slice()) -}} {%- else -%} {{ item.value }} {%- endif -%}
{%- endfor %}
{%- endmacro %} {% macro stat_metrics(metrics) -%} {%- for metric in metrics %} {{ metric.value }} {%- if !metric.label.is_empty() %} {{ metric.label }} {%- endif %} {%- endfor %} {%- endmacro %} {% macro lang_row(lang) -%}
{{ lang.name }}
{{ lang.lines }} {{ lang.value }}
{%- endmacro %} {% macro language_total_row(total) -%} {%- if !total.is_empty() %}
Total
{{ total }} LOC
{%- endif %} {%- endmacro %}