@jmarioste/codebox
v0.0.2
Published
Code highlighting tool for Editor.js using prismjs and tailwindcss for styling
Maintainers
Readme
Editor.js Codebox
Features
- Code syntax highlighting for multiple programming languages.
- Language selection dropdown.
- Clipboard functionality to copy code snippets.
- Responsive and user-friendly UI.
Installation
To install the library, use npm:
npm install editorjs-plugin-libraryUsage
To use the CodeBox plugin in your Editor.js instance, follow these steps:
- Import the CodeBox class from the library:
import CodeBox from "@jmarioste/codebox";- Add the CodeBox to your Editor.js configuration:
const editor = new EditorJS({
tools: {
codebox: CodeBox,
},
});- Customize the CodeBox as needed by passing data to it:
const codeData = {
code: 'console.log("Hello, World!");',
language: "javascript",
theme: "dark",
};
editor.blocks.insert("codebox", codeData);Building
To build the library, run:
npm run buildTesting
To run tests, use:
npm run testLicense
This project is licensed under the MIT License. See the LICENSE file for more details.
