Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docusaurus - How to remove TOC(table of contents)?

Tags:

docusaurus

I'm using docusaurus for our dev docs.

How to disable TOC?

enter image description here

Thanks.

like image 673
Dorr Avatar asked Jun 30 '21 03:06

Dorr


Video Answer


2 Answers

Docosaurus has Markdown Frontmatter metadata fields for .md files where you will eventually make use of the hide_table_of_contents field and set it to true.

Your .md should look like:

--- 
hide_table_of_contents: true
---
# Markdown Features
My Document Markdown content
like image 70
Gicck Avatar answered Sep 28 '22 04:09

Gicck


There does not seem to be a way to make the hide_table_of_contents setting default to true; you need to add it to the Front Matter for every document if you want to completely disable the ToC display.

Another approach to completely disable the ToC display would be to edit the css, adding:

.theme-doc-toc-desktop {
   display: none;
}
like image 34
Owen Garrett Avatar answered Sep 28 '22 03:09

Owen Garrett