Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/overflowcat/remark-samp-kbd

Add <samp>, <kbd> and <var> support to Markdown using remark
https://github.com/overflowcat/remark-samp-kbd

markdown plugin remark

Last synced: 16 days ago
JSON representation

Add <samp>, <kbd> and <var> support to Markdown using remark

Awesome Lists containing this project

README

        

# ``remark-samp-kbd``

`remark-samp-kbd` is a [remark](https://github.com/remarkjs/remark/) plugin
thats add semantic distinctions between
code fragments (``),
program outputs (``),
keyboard keys (``),
and variables (``)
by using different numbers of backticks.

## Features

- **Code Fragments ([``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/code)):** 4k+1 for inline code references.
- **Program Outputs ([``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/samp)):** 4k+2 backticks, suitable for displaying names, paths, URIs (if not made a link) and any program output.
- **Keyboard Keys ([``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/kbd)):** 4k+3 backticks to denote key strokes.
- **Mathematical Variables ([``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/var)):** 4k+4 for variables.

(Here, k is a non-negative integer.)

## Attribution

This plugin is inspired by [@GeeLaw](https://github.com/GeeLaw)'s [blog(post)](https://geelaw.blog/entries/meta-blog/#:~:text=Use%204k%2B1%20to%204k%2B4%20numbers%20of%20%60%20to%20represent%20different%20semantics).

> To remember this rule, remember that longer tag uses fewer backticks, and for the same length, the order is the lexicographical order.

## License

[WTFPL](./LICENSE).