0.0.1 • Published 3 years ago

markdown-it-plugin-echarts v0.0.1

Weekly downloads
8
License
MIT
Repository
github
Last release
3 years ago

markdown-it-echarts

Actions Status Actions Status

How to add Echarts support to Markdown-It

Use markdown-it-echarts as a regular plugin.

npm install markdown-it markdown-it-plantuml-online

Configure the markdown-it instance:

// node.js, "classic" way:
var echarts = require('markdown-it-plugin-echarts');
var MarkdownIt = require('markdown-it'),
    md = new MarkdownIt();
    md.use(echarts);   // md.use(plantuml, {..})   with options
var result = md.render(aMarkdownDocument);

Document including an echart graphic options in json or yaml format, like this:

xAxis:
  type: category
  data:
    - Mon
    - Tue
    - Wed
    - Thu
    - Fri
    - Sat
    - Sun
yAxis:
  type: value
series:
  - data:
      - 120
      - 200
      - 150
      - 80
      - 70
      - 110
      - 130
    type: bar
    showBackground: true
    backgroundStyle:
      color: 'rgba(180, 180, 180, 0.2)'

Code based on: https://github.com/christianvoigt/argdown/tree/master/packages/argdown-markdown-it-plugin