vue-marked-loader
Convert Markdown file to Vue Component using marked, support custom languages
Installation
npm i vue-marked-loader -D
Feature
- Hot reload
- Write vue script
- Code highlight
- support custom languages
Usage
webpack.config.js
file:
moduleexports = module: loaders: test: /\.md/ loader: 'vue-marked-loader' code2html: 'props' // support ```props { iflang == 'props' // ```props return your custom container return `<div class="json"><pre><code>// custom container \n</code></pre></div>` };
the full usage, please view example folder
attention
When the markdown file is compiled, make sure that script
, style
are just once included. You can check your compiled file in the folder node_modules/vue-marked-loader/.cache/
Thanks
- based on marked
- read and learn vue-markdown-loader
License
MIT