rust-maud

Write compile-time checked HTML templates in Rust with Maud's html! macro.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/bugabinga/pi-ext --skill rust-maud
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-maud
Source: https://github.com/bugabinga/pi-ext/tree/main/skills/rust-maud
Command: npx skills add https://github.com/bugabinga/pi-ext --skill rust-maud

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building HTML in Rust often leads to runtime template errors, awkward escaping, and fragile string concatenation, especially as pages grow and components proliferate.

Core Features & Use Cases

  • Compile-time verified markup: Use Maud’s html! macro so template structure is checked at build time rather than failing at runtime.
  • Safe escaping with escape control: Rely on automatic escaping and selectively disable it via PreEscaped when inserting trusted HTML.
  • Reusable component patterns: Compose pages from functions and implement Render for domain types to keep view logic maintainable.
  • Framework-friendly output: Return Markup from Actix, Rocket, or Axum handlers to integrate templating into real web services.

Quick Start

Use the rust-maud skill to write a Maud html! template that renders an h1 element greeting the provided name.

Frequently Asked Questions about rust-maud

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate HTML in Rust without runtime template errors?

Use Maud's html! macro for compile-time HTML generation in Rust to validate template structure at build time. This prevents runtime template mistakes by checking element syntax and control flow during compilation rather than failing in production.

How does compile-time HTML templating handle escaping and trusted raw HTML?

Compile-time HTML templating in Rust applies automatic escaping to dynamic values to prevent injection. Insert trusted raw HTML by wrapping it with PreEscaped to selectively disable the default escaping behavior.

Can I use Maud HTML templates with Axum, Actix-web, or Rocket?

Yes, Maud integrates with Axum, Actix-web, and Rocket by returning Markup from web handlers. This framework-friendly output renders server-side HTML directly within your existing Rust web service route handlers.

What is the best way to compose reusable HTML components in Rust?

The best way to compose reusable HTML components in Rust is using Maud partials via functions and implementing the Render trait for domain types. This pattern keeps view logic maintainable as pages and components proliferate.

Why does my Rust HTML string concatenation break when pages grow complex?

Rust HTML string concatenation breaks because it lacks structural validation and safe escaping. Maud's html! macro moves template validation to compile time, preventing the fragile errors and awkward escaping inherent in manual string building.