@docus/remark-mdc-edge
v0.1.0-27540675.3108772
Published
Remark plugin to support MDC syntax
Downloads
139
Readme
remark-mdc
remark plugin to support MDC Syntax
Install
# Using Yarn
yarn add --dev @docus/remark-mdc
# Using NPM
npm install --save-dev @docus/remark-mdc
Use
import { unified, Preset } from 'unified';
import parse from 'remark-parse'
import remarkMDC from '@docus/remark-mdc'
function compiler() {
this.Compiler = function(root) {
return root
}
}
export async function markdownToAST(markdown) {
let stream = unified()
.use(parse)
.use(remarkMDC)
.use(compiler)
const file = await stream.process(markdown)
return file.result
}