Skip to content

tylingsoft/markdown-it-chart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

markdown-it-chart

Chart.js plugin for markdown-it.

Installation

yarn install markdown-it-chart

Usage

import markdownIt from 'markdown-it'
import markdownItChart from 'markdown-it-chart'
const mdi = markdownIt()
mdi.use(markdownItChart)
mdi.render(`\`\`\`chart
{
  "type": "pie",
  "data": {
    "labels": [
      "Red",
      "Blue",
      "Yellow"
    ],
    "datasets": [
      {
        "data": [
          300,
          50,
          100
        ],
        "backgroundColor": [
          "#FF6384",
          "#36A2EB",
          "#FFCE56"
        ],
        "hoverBackgroundColor": [
          "#FF6384",
          "#36A2EB",
          "#FFCE56"
        ]
      }
    ]
  },
  "options": {}
}
\`\`\``)

Development

Build

yarn build:watch

Test

yarn test

Distribution

yarn release && npm publish

Todo

About

Chart.js plugin for markdown-it.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published