section - speced/respec GitHub Wiki

<section>

Standard HTML <section> elements are the building blocks of a ReSpec specification. ReSpec handles heading numbering, ToC generation, ID creation, and self-links automatically.

Usage

<section>
  <h2>The <code>fetch()</code> method</h2>
  <p>The <code>fetch()</code> method initiates a network request.</p>
</section>
<section>
  <h2>Infrastructure</h2>
  <section>
    <h2>Concepts</h2>
    <p>This section defines key concepts.</p>
  </section>
  <section>
    <h2>Algorithms</h2>
  </section>
</section>

Empty link auto-fill

Links to a section's ID with no text content are automatically filled with "ยง N.N Title":

<p>See <a href="#infrastructure"></a> for details.</p>
<!-- Renders as: See ยง 2 Infrastructure for details. -->

Notes

  • Use <h2> for all top-level sections by convention (ReSpec renumbers them correctly regardless)
  • Nesting depth can go beyond <h6> โ€” ReSpec clamps to <h6> for deep nesting
  • Add id attributes manually for stable URLs; ReSpec generates IDs from heading text if absent
  • Special section IDs: abstract, sotd, conformance, toc โ€” these trigger specific boilerplate
  • See appendix for lettered appendix sections
  • See informative to mark a section as non-normative
โš ๏ธ **GitHub.com Fallback** โš ๏ธ