@juexro/markdown-it-highlight-code-block

1.0.1 • Public • Published

markdown-it-highlight-code-block

rewrite default_rules.code_block for markdown-it in nodejs.

install

yarn add markdown-it-highlight-code-block -D

usage

const fs = require('fs')
let fileContent = fs.readFileSync('markdown.md', 'utf8')
const style = fs.readFileSync('node_modules/highlight.js/styles/github.css')

const MarkdownIt = require('markdown-it')
const CodeBlockPlugin = require('@juexro/markdown-it-highlight-code-block')
const md = new MarkdownIt().use(CodeBlockPlugin)

fs.writeFileSync('markdown.html', `<style>${style}</style>` + md.render(fileContent))

Package Sidebar

Install

npm i @juexro/markdown-it-highlight-code-block

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

2.98 kB

Total Files

4

Last publish

Collaborators

  • juexro