0.1.7 • Published 1 year ago

markdown-it-code-section v0.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

0.1.2

1 year ago

0.1.7

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago