rt
@code-blocks/rehype-transform
npm i @code-blocks/rehype-transform
rt

@code-blocks/rehype-transform

Use markdown code blocks to render: charts, graphviz diagrams, MathML, music sheets, HTML tables and highlight code.

by Anders

0.1.10 (see all)License:GPLv2TypeScript:Not Found
npm i @code-blocks/rehype-transform
Readme

@code-blocks/rehype-transform

A rehype transform to render code blocks

Usage

Install the transform:

npm install @code-blocks/rehype-transform --save

Install the renderers you need, for example:

npm install @code-blocks/charts --save

An use it:

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

// the rehype transform
const codeblocks = require('@code-blocks/rehype-transform')

// some renderers
const charts = require('@code-blocks/charts')
const graphviz = require('@code-blocks/graphviz')

const processor = unified()
  .use(markdown)
  .use(remark2rehype)
  // add the transform and the renderers in an array as options
  .use(codeblocks, [charts, graphviz])
  .use(html)

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

Available renderers:

Downloads/wk

2

GitHub Stars

10

LAST COMMIT

1yr ago

MAINTAINERS

1

CONTRIBUTORS

2

OPEN ISSUES

0

OPEN PRs

5
VersionTagPublished
0.1.10
latest
1yr ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate