npm.io
1.6.6 • Published 13h ago

@hpcc-js/markdown-it-plugins

Licence
Apache-2.0
Version
1.6.6
Deps
5
Size
183 kB
Vulns
0
Weekly
0
Stars
103

@hpcc-js/markdown-it-plugins

Collection of plugins and extensions for markdown-it and VitePress.

Quick Start

Simple example of using the exec directive to execute ObservableHQ style JavaScript code in markdown:

  1. Install with your package manager of choice:
npm install --save @hpcc-js/markdown-it-plugins
  1. Initialise markdown-it as normal and use the observable plugin:
import markdownit from "markdown-it";
import { observable } from "@hpcc-js/markdown-it-plugins";

const md = markdownit({
    html: true,
    linkify: true,
    typographer: true
});

const md = markdownit();
md.use(observable);

const html = md.render(`\
# Hello World - I am ${age} years old!

\`\`\`js exec
age = 20 + 1;
\`\`\`
`);

Which will produce: Hello World - I am 21 years old!

Documentation