maxTocLevel - speced/respec GitHub Wiki

maxTocLevel

Type: number Default: 0 (all levels)

Limits the depth of the table of contents. 0 means unlimited. Set to 2 to show only top-level sections and their direct children, 3 for one more level, etc.

Basic usage

var respecConfig = {
  maxTocLevel: 2,
};

Notes

  • maxTocLevel: 0 (default) includes all heading levels in the ToC
  • Use data-max-toc="N" on individual sections to override for that subtree
  • For very large specs, limiting ToC depth improves readability