markdown-it-code-section
v0.1.7
Published
Code plugin for markdown-it
Downloads
5
Maintainers
Readme
markdown-it-code-section
Code plugin for markdown-it
Install
npm install markdown-it-code-section
Usage
import markdownIt from 'markdown-it';
import mdCodeSection from 'markdown-it-code-section';
import 'markdown-it-code-section/dist/styles.css';
import 'prismjs/themes/prism-dark.min.css';
const md = markdownIt();
md.use(mdCodeSection);
// language
mdCodeSection.setLanguage({
copy: '复制',
copied: '已复制!'
})
const html = md.render(/* ... */);
Load custom languages
See prismjs
import loadLanguages from 'prismjs/components/index';
loadLanguages([
'c',
'objectivec',
'xml',
]);
Style
import 'markdown-it-code-section/dist/styles.css';
import 'prismjs/themes/prism-dark.min.css'
If you wish to override titlebar & background styles
:root {
--md-code-section-text: #c9d1d9;
--md-code-section-bg: #0d1117;
--md-code-section-title: #c9d1d9;
}
License
See LICENSE