{% macro render_value(value, level=0) %} {% if value is mapping %} {% if not value %} (Empty Dictionary) {% else %} {% for k, v in value.items() %} {% endfor %}
{{ k }} {{ render_value(v, level + 1) }}
{% endif %} {% elif value is iterable and value is not string %} {% if not value %} (Empty List) {% else %} {% endif %} {% elif value is boolean %} {{ value }} {% elif value is number %} {{ value }} {% elif value is none %} None {% else %} {# Apply pre-wrap for multi-line strings and render markdown #}
{{ value | markdown | safe }}
{% endif %} {% endmacro %} {# Main entry point for this partial, assuming result_data is in context #} {{ render_value(result_data) }}