GitHub - ravenq/markdown-it-vue: The vue lib for markdown-it. (original) (raw)

markdown-it-vue

Build Status

The vue lib for markdown-it.

Demo online

http://www.aqcoder.com/markdown

Install

npm install markdown-it-vue

Running Demo

open http://localhost:8080/

Supports

Plugin list

internal plugin list:

Options

use options property to sepcial the options of markdow-it and markdown-it-plugins.

options: { markdownIt: { linkify: true }, linkAttributes: { attrs: { target: '_blank', rel: 'noopener' } } }

more markdown-it options see https://markdown-it.github.io/markdown-it/.

amd default plugins options:

{ linkAttributes: { attrs: { target: '_blank', rel: 'noopener' } }, katex: { throwOnError: false, errorColor: '#cc0000' }, icons: 'font-awesome', githubToc: { tocFirstLevel: 2, tocLastLevel: 3, tocClassName: 'toc', anchorLinkSymbol: '', anchorLinkSpace: false, anchorClassName: 'anchor', anchorLinkSymbolClassName: 'octicon octicon-link' }, mermaid: { theme: 'default' }, image: { hAlign: 'left', viewer: true } }

More plugins

it can add your plugin to markdown-it-vue by the use method.

this.$refs.myMarkdownItVue.use(MyMarkdownItPlugin)

support hilight lang

PR for you lang wich you want.

image size

![image size](https://http://www.aqcoder.com/ravenq-qr.png =50x50) ![image size](https://http://www.aqcoder.com/ravenq-qr.png =x50) ![image size](https://http://www.aqcoder.com/ravenq-qr.png =50x)

about echarts

use echarts.simple to reduce the bundle size.

markdown-it-vue-light

markdown-it-vue-light remove the mermaid chart to reduce the bundle size.

#24

for a small bundle size, it better to import the markdown-it-vue-light.

Usage

the light model.

ScreenShot

markdown-it-vue

License

MIT