Skip to content

feat: add max_level option to hide deeply nested entries - #12

Merged
zerochae merged 1 commit into
masterfrom
feat/max-level
Jul 21, 2026
Merged

feat: add max_level option to hide deeply nested entries#12
zerochae merged 1 commit into
masterfrom
feat/max-level

Conversation

@zerochae

Copy link
Copy Markdown
Owner

Summary

Adds a max_level config option (1-6) to hide entries deeper than a given level. Unset (nil) keeps the current behaviour of showing everything.

Details

  • parser.parse() filters entries with level > max_level after sorting, so all parsers and layout see the trimmed set.
  • Config default (max_level = nil), shallow validation (warns on non-number or out-of-range 1-6), and a toc.Config type annotation.
  • Documented in doc/toc.txt and the README quick-start.

Testing

  • make check: stylua clean + tests pass (parser +2, config +1 cases).

@zerochae zerochae self-assigned this Jul 21, 2026
@zerochae
zerochae merged commit 1c03d1f into master Jul 21, 2026
3 checks passed
@zerochae
zerochae deleted the feat/max-level branch July 23, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant