Home
Softono

Blocknote Code

Open source Apache-2.0 TypeScript
32
Stars
1
Forks
13
Issues
0
Watchers
7 months
Last Commit

 About Blocknote Code

Code block plugin for blocknote.

Platforms

Web Self-hosted

Languages

TypeScript

Links

Need Help Installing Blocknote Code?

We provide expert installation service for this software. Our team will install, configure, and secure Blocknote Code on your server. plans start at just $30.

Blocknote Code

View on GitHub

Code block for Blocknote

Stability Badge

Code block for Blocknote.

Demo

A demo is worth a thousand words

Installation

Install via YARN

Get the package

$ yarn add @defensestation/blocknote-code

Usage

Include module at your application

import { CodeBlock, insertCode } from "@defensestation/blocknote-code";

Create schema with code block.

const schema = BlockNoteSchema.create({
   blockSpecs: {
    ...defaultBlockSpecs,
    procode: CodeBlock,
  },
});

Add slash menu item.

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