Skip to content

Latest commit

 

History

History

rehype-gnuplot

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

@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.