JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2228
  • Score
    100M100P100Q129354F
  • License MIT

mdast extension for definition list

Package Exports

  • mdast-util-definition-list
  • mdast-util-definition-list/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mdast-util-definition-list) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

mdast-util-definition-list

Node.js CI

mdast extension for definition list

Feature

This package provides mdast utilities to handle definition list with micromark-extension-definition-list.

This includes:

Install

From npm:

$ npm install mdast-util-definition-list

Use

import {
  defListFromMarkdown,
  defListToMarkdown,
  defListHastHandlers,
} from 'mdast-util-definition-list';
import { defList } from 'micromark-extension-definition-list';

import { fromMarkdown } from 'mdast-util-from-markdown';
import { toMarkdown } from 'mdast-util-to-markdown';
import { toHast } from 'mdast-util-to-hast';

const md = `
Apple
:   Pomaceous fruit of plants of the genus Malus in
    the family Rosaceae.

Orange
:   The fruit of an evergreen tree of the genus Citrus.
`;

const mdast = fromMarkdown(md, {
  extensions: [defList],
  mdastExtensions: [defListFromMarkdown],
});
console.log(mdast);

const markdown = toMarkdown(mdast, {
    extensions: [defListToMarkdown],
});
console.log(markdown);


const hast = toHast(mdast, {
  handlers: defListHastHandlers,
});
console.log(hast);