mirror of
https://gitlab.com/MisterBiggs/brain-quartz.git
synced 2025-08-21 12:54:54 +00:00
.github
content
docs
advanced
features
images
plugins
AliasRedirects.md
Assets.md
CNAME.md
Citations.md
ComponentResources.md
ContentIndex.md
ContentPage.md
CrawlLinks.md
CreatedModifiedDate.md
CustomOgImages.md
Description.md
ExplicitPublish.md
FolderPage.md
Frontmatter.md
GitHubFlavoredMarkdown.md
HardLineBreaks.md
Latex.md
NotFoundPage.md
ObsidianFlavoredMarkdown.md
OxHugoFlavoredMarkdown.md
RemoveDrafts.md
RoamFlavoredMarkdown.md
Static.md
SyntaxHighlighting.md
TableOfContents.md
TagPage.md
index.md
tags
authoring content.md
build.md
configuration.md
hosting.md
index.md
layout-components.md
layout.md
migrating from Quartz 3.md
philosophy.md
setting up your GitHub repository.md
showcase.md
upgrading.md
quartz
.gitattributes
.gitignore
.node-version
.npmrc
.prettierignore
.prettierrc
CODE_OF_CONDUCT.md
Dockerfile
LICENSE.txt
README.md
globals.d.ts
index.d.ts
package-lock.json
package.json
quartz.config.ts
quartz.layout.ts
tsconfig.json
27 lines
1.2 KiB
Markdown
27 lines
1.2 KiB
Markdown
---
|
|
title: TableOfContents
|
|
tags:
|
|
- plugin/transformer
|
|
---
|
|
|
|
This plugin generates a table of contents (TOC) for Markdown documents. See [[table of contents]] for more information.
|
|
|
|
> [!note]
|
|
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
|
|
|
This plugin accepts the following configuration options:
|
|
|
|
- `maxDepth`: Limits the depth of headings included in the TOC, ranging from `1` (top level headings only) to `6` (all heading levels). Default is `3`.
|
|
- `minEntries`: The minimum number of heading entries required for the TOC to be displayed. Default is `1`.
|
|
- `showByDefault`: If `true` (default), the TOC should be displayed by default. Can be overridden by frontmatter settings.
|
|
- `collapseByDefault`: If `true`, the TOC will start in a collapsed state. Default is `false`.
|
|
|
|
> [!warning]
|
|
> This plugin needs the `Component.TableOfContents` component in `quartz.layout.ts` to determine where to display the TOC. Without it, nothing will be displayed. They should always be added or removed together.
|
|
|
|
## API
|
|
|
|
- Category: Transformer
|
|
- Function name: `Plugin.TableOfContents()`.
|
|
- Source: [`quartz/plugins/transformers/toc.ts`](https://github.com/jackyzha0/quartz/blob/v4/quartz/plugins/transformers/toc.ts).
|