Table of Contents Component

MVP table of contents. Will add a component menu with style choices soon.
This commit is contained in:
Ryan Palmer
2024-09-03 09:16:12 +10:00
parent 1141796f24
commit 1f153dfd55
6 changed files with 193 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import {
IconLetterY,
IconList,
IconListNumbers,
IconListTree,
IconMath,
IconMathFunction,
IconMovie,
@ -96,6 +97,20 @@ const CommandGroups: SlashMenuGroupedItemsType = {
.run();
},
},
{
title: "Table of Contents",
description: "Create a table of contents.",
searchTerms: ["table", "contents", "list"],
icon: IconListTree,
command: ({ editor, range }: CommandProps) => {
editor
.chain()
.focus()
.deleteRange(range)
.toggleTableOfContents()
.run();
},
},
{
title: "Bullet list",
description: "Create a simple bullet list.",