{# Tool card macro #} {% macro tool_card(tool=none, owner=none, name=none, description=none, category=none, downloads=none, version=none, tags=none, rating=none, rating_count=none, has_issues=none) %} {% if tool is none %} {% set tool = { "owner": owner, "name": name, "description": description, "category": category, "downloads": downloads, "version": version, "tags": tags, "rating": rating, "rating_count": rating_count, "has_issues": has_issues } %} {% endif %}
{% if tool.category %} {{ tool.category }} {% endif %}
{{ tool.name[0]|upper }}

{{ tool.name }}

by {{ tool.owner }}

{{ tool.description or 'No description available.' }}

{% if tool.tags %}
{% for tag in tool.tags[:5] %} {{ tag }} {% endfor %} {% if tool.tags|length > 5 %} +{{ tool.tags|length - 5 }} more {% endif %}
{% endif %}
{{ tool.downloads|default(0)|format_number if tool.downloads else 0 }} {% if tool.rating and tool.rating > 0 %} {{ "%.1f"|format(tool.rating) }}{% if tool.rating_count %}({{ tool.rating_count }}){% endif %} {% endif %} {% if tool.has_issues %} {% endif %}
v{{ tool.version }}
cmdforge install {{ tool.owner }}/{{ tool.name }}
{% endmacro %}