1.1.1 • Published 1 year ago

remark-kbd v1.1.1

Weekly downloads
645
License
MIT
Repository
github
Last release
1 year 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.1

1 year ago

1.1.0

4 years ago

1.0.21

5 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

0.0.20

8 years ago

0.0.19

8 years ago

0.0.18

8 years ago

0.0.17

8 years ago

0.0.16

8 years ago

0.0.15

8 years ago

0.0.14

8 years ago

0.0.13

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago