Add ability to ignore headers when generating toc (#127)
* Added ability to ignore some or all headings when generating toc in sidebar * Added documentation for ignoring sub headers * Fixed minor test issues
This commit is contained in:
parent
788bbb36b4
commit
d57b80e224
14 changed files with 63 additions and 17 deletions
|
|
@ -68,3 +68,25 @@ A custom sidebar can also automatically generate a table of contents by setting
|
|||
</script>
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
```
|
||||
|
||||
## Ignoring Subheaders
|
||||
|
||||
When `subMaxLevel` is set, each header is automatically added to the table of contents by default. If you want to ignore a specific header, add `{docsify-ignore}` to it.
|
||||
|
||||
```markdown
|
||||
# Getting Started
|
||||
|
||||
## Header {docsify-ignore}
|
||||
This header won't appear in the sidebar table of contents.
|
||||
```
|
||||
|
||||
To ignore all headers on a specific page, you can use `{docsify-ignore-all}` on the first header of the page.
|
||||
|
||||
```markdown
|
||||
# Getting Started {docsify-ignore-all}
|
||||
|
||||
## Header
|
||||
This header won't appear in the sidebar table of contents.
|
||||
```
|
||||
|
||||
Both `{docsify-ignore}` and `{docsify-ignore-all}` will not be rendered on the page when used.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue