@defensestation/blocknote-mermaid
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Mermaid for Blocknote

Stability Badge

Mermaid feature for Blocknote.

Demo

A demo is worth a thousand words

Installation

Install via YARN

Get the package

$ yarn add @defensestation/blocknote-mermaid

Usage

Include module at your application

import { MermaidBlock, insertMermaid } from "@defensestation/blocknote-mermaid";

Create schema with mermaid block.

const schema = BlockNoteSchema.create({
  blockSpecs: {
    ...defaultBlockSpecs,
    mermaid: MermaidBlock,
  },
});

Add slash menu item.

<BlockNoteView
    editor={editor}
    slashMenu={false}
  >
    <SuggestionMenuController
      triggerCharacter={"/"}
      getItems={async (query) =>
        filterSuggestionItems(
          [...getDefaultReactSlashMenuItems(editor), insertMermaid()],
          query
        )
      }
    />
  </BlockNoteView>

Roadmap

  • [ ] Custom styles
  • [ ] Chart viewer in read only mode.

Package Sidebar

Install

npm i @defensestation/blocknote-mermaid

Weekly Downloads

7

Version

1.0.1

License

none

Unpacked Size

56.1 kB

Total Files

17

Last publish

Collaborators

  • harpal_singh
  • gsingh-ds