Skip to content

Option to configure the Markdown Table of Contents depth #1101

@imbrn

Description

@imbrn

This is a feature request.

I'm in the middle of a project and I'm using documentation to generate the markdown version of the API docs. I'd like to change the depth of the generated TOC. I'm getting a static value of 3, and in this case, it'd be better if it was 2.

It has the option to disable the TOC by using: --markdown-toc false, and I think it would be great if we had something like --markdown-toc-depth {number}, to specify the desired depth. It could be 3 by default and it wouldn't break any current usage of documentation.

We could change the markdown_ast file to use a configuration entry for the TOC depth, instead of the static value 3:

u('heading', { depth: 3 }, [u('text', 'Table of Contents')])

And in the shared_options file, we could set this configuration information, like we have for the markdown-toc:

'markdown-toc': {
describe: 'include a table of contents in markdown output',
default: true,
type: 'boolean'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy