kmonadx-playground
is a simple web interface for the kmonadx transpiler, allowing users to try it out without installing the binary.
Briefly, kmonadx
compiles a custom TOML-like configuration language, kbdx
, into kmonad
's native kbd
format.
This custom language is designed to be more ergonomic than kbd
, and to provide powerful features like layer inheritance which make experimentation with keyboard setups much easier.
For more information about kmonadx
and the kbdx
language, see the README.
kmonadx-playground
runs kmonadx
directly in the browser by interfacing with a thin wrapper around the underlying Rust crate, compiled to WebAssembly.
Fun fact: diagnostics are rendered by essentially capturing the kmonadx
CLI's output, decoding the ANSI escape codes into equivalently styled HTML using the ansi-up JavaScript library, and directly displaying this HTML in a pane with a monospace font.
To build kmonadx-playground
, follow these steps:
-
Clone the repository:
git clone https://github.com/srithon/kmonadx-playground.git cd kmonadx-playground
-
Install Rust and wasm-pack:
curl https://sh.rustup.rs -sSf | sh cargo install wasm-pack
-
Build the Rust WASM package:
cd kmonadx-wasm wasm-pack build cd ..
-
Install dependencies:; this assumes that
pnpm
is installed.pnpm install
-
Build the website:
pnpm run build
-
Serve the website locally:
pnpm run dev
The project includes a GitHub Actions workflow to automate the build and deployment process, defined in .github/workflows/deploy.yml
.
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.