0.2.0 • Published 3 years ago
@humanwhocodes/markdown-it-markua-aside v0.2.0
Markua Aside Plugin for markdown-it
If you find this useful, please consider supporting my work with a donation.
Description
A markdown-it plugin to support Markua-style asides and blurbs, such as:
{aside}Something said to the side.{/aside}
{blurb}Something else you should know.{/blurb}
{blurb, class: warning}
Don't do this!
{/blurb}
A> Something said to the site.
B> Something else you should know.
Prerequisites
- Node.js 12.22+
Usage
npm install @humanwhocodes/markdown-it-markua-aside --save
# or
yarn add @humanwhocodes/markdown-it-markua-aside
Import into your project:
// CommonJS
const { asidePlugin } = require("@humanwhocodes/markdown-it-markua-aside");
// ESM
import { asidePlugin } from "@humanwhocodes/markdown-it-markua-aside";
API
After importing, create a new instance of DataExtractor
. The constructor expects one object argument that defines the data schema.
For example:
import MarkdownIt from "markdown-it";
import { asidePlugin } from "@humanwhocodes/markdown-it-markua-aside";
// create a new instance
const md = new MarkdownIt();
// install the plugin
md.use(asidePlugin);
// render your text
const result = md.render("{aside}Hello world!{/aside}");
Developer Setup
- Fork the repository
- Clone your fork
- Run
npm install
to setup dependencies - Run
npm test
to run tests
License
Apache 2.0