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`
Last updated 10 months ago by talone .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install remark-kbd 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.21                                ...           latest (10 months ago)

37 Versions

  • 1.0.21                                ...           10 months ago
  • 1.0.20                                ...           a year ago
  • 1.0.19                                ...           2 years ago
  • 1.0.18                                ...           2 years ago
  • 1.0.17                                ...           2 years ago
  • 1.0.16                                ...           2 years ago
  • 1.0.15                                ...           2 years ago
  • 1.0.14                                ...           2 years ago
  • 1.0.13                                ...           2 years ago
  • 1.0.12                                ...           3 years ago
  • 1.0.11                                ...           3 years ago
  • 1.0.10                                ...           3 years ago
  • 1.0.9                                ...           3 years ago
  • 1.0.8                                ...           3 years ago
  • 1.0.7                                ...           3 years ago
  • 1.0.6                                ...           3 years ago
  • 1.0.5                                ...           3 years ago
  • 1.0.4                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 0.0.20                                ...           3 years ago
  • 0.0.19                                ...           3 years ago
  • 0.0.18                                ...           3 years ago
  • 0.0.17                                ...           3 years ago
  • 0.0.16                                ...           3 years ago
  • 0.0.15                                ...           3 years ago
  • 0.0.14                                ...           3 years ago
  • 0.0.13                                ...           3 years ago
  • 0.0.12                                ...           3 years ago
  • 0.0.11                                ...           3 years ago
  • 0.0.10                                ...           3 years ago
  • 0.0.9                                ...           3 years ago
  • 0.0.8                                ...           3 years ago
  • 0.0.7                                ...           3 years ago
  • 0.0.6                                ...           3 years ago
  • 0.0.5                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 1
Last Month 4
Dependencies (1)
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |