# remark-kbd

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

Latest version **1.1.1** (published 2024-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install remark-kbd
pnpm add remark-kbd
yarn add remark-kbd
bun add remark-kbd
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2024-04-27 |
| First published | 2017-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Victor Felder |
| Maintainers | situphen, talone |
| Keywords | remark |

## Links

- npm: https://www.npmjs.com/package/remark-kbd
- Repository: https://github.com/zestedesavoir/zmarkdown.git#master
- Homepage: https://github.com/zestedesavoir/zmarkdown/tree/master#readme
- Issues: https://github.com/zestedesavoir/zmarkdown/issues
- npm.io page: https://npm.io/package/remark-kbd

## Dependencies (1)

- [is-whitespace-character](https://npm.io/package/is-whitespace-character.md) ^1.0.4

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.1.1 (latest) — 2024-04-27
- 1.1.0 — 2021-02-14
- 1.0.21 — 2020-02-03
- 1.0.20 — 2019-07-27
- 1.0.19 — 2019-04-14
- 1.0.18 — 2019-02-04
- 1.0.17 — 2018-11-23
- 1.0.16 — 2018-10-04
- 1.0.15 — 2018-08-09
- 1.0.14 — 2018-07-22
- 1.0.13 — 2018-07-20
- 1.0.12 — 2018-04-26
- 1.0.11 — 2018-04-20
- 1.0.10 — 2018-03-06
- 1.0.9 — 2018-01-20
- … 24 more at https://npm.io/package/remark-kbd/versions

## README

# remark-kbd [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status]

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

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

## Syntax

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

## AST (see [mdast][mdast] specification)

`Kbd` ([`Parent`][parent]) represents a reference to a user.

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

For example, the following markdown:

`||enter||`

Yields:

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

## Rehype

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

## Installation

[npm][npm]:

```bash
npm install remark-kbd
```

## Usage

Dependencies:

```javascript
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:

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

## License

[MIT][license] © [Zeste de Savoir][zds]

<!-- Definitions -->

[build-badge]: https://img.shields.io/travis/zestedesavoir/zmarkdown.svg

[build-status]: https://travis-ci.org/zestedesavoir/zmarkdown

[coverage-badge]: https://img.shields.io/coveralls/zestedesavoir/zmarkdown.svg

[coverage-status]: https://coveralls.io/github/zestedesavoir/zmarkdown

[license]: https://github.com/zestedesavoir/zmarkdown/blob/master/packages/remark-kbd/LICENSE-MIT

[zds]: https://zestedesavoir.com

[npm]: https://www.npmjs.com/package/remark-kbd

[mdast]: https://github.com/syntax-tree/mdast/blob/master/readme.md

[remark]: https://github.com/remarkjs/remark

[rehype]: https://github.com/rehypejs/rehype

[parent]: https://github.com/syntax-tree/unist#parent

---
_Source: https://npm.io/package/remark-kbd · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
