@humanwhocodes/markdown-it-markua-aside
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Markua Aside Plugin for markdown-it

by Nicholas C. Zakas

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

Install using npm or yarn:

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

  1. Fork the repository
  2. Clone your fork
  3. Run npm install to setup dependencies
  4. Run npm test to run tests

License

Apache 2.0

/@humanwhocodes/markdown-it-markua-aside/

    Package Sidebar

    Install

    npm i @humanwhocodes/markdown-it-markua-aside

    Weekly Downloads

    4

    Version

    0.2.0

    License

    Apache-2.0

    Unpacked Size

    36.2 kB

    Total Files

    6

    Last publish

    Collaborators

    • nzakas