Skip to content

Commit 2461d09

Browse files
docs: typo in example (#1884)
1 parent 3ed0387 commit 2461d09

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/04-theming/07-custom-code-block/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ export default function App() {
4545

4646
**Relevant Docs:**
4747

48-
- [Code Blocs](/docs/features/blocks/code-blocks)
48+
- [Code Blocks](/docs/features/blocks/code-blocks)
4949
- [shiki-codegen](https://shiki.style/packages/codegen)

playground/src/examples.gen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@
903903
"pathFromRoot": "examples/04-theming",
904904
"slug": "theming"
905905
},
906-
"readme": "To configure a code block highlighting theme and language, you can use the `codeBlock` option in the `useCreateBlockNote` hook.\n\nThis allows you to configure a shiki highlighter for the code blocks of your editor, allowing you to tailor the themes and languages you would like to use.\n\nTo create a syntax highlighter, you can use the [shiki-codegen](https://shiki.style/packages/codegen) CLI for generating the code to create a syntax highlighter for your languages and themes.\n\nFor example to create a syntax highlighter using the optimized javascript engine, javascript, typescript, vue, with light and dark themes, you can run the following command:\n\n```bash\nnpx shiki-codegen --langs javascript,typescript,vue --themes light,dark --engine javascript --precompiled ./shiki.bundle.ts\n```\n\nThis will generate a `shiki.bundle.ts` file that you can use to create a syntax highlighter for your editor.\n\nLike this:\n\n```ts\nimport { createHighlighter } from \"./shiki.bundle\";\n\nexport default function App() {\n // Creates a new editor instance.\n const editor = useCreateBlockNote({\n codeBlock: {\n indentLineWithTab: true,\n defaultLanguage: \"typescript\",\n supportedLanguages: {\n typescript: {\n name: \"TypeScript\",\n aliases: [\"ts\"],\n },\n },\n createHighlighter: () =>\n createHighlighter({\n themes: [\"light-plus\", \"dark-plus\"],\n langs: [],\n }),\n },\n });\n\n return <BlockNoteView editor={editor} />;\n}\n```\n\n**Relevant Docs:**\n\n- [Code Blocs](/docs/features/blocks/code-blocks)\n- [shiki-codegen](https://shiki.style/packages/codegen)"
906+
"readme": "To configure a code block highlighting theme and language, you can use the `codeBlock` option in the `useCreateBlockNote` hook.\n\nThis allows you to configure a shiki highlighter for the code blocks of your editor, allowing you to tailor the themes and languages you would like to use.\n\nTo create a syntax highlighter, you can use the [shiki-codegen](https://shiki.style/packages/codegen) CLI for generating the code to create a syntax highlighter for your languages and themes.\n\nFor example to create a syntax highlighter using the optimized javascript engine, javascript, typescript, vue, with light and dark themes, you can run the following command:\n\n```bash\nnpx shiki-codegen --langs javascript,typescript,vue --themes light,dark --engine javascript --precompiled ./shiki.bundle.ts\n```\n\nThis will generate a `shiki.bundle.ts` file that you can use to create a syntax highlighter for your editor.\n\nLike this:\n\n```ts\nimport { createHighlighter } from \"./shiki.bundle\";\n\nexport default function App() {\n // Creates a new editor instance.\n const editor = useCreateBlockNote({\n codeBlock: {\n indentLineWithTab: true,\n defaultLanguage: \"typescript\",\n supportedLanguages: {\n typescript: {\n name: \"TypeScript\",\n aliases: [\"ts\"],\n },\n },\n createHighlighter: () =>\n createHighlighter({\n themes: [\"light-plus\", \"dark-plus\"],\n langs: [],\n }),\n },\n });\n\n return <BlockNoteView editor={editor} />;\n}\n```\n\n**Relevant Docs:**\n\n- [Code Blocks](/docs/features/blocks/code-blocks)\n- [shiki-codegen](https://shiki.style/packages/codegen)"
907907
}
908908
]
909909
},

0 commit comments

Comments
 (0)