Skip to content

Repository files navigation

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.

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

Add slash menu item.

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

About

Code block plugin for blocknote.

Topics

Resources

Code of conduct

Contributing

Stars

32 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages