feat: mermaid diagram integration (#202)

This commit is contained in:
Philip Okugbe
2024-08-24 18:30:07 +01:00
committed by GitHub
parent 17475bf123
commit 7e80797e3f
10 changed files with 733 additions and 17 deletions

View File

@ -7,6 +7,7 @@ import {
IconH2,
IconH3,
IconInfoCircle,
IconLetterY,
IconList,
IconListNumbers,
IconMath,
@ -253,6 +254,19 @@ const CommandGroups: SlashMenuGroupedItemsType = {
command: ({ editor, range }: CommandProps) =>
editor.chain().focus().deleteRange(range).setMathBlock().run(),
},
{
title: "Mermaid diagram",
description: "Insert mermaid diagram",
searchTerms: ["mermaid", "diagram", "chart"],
icon: IconLetterY,
command: ({ editor, range }: CommandProps) =>
editor
.chain()
.focus()
.deleteRange(range)
.setCodeBlock({ language: "mermaid" })
.run(),
},
],
};