marked-prism-code-editor
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Marked extension to create code editors and highlight code blocks using prism code editor.

Bundle size NPM package

Installation

This extension has prism-code-editor version 4.0.0 or greater as a peer dependency

npm i prism-code-editor marked-prism-code-editor

Basic usage

import { marked } from "marked"
import { markedPrismCodeEditor } from "marked-prism-code-editor"
import "prism-code-editor/prism/languages/common"

marked.use(markedPrismCodeEditor({
  // Configuration options
}))

marked.parse(/* Some markdown */)

Documentation

For more examples and a detailed description of the included features, check the documentation website.

Demo

There's a demo page where you can write markdown and view the resulting editors and code blocks.

Development

To run the development server locally, install dependencies.

pnpm install

Next, you must build the prism-code-editor package.

cd ../package
pnpm install
pnpm build

Finally, you can run the development server to test your changes.

cd ../marked-extension
pnpm dev

Package Sidebar

Install

npm i marked-prism-code-editor

Weekly Downloads

7

Version

0.1.0

License

MIT

Unpacked Size

17.4 kB

Total Files

9

Last publish

Collaborators

  • flamecaster