Hello World!

This is the smallest useful QTML application: a Rust entry point, one template, and a Cargo manifest. render_qtml! compiles ui/page.qtml into the HTML string returned by main.

my-qtml-app/
├── Cargo.toml
├── src/
│   └── main.rs
└── ui/
    └── page.qtml

Cargo.toml

[package]
name = "my-qtml-app"
version = "0.1.0"
edition = "2024"

[dependencies]
qtml_macro = "0.1"

src/main.rs

use qtml_macro::render_qtml;

fn main() {
    println!("{}", render_qtml!("ui/page.qtml"));
}

ui/page.qtml

Page {
    Header1 { text: "Hello, world!" }
}

Run cargo run. QTML compiles the template during the build and prints a semantic <main> element containing the heading.