📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

@beoe/rehype-gnuplot

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beoe/rehype-gnuplot

rehype gnuplot plugin

0.0.1
Source
npm
Version published
Weekly downloads
211
115.31%
Maintainers
1
Weekly downloads
 
Created
Source

@dat/rehype-gnuplot

Rehype plugin to generate Gnuplot diagrams (as inline SVGs) 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`);

It support caching the same way as @beoe/rehype-code-hook does.

Tips

XKCD-style

You can create XKCD-style plots with this snippet. In order for it to work as SVG you need to changed following lines:

- set term postscript eps font 'HumorSans' fontfile 'Humor-Sans.pfa' 22
- set output 'xkcd.eps'
+ set terminal svg enhanced font "HumorSans,Patrick Hand,Chalkboard,Comic Sans MS,18"

You may use any font you like (don't forget to load it in HTML), for example:

Keywords

rehype

FAQs

Package last updated on 05 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts