1.1.0 • Published 3 years ago

remark-kbd v1.1.0

Weekly downloads
645
License
MIT
Repository
github
Last release
3 years ago

remark-kbd Build Status Coverage Status

This plugin parses custom Markdown syntax to handle keyboard keys. It adds a new node type to the mdast produced by remark: kbd

If you are using rehype, the stringified HTML result will be <kbd>.

Syntax

Hit ||enter|| twice to create a new paragraph.

AST (see mdast specification)

Kbd (Parent) represents a reference to a user.

interface Kbd <: Parent {
  type: "kbd";
}

For example, the following markdown:

||enter||

Yields:

{
  type: 'kbd',
  children: [{
    type: 'text',
    value: 'enter'
  }]
}

Rehype

This plugin is compatible with rehype. Kbd mdast nodes will become <kbd>contents</kbd>.

Installation

npm:

npm install remark-kbd

Usage

Dependencies:

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

const remarkKbd = require('remark-kbd')

Usage:

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

License

MIT © Zeste de Savoir

1.1.0

3 years ago

1.0.21

4 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

0.0.20

7 years ago

0.0.19

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago