A macro-based HTML and XML templating library for Rust that works on stable Rust.
Horrorshow is a macro-based HTML and XML templating library for Rust. It allows developers to write markup templates directly in Rust code using a syntax that resembles HTML, with automatic escaping and embedded Rust logic. It solves the problem of generating safe, dynamic web content without relying on external template files or complex runtime engines.
Rust developers building web applications, static site generators, or XML-based services who want type-safe, compile-time checked templating integrated into their Rust codebase.
Developers choose Horrorshow because it provides a lightweight, zero-dependency templating solution that works on stable Rust, supports no-std environments, and ensures HTML safety through Rust's type system and automatic escaping.
A macro-based html builder for rust
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Leverages Rust's macro system for compile-time validation of HTML/XML structure, preventing runtime errors and ensuring template correctness.
Works with stable Rust (rustc >= 1.48) without needing nightly features, making it accessible and production-ready.
Can be compiled without std or alloc features, enabling use in embedded systems and resource-constrained environments with graceful degradation.
Defaults to escaping text content to prevent cross-site scripting, with Raw wrapper available for controlled unescaped output when necessary.
Lacks built-in support for advanced templating constructs like inheritance or reusable components, forcing manual management of common layouts.
The macro-based approach can lead to verbose and less intuitive code compared to concise, dedicated template languages like Handlebars or Jinja.
Error reporting behavior varies based on compilation features (std, alloc, or core), complicating debugging across different environments.