Skip to content

srithon/kmonadx-playground

Repository files navigation

kmonadx-playground

Try it Out!

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.

Building the Project

To build kmonadx-playground, follow these steps:

  1. Clone the repository:

    git clone https://github.com/srithon/kmonadx-playground.git
    cd kmonadx-playground
  2. Install Rust and wasm-pack:

    curl https://sh.rustup.rs -sSf | sh
    cargo install wasm-pack
  3. Build the Rust WASM package:

    cd kmonadx-wasm
    wasm-pack build
    cd ..
  4. Install dependencies:; this assumes that pnpm is installed.

    pnpm install
  5. Build the website:

    pnpm run build
  6. Serve the website locally:

    pnpm run dev

GitHub Actions Workflow

The project includes a GitHub Actions workflow to automate the build and deployment process, defined in .github/workflows/deploy.yml.

Contributing

Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.