Markdown Code Group

logo

A markdown-it plugin to support convert markdown to html with code group style.

NPM Version NPM Downloads Minizip Contributors License

#Usage

npm
yarn
pnpm
bun
 npm install markdown-it-code-group --save-dev
bash
 yarn add markdown-it-code-group --dev
bash
 pnpm i -D markdown-it-code-group
bash
 bun install markdown-it-code-group --save-dev
bash

import MarkdownIt from 'markdown-it'
import MarkdownItCodeGroup from 'markdown-it-code-group'

const md = MarkdownIt()

md.use(MarkdownItCodeGroup, /* Options */)

const html = md.render(/* ... */)
js

#DOM Actions

import { markdownItCodeGroupDom } from 'markdown-it-code-group/dom'

markdownItCodeGroupDom()
ts

You might change code-group-colors-dark-media.css to code-group-colors-dark-class.css if you are using class-based (.dark) dark mode.

Refer to the source code for more details.

#License

MIT License © 2024-PRESENT Hung