docs: update TOC docs

This commit is contained in:
Vytautas 2023-08-02 10:59:22 +08:00 committed by GitHub
parent 5bd78d30a7
commit 93a5503a6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,14 +130,14 @@ Storybook's auto-generated documentation pages can be quite long and difficult t
By default, the table of contents on the documentation page will only show the `h3` headings that are automatically generated. However, if you want to customize the table of contents, you can add more parameters to the `toc` property. The following options and examples of how to use them are available.
| Option | Description |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `contentsSelector` | Defines the container's CSS selector for search for the headings <br/> `toc: { contentsSelector: '.sbdocs-content' }` |
| `disable` | Hides the table of contents for the documentation pages <br/> `toc: { disable: true }` |
| `headingSelector` | Defines the list of headings to feature in the table of contents <br/> `toc: { headingSelector: 'h1, h2, h3' }` |
| `ignoreSelector` | Configures the table of contents to ignore specific headings or stories <br/> `toc: { ignoreSelector: 'h2' }` |
| `title` | Defines a title caption for the table of contents. <br/>Accepts one of: `string`, `null`, React element <br/> `toc: { title: 'Table of Contents' }` |
| `unsafeTocbotOptions` | Provides additional [`TocBot`](https://tscanlin.github.io/tocbot/) configuration options <br/> `toc: { unsafeTocbotOptions: { orderedList: true } }` |
| Option | Description |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `contentsSelector` | Defines the container's CSS selector for search for the headings <br/> `toc: { contentsSelector: '.sbdocs-content' }` |
| `disable` | Hides the table of contents for the documentation pages <br/> `toc: { disable: true }` |
| `headingSelector` | Defines the list of headings to feature in the table of contents <br/> `toc: { headingSelector: 'h1, h2, h3' }` |
| `ignoreSelector` | Configures the table of contents to ignore specific headings or stories. By default, the table of contents will ignore all content placed within Story blocks <br/> `toc: { ignoreSelector: '.docs-story h2' }` |
| `title` | Defines a title caption for the table of contents. <br/>Accepts one of: `string`, `null`, React element <br/> `toc: { title: 'Table of Contents' }` |
| `unsafeTocbotOptions` | Provides additional [`TocBot`](https://tscanlin.github.io/tocbot/) configuration options <br/> `toc: { unsafeTocbotOptions: { orderedList: true } }` |
<div class="aside">