{% comment %} 
Check for preamble_toc first so empty <ol>s aren't drawn when it loops back through.
{% endcomment %}
{% with toc_depth=toc_depth|default:1 %}
{% if preamble_toc %}
  <ol class="toc-depth-{{toc_depth}}">
    {% for item in preamble_toc %}
      <li>
          <a
              href="{{item.url}}"
              data-section-id="{{item.section_id}}"
              class="toc-item toc-entry-at-{{toc_depth}}">
            {{item.title.full}}
          </a>

        {% with preamble_toc=item.children toc_depth=toc_depth|add:1 %}
          {% include "regulations/toc-preamble.html" %}
        {% endwith %}
      </li>
      {% endfor %}
  </ol>
{% endif %}
{% endwith %}
