No description
Find a file
saberzero1 4d0654aad0
chore: commit dist/ and remove prepare script
Pre-built output is now committed to the repository so that
Quartz can skip the build step during plugin installation.
The prepare script is removed to prevent redundant builds
when installing from npm/git.
2026-03-14 22:01:44 +01:00
.github/workflows Initial commit 2026-02-09 23:00:25 +01:00
dist chore: commit dist/ and remove prepare script 2026-03-14 22:01:44 +01:00
src feat: add render event listener for in-place DOM re-initialization 2026-03-12 19:45:33 +01:00
test feat(plugins): table of contents as community plugin 2026-02-09 23:18:16 +01:00
.eslintrc.json Initial commit 2026-02-09 23:00:25 +01:00
.gitignore chore: commit dist/ and remove prepare script 2026-03-14 22:01:44 +01:00
.prettierrc Initial commit 2026-02-09 23:00:25 +01:00
CHANGELOG.md Initial commit 2026-02-09 23:00:25 +01:00
LICENSE Initial commit 2026-02-09 23:00:25 +01:00
package-lock.json chore: commit dist/ and remove prepare script 2026-03-14 22:01:44 +01:00
package.json chore: commit dist/ and remove prepare script 2026-03-14 22:01:44 +01:00
README.md docs: update README for v5 unified config system 2026-02-25 16:07:03 +01:00
tsconfig.json Migrate types to use @quartz-community/types exports 2026-02-13 13:18:38 +01:00
tsup.config.ts fix: compile SCSS via sass instead of raw text to prevent lightningcss errors 2026-02-26 16:44:51 +01:00
vitest.config.ts Initial commit 2026-02-09 23:00:25 +01:00

@quartz-community/table-of-contents

Renders an interactive table of contents for pages. Also includes a transformer that extracts heading structure from markdown.

Installation

npx quartz plugin add github:quartz-community/table-of-contents

Usage

plugins:
  - source: github:quartz-community/table-of-contents
    enabled: true

For advanced use cases, you can override in TypeScript:

import * as ExternalPlugin from "./.quartz/plugins";

// Transformer
ExternalPlugin.TableOfContentsTransformer({ maxDepth: 3 });

// Component
ExternalPlugin.TableOfContents({ layout: "modern" });

Configuration

Component Options

Option Type Default Description
layout "modern" | "legacy" "modern" The layout style of the table of contents.

Transformer Options

Option Type Default Description
maxDepth number 3 The maximum heading depth to include in the table of contents (1-6).
minEntries number 1 The minimum number of entries required to display the table of contents.
showByDefault boolean true Whether to show the table of contents by default.
collapseByDefault boolean false Whether to collapse the table of contents by default.

Documentation

See the Quartz documentation for more information.

License

MIT