https://github.com/raineorshine/karabiner-config-to-markdown
Convert a Karabiner config to markdown.
https://github.com/raineorshine/karabiner-config-to-markdown
karabiner karabiner-elements
Last synced: 7 months ago
JSON representation
Convert a Karabiner config to markdown.
- Host: GitHub
- URL: https://github.com/raineorshine/karabiner-config-to-markdown
- Owner: raineorshine
- Created: 2020-07-21T19:15:23.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T16:34:22.000Z (almost 3 years ago)
- Last Synced: 2025-03-28T17:04:13.385Z (7 months ago)
- Topics: karabiner, karabiner-elements
- Language: JavaScript
- Homepage:
- Size: 77.1 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# karabiner-config-to-markdown
Convert a [Karabiner](https://karabiner-elements.pqrs.org) config to markdown. A simple way to publish your custom key bindings.
## Install
```sh
npm install -g karabiner-config-to-markdown
```## Usage
### CLI
```sh
# read ~/.config/karabiner/karabiner.json
karabiner-config-to-markdown# or pass path to config file
karabiner-config-to-markdown myconfig.json
```### Module
```js
const fs = require('fs')
const karabinerConfigToMarkdown = require('karabiner-config-to-markdown')
const config = fs.readFileSync('~/.config/karabiner/karabiner.json', 'utf-8')
console.log(karabinerConfigToMarkdown(config))
```## Example
### Input:
`~/.config/karabiner/karabiner.json`
```js
{
...
"rules": [
{
"description": "Backtick: Option + Quote",
"manipulators": [
{
"from": {
"key_code": "quote",
"modifiers": {
"mandatory": [
"left_option"
]
}
},
"to": [
{
"key_code": "grave_accent_and_tilde"
}
],
"type": "basic"
}
]
},
{
"description": "Launch apps: Right shift + letters",
"manipulators": [
{
"from": {
"key_code": "t",
"modifiers": {
"mandatory": [
"right_shift"
]
}
},
"to": [
{
"shell_command": "open '/Applications/Sublime Text.app'"
}
],
"type": "basic"
}
]
}
]
}
```### Output:
- Backtick: Option + Quote
- L-Option + `'` → `` ` ``
- Launch apps: Right shift + letters
- R-Shift + `t` → `open '/Applications/Sublime Text.app'`