bisheng-plugin-preview
v1.0.1
Published
Generate a preview for Markdown files in bisheng.
Downloads
2
Readme
bisheng-plugin-preview
Generate a preview for Markdown files in bisheng.
Usage
Install:
npm i --save bisheng-plugin-preview
Add 'bisheng-plugin-preview' to bisehng.config.js
's plugins.
module.exports = {
plugins: ['bisheng-plugin-preview'],
};
In Markdown of demo
directory:
In template:
const { preview, highlightedCode, highlightedStyle, style } = pageData;
// use preview
<div>
{preview(React, ReactDOM)}
</div>
// use highlightedCode
<div>
{props.utils.toReactComponent(highlightedCode)}
</div>
// use highlightedStyle
<pre>
<code dangerouslySetInnerHTML={{ __html: highlightedStyle }} />
</pre>
// use style
<style dangerouslySetInnerHTML={{ __html: style }} />
Liscense
MIT