Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 663 Bytes

README.md

File metadata and controls

36 lines (26 loc) · 663 Bytes

@dat/rehype-gnuplot

Rehype plugin to generate Gnuplot diagrams in place of code fences. This:

```gnuplot
plot [-10:10] sin(x)
```

will be converted to

<figure class="beoe gnuplot">
  <svg>...</svg>
</figure>

which looks like this:

example of how generated graph looks

Usage

import rehypeGnuplot from "@beoe/rehype-gnuplot";

const html = await unified()
  .use(remarkParse)
  .use(remarkRehype)
  .use(rehypeGnuplot)
  .use(rehypeStringify)
  .process(`markdown`);

Online documentation provides more details.