Open-source and local-first Slack and Notion alternative that puts you in control of your data
TypeScript chatchat-applicationcrdteditorelectronknowledge-baselocal-firstnotionnotion-alternativerealtime-collaborationself-hostedslacksqliteteam-collaborationwikiyjs
import { Code } from 'lucide-react';
import { EditorCommand } from '@colanode/client/types';
export const CodeBlockCommand: EditorCommand = {
key: 'code-block',
name: 'Code',
description: 'Insert a code block',
keywords: ['code', 'codeblock'],
icon: Code,
disabled: false,
handler: ({ editor, range }) => {
editor.chain().focus().deleteRange(range).toggleCodeBlock().run();
},
};