Skip to main content
leaftext is a Rust application (edition 2021). Building from source requires the Rust toolchain and the just command runner.

Prerequisites

Before building leaftext, make sure the following are installed:
  • Rust (stable toolchain) — install via rustup. The project targets Rust 2021 edition as declared in Cargo.toml.
  • just command runner — install with cargo install just. leaftext uses a Justfile to orchestrate formatting, type-checking, testing, and releases.
  • Platform-specific WebView dependency:
    • Linux — WebKit2GTK development headers are required for wry, the embedded WebView library. See the note below for installation instructions.
    • macOS — WKWebView is provided by the OS; no extra headers are needed.
    • Windows — WebView2 is provided by the OS via the Microsoft Edge WebView2 Runtime; no extra headers are needed.
On Linux, install libwebkit2gtk-4.1-dev (or the equivalent package for your distribution) before building. The wry crate requires it for the WebView. On Debian/Ubuntu this is: sudo apt install libwebkit2gtk-4.1-dev. On Arch Linux the package is webkit2gtk-4.1.

Clone and build

Clone the repository and compile in debug mode:
git clone https://github.com/ryanallen/leaftext.git
cd leaftext
cargo build
The first build downloads and compiles all dependencies listed in Cargo.tomltao, wry, pulldown-cmark, syntect, rusqlite (bundled), and others. Subsequent builds are incremental.

Run

Launch the app directly from the source tree:
cargo run
This compiles (if needed) and starts leaftext. Open a Markdown file with Ctrl+O / Cmd+O.

Verification suite

Before submitting a contribution, run the full suite:
just verify
This runs cargo fmt --check, cargo check --all-targets, and cargo test in sequence. All three steps must pass. The verify recipe is defined in the project Justfile as:
verify: format-check check test
A passing just verify is the baseline requirement before handing any work back.

Individual tasks

Each step in the verification pipeline can also be run on its own:
TaskCommandWhat it does
Format checkcargo fmt --checkVerify code formatting without modifying files
Type checkcargo check --all-targetsCheck all targets without producing a binary
Testscargo testRun the full test suite
Full verifyjust verifyAll three steps above in sequence
Additional convenience tasks are available via just --list.