Rust

QTML is compiled as part of your Rust application. Templates are checked when you run cargo check, cargo test, or cargo build, and the render_qtml! macro generates the HTML renderer.

Install Rust

Install the stable Rust toolchain with rustup. Once installed, confirm that Cargo is available:

cargo --version

Add QTML

Add the qtml_macro crate to your application's Cargo.toml:

[dependencies]
qtml_macro = "0.1"

Then render a template from Rust with render_qtml!:

use qtml_macro::render_qtml;

let html = render_qtml!("ui/page.qtml");

Install the language server

The QTML language server provides diagnostics, completion, and formatting for .qtml files. Install it with Cargo:

cargo install qtml_lsp

Your editor must be able to find qtml_lsp on PATH. Restart the editor after installing it if it was already open.