{% from 'macros/_misc.html' import list_to_html_multiline %} {# render_zim_search_table - Format Zim Search results into a table for display humanReadableId - Id of the Zim book being searched results - whoosh search results (format differ from typical sqlite results) offset - the index into the total result sets of the first result on this page. class - css class for the table #} {% macro render_zim_search(humanReadableId, results, offset, class='') %}
    {% for result in results %}
  1. {{ list_to_html_multiline(result['title']) }}
  2. {% endfor %}
{% endmacro %} {% macro render_pagination(pagination, endpoint_desc, query='') %} {% if pagination.pages > 1 %}
{% if pagination.has_prev %} Previous {% endif %} {% for page in pagination.iter_pages() %} {% if page %} {{ page }} {% else %} ... {% endif %} {% endfor %} {% if pagination.has_next %} Next {% endif %}
{% endif %} {% endmacro %}