data max toc - speced/respec GitHub Wiki

data-max-toc

Applies to: <section>

Limits the ToC depth for this section subtree, without setting a global limit via maxTocLevel. Useful when some sections need deep nesting but their subsections shouldn't clutter the ToC.

Usage

<section data-max-toc="2">
  <h2>Infrastructure</h2>
  <section>
    <h2>Concepts</h2>          <!-- included in ToC -->
    <section>
      <h2>Details</h2>         <!-- NOT in ToC (depth 3 > max 2) -->
    </section>
  </section>
</section>
<section data-max-toc="0">
  <h2>Internal Notes</h2>      <!-- NOT in ToC -->
</section>

Notes

  • data-max-toc="0" is equivalent to class="notoc" — the section and all its children are excluded from ToC
  • Depth is counted from the section itself (not the document root)
  • See maxTocLevel for a document-wide depth limit
⚠️ **GitHub.com Fallback** ⚠️