0.0.2 • Published 4 years ago

@code-blocks/rehype-charts v0.0.2

Weekly downloads
-
License
GPLv2
Repository
github
Last release
4 years ago

@code-blocks/rehype-charts

A rehype transformer to add svg charts from code-blocks

Usage

try.js

const unified = require('unified')
const stream = require('unified-stream')
const markdown = require('remark-parse')
const remark2rehype = require('remark-rehype')
const html = require('rehype-stringify')
const charts = require('./index')

var processor = unified()
  .use(markdown)
  .use(remark2rehype)
  .use(charts)
  .use(html)

process.stdin.pipe(stream(processor)).pipe(process.stdout)

And run with:

node try < example.md > example.html

In your markdown, use codeblocks with one of the following languages:

  • area-chart
  • bar-chart
  • line-chart
  • multiline-chart
  • pie-chart
  • vega-lite
  • vega
  • vegalite

vega and vegalite are json objects.

The others are csv with options set as front-matter.

See the examples markdown and how they are rendered.

0.0.2

4 years ago

0.0.1

4 years ago

0.0.0

4 years ago