Index
{% if current_page > 1 -%}
← Prev
{%- else -%}
← Prev
{%- endif %}
{% for page in range(1, total_pages + 1) -%}
{% if page == current_page -%}
{{ page }}
{%- else -%}
{{ page }}
{%- endif %}
{% endfor -%}
{% if current_page < total_pages -%}
Next →
{%- else -%}
Next →
{%- endif %}
{%- endif %}
{% endmacro %}
{# Pagination for index page #}
{% macro index_pagination(total_pages) %}
{% if total_pages < 1 %}
Index
{%- else %}
Index← Prev
{% for page in range(1, total_pages + 1) -%}
{{ page }}
{% endfor -%}
{% if total_pages >= 1 -%}
Next →
{%- else -%}
Next →
{%- endif %}
{%- endif %}
{% endmacro %}
{# Todo list #}
{% macro todo_list(todos, tool_id) %}
☰ Task List
{%- for todo in todos -%}
{%- set status = todo.status|default('pending') -%}
{%- set content = todo.content|default('') -%}
{%- if status == 'completed' -%}
{%- set icon = '✓' -%}
{%- set status_class = 'todo-completed' -%}
{%- elif status == 'in_progress' -%}
{%- set icon = '→' -%}
{%- set status_class = 'todo-in-progress' -%}
{%- else -%}
{%- set icon = '○' -%}
{%- set status_class = 'todo-pending' -%}
{%- endif -%}
{{ icon }}{{ content }}
{%- endfor -%}
{%- endmacro %}
{# Write tool #}
{% macro write_tool(file_path, content, tool_id) %}
{%- set filename = file_path.split('/')[-1] if '/' in file_path else file_path -%}
📝 Write {{ filename }}
{{ file_path }}
{{ content }}
{%- endmacro %}
{# Edit tool #}
{% macro edit_tool(file_path, old_string, new_string, replace_all, tool_id) %}
{%- set filename = file_path.split('/')[-1] if '/' in file_path else file_path -%}
{%- endif %}
{%- endmacro %}
{# Index stats - tool_stats_str and long_texts_html are pre-rendered so need |safe #}
{% macro index_stats(tool_stats_str, long_texts_html) %}
{%- if tool_stats_str or long_texts_html -%}
{%- endif %}
{%- endmacro %}
{# Long text in index - rendered_content is pre-rendered markdown so needs |safe #}
{% macro index_long_text(rendered_content) %}