Skip to content

Limit the TOC level depth in extensions/toc #637

Closed
@the9000

Description

@the9000

Use case

Take a document, such as an API description, or a document converted from Org mode, with lots of deep-level headers and very short texts under each of them.
A TOC of such a document becomes excessively long and detailed. (My particular case is what mkdocs generates.)

A fix

  • Add a config parameter that optionally limits the maximum level of headers included in the TOC.
  • Filter the levels where they are generated according to that parameter.

I'll gladly make a PR, but would appreciate any advice on the best way to add a config parameter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    extensionRelated to one or more of the included extensions.featureFeature request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions