remark-kbd-simple

1.0.1 • Public • Published

remark-kbd-simple

Syntax

Press [[ctrl]] + [[c]]!

AST (see mdast specification)

For example, the following markdown:

[[ctrl]]

Yields:

{
    type: 'kbd',
    data: {
        hName: 'kbd',
    },
    children: [{
        type: 'text',
        value: 'ctrl'
    }]
}

Rehype

This plugin is compatible with [rehype][https://github.com/rehypejs/rehype]. kbd mdast nodes (e.g. [[ctrl]]) will become <kbd>ctrl</kbd>.

Installation

yarn add remark-kbd-simple

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-simple')

Usage:

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

Readme

Keywords

none

Package Sidebar

Install

npm i remark-kbd-simple

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

2.6 kB

Total Files

3

Last publish

Collaborators

  • lebalz