Neoanthropic Preternatural Murmurings
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

remark-abbr

1.2.0 • Public • Published

remark-abbr Build Status Coverage Status

This remark plugin parses custom Markdown syntax to produce (HTML) abbreviations.

It introduces a new MDAST node type: "abbr".

interface abbr <: Node {
  type: "abbr";
  abbr: string;
  reference: string;
  data: {
    hName: "abbr";
    hProperties: {
      title: string;
    }
  }
}

Syntax

Abbreviations are defined a bit like footnotes:

This plugin works on MDAST, a Markdown AST
implemented by [remark](https://github.com/remarkjs/remark)
 
*[MDAST]: Markdown Abstract Syntax Tree.
*[AST]: Abstract syntax tree

This would compile to the following HTML:

<p>This plugin works on <abbr title="Markdown Abstract Syntax Tree.">MDAST</abbr>, a Markdown <abbr title="Abstract syntax tree">AST</abbr>
implemented by <a href="https://github.com/remarkjs/remark">remark</a></p>

Installation

npm:

npm install remark-abbr

Usage

Dependencies:

const unified = require('unified')
const remarkParse = require('remark-parse')
const remarkAbbr = require('remark-abbr')
const stringify = require('rehype-stringify')
const remark2rehype = require('remark-rehype')
 

Usage:

unified()
  .use(remarkParse)
  .use(remarkAbbr)
  .use(remark2rehype)
  .use(stringify)

License

MIT © Zeste de Savoir

Keywords

install

npm i remark-abbr

Downloadsweekly downloads

246

version

1.2.0

license

MIT

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability