{# Storefront building blocks (monograms, badges, chips, feather icons).
All styling lives in skin_store.css (splent_feature_skin_store). #}
{% set ICON_PATHS = {
"search": '',
"package": '',
"box": '',
"layers": '',
"check": '',
"check-circle": '',
"alert-triangle": '',
"alert-circle": '',
"x-circle": '',
"users": '',
"external-link": '',
"copy": '',
"terminal": '',
"arrow-right": '',
"arrow-left": '',
"git-branch": '',
"tag": '',
"sliders": '',
"download": '',
"plus": '',
"lock": '',
"grid": '',
"info": '',
"zap": '',
"chevron-down": '',
"folder": '',
"server": '',
"settings": '',
"link": '',
"git-merge": '',
"check-square": '',
"tool": '',
} %}
{% macro icon(name, size=16) -%}
{%- endmacro %}
{# An icon that closes a link ("Read the guide" and its arrow). A no-break
space glued to the icon inside a span that never wraps keeps the icon on
the line of the last word: a plain space, or even a bare no-break space,
still let the browser push the icon alone onto the next line. #}
{% macro trailing_icon(name, size=13) -%}
{{ icon(name, size) }}
{%- endmacro %}
{% macro monogram(short, large=false) -%}
{{ (short or "?")[0] }}
{%- endmacro %}
{% macro archetype_badge(archetype) -%}
{%- if archetype %}{{ archetype }}{% endif -%}
{%- endmacro %}
{% macro version_pill(feature) -%}
v{{ feature.project_version or feature.version or "0.0.0" }}
{%- endmacro %}
{% macro feature_chip(short, external=false) -%}
{%- if external -%}
{{ short }}{{ _("external") }}
{%- else -%}
{{ short }}
{%- endif -%}
{%- endmacro %}
{# The Copy button of a command block: it copies the text of the element
whose id it names (see the copy script of the feature sheet). #}
{% macro copy_button(target, label=none) -%}
{%- endmacro %}
{# A row of feature chips under a label, inside a .store-contract box. #}
{% macro chip_row(label, shorts, known=none) -%}
{% if shorts %}
{{ label }}
{% for short in shorts %}{{ feature_chip(short, external=(known is not none and short not in known)) }}{% endfor %}
{% endif %}
{%- endmacro %}
{# A shell command with each argument in its own box, so a narrow column
wraps between arguments and never inside one ('splent-io/...' breaks at
its hyphen as plain text). An argument with a slash is two boxes, up to
and after the last slash, so one too long for the line breaks after the
slash. The store skin styles .store-cmd. #}
{% macro command(text) -%}
{% for arg in text.split() %}{% if "/" in arg and not arg.endswith("/") %}{% set head = arg.rsplit("/", 1)[0] ~ "/" %}{{ head }}{{ arg[head | length:] }}{% else %}{{ arg }}{% endif %}{% if not loop.last %} {% endif %}{% endfor %}
{%- endmacro %}