{# Pagination for regular pages #} {% macro pagination(current_page, total_pages) %} {% if total_pages <= 1 %} {%- else %} {%- endif %} {% endmacro %} {# Pagination for index page #} {% macro index_pagination(total_pages) %} {% if total_pages < 1 %} {%- else %} {%- endif %} {% endmacro %} {# Todo list #} {% macro todo_list(todos, tool_id) %}
Task List
{%- 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 -%}
✏️ Edit {{ filename }}{% if replace_all %} (replace all){% endif %}
{{ file_path }}
{{ old_string }}
+
{{ new_string }}
{%- endmacro %} {# Bash tool #} {% macro bash_tool(command, description, tool_id) %}
$ Bash
{%- if description %}
{{ description }}
{%- endif -%}
{{ command }}
{%- endmacro %} {# Generic tool use - input_json is pre-formatted so needs |safe #} {% macro tool_use(tool_name, description, input_json, tool_id) %}
{{ tool_name }}
{%- if description -%}
{{ description }}
{%- endif -%}
{{ input_json }}
{%- endmacro %} {# Tool result - content_html is pre-rendered so needs |safe #} {% macro tool_result(content_html, is_error) %} {%- set error_class = ' tool-error' if is_error else '' -%}
{{ content_html|safe }}
{%- endmacro %} {# Thinking block - content_html is pre-rendered markdown so needs |safe #} {% macro thinking(content_html) %}
Thinking
{{ content_html|safe }}
{%- endmacro %} {# Assistant text - content_html is pre-rendered markdown so needs |safe #} {% macro assistant_text(content_html) %}
{{ content_html|safe }}
{%- endmacro %} {# User content - content_html is pre-rendered so needs |safe #} {% macro user_content(content_html) %}
{{ content_html|safe }}
{%- endmacro %} {# Image block with base64 data URL #} {% macro image_block(media_type, data) %}
{%- endmacro %} {# Commit card (in tool results) #} {% macro commit_card(commit_hash, commit_msg, github_repo) %} {%- if github_repo -%} {%- set github_link = 'https://github.com/' ~ github_repo ~ '/commit/' ~ commit_hash -%}
{{ commit_hash[:7] }} {{ commit_msg }}
{%- else -%}
{{ commit_hash[:7] }} {{ commit_msg }}
{%- endif %} {%- endmacro %} {# Message wrapper - content_html is pre-rendered so needs |safe #} {% macro message(role_class, role_label, msg_id, timestamp, content_html) %}
{{ role_label }}
{{ content_html|safe }}
{%- endmacro %} {# Continuation wrapper - content_html is pre-rendered so needs |safe #} {% macro continuation(content_html) %}
Session continuation summary{{ content_html|safe }}
{%- endmacro %} {# Index item (prompt) - rendered_content and stats_html are pre-rendered so need |safe #} {% macro index_item(prompt_num, link, timestamp, rendered_content, stats_html) %}
#{{ prompt_num }}
{{ rendered_content|safe }}
{{ stats_html|safe }}
{%- endmacro %} {# Index commit #} {% macro index_commit(commit_hash, commit_msg, timestamp, github_repo) %} {%- if github_repo -%} {%- set github_link = 'https://github.com/' ~ github_repo ~ '/commit/' ~ commit_hash -%}
{{ commit_hash[:7] }}
{{ commit_msg }}
{%- else -%}
{{ commit_hash[:7] }}
{{ commit_msg }}
{%- 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 -%}
{%- if tool_stats_str -%}{{ tool_stats_str }}{%- endif -%} {{ long_texts_html|safe }}
{%- endif %} {%- endmacro %} {# Long text in index - rendered_content is pre-rendered markdown so needs |safe #} {% macro index_long_text(rendered_content) %}
{{ rendered_content|safe }}
{%- endmacro %}