Skip to content

Add option to hide toc #7

@cdervis

Description

@cdervis

Hi @mgks,

first off, thanks for building this excellent documentation tool. Very easy to set up and accomplishes its "it just works" goal. 👏

I may have overlooked it, or is it not yet possible to hide the table of contents for specific pages?
If so, I think a good fit for this might be the frontmatter, where one could specify one of three values:

  • toc: visible: Shows the toc fully, just as it does now. So this would be the default if not specified in the frontmatter.
  • toc: none: Hides the toc & its sidebar completely. So the <div class="toc-sidebar"> would not be generated.
  • toc: sidebar: Only suppresses the generation of the <div class="toc-container">.

The reason I'm proposing three options instead of just toc: true and toc: false is so that the toc-sidebar could still be used for other elements in the future, as a general sidebar.

However, if you don't see a point in keeping that sidebar, it might just as well be a toc: true / toc: false.
Would this simply be an adjustment to this line?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions