Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Rust
  3. horrorshow-rs

horrorshow-rs

Apache-2.0Rust

A macro-based HTML and XML templating library for Rust that works on stable Rust.

Visit WebsiteGitHubGitHub
352 stars19 forks0 contributors

What is horrorshow-rs?

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.

Target Audience

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.

Value Proposition

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.

Overview

A macro-based html builder for rust

Use Cases

Best For

  • Generating HTML in Rust web servers without external template engines
  • Building static site generators in Rust with embedded logic
  • Creating XML documents or feeds programmatically in Rust
  • Embedded systems or no-std environments that require HTML/XML generation
  • Projects that prioritize compile-time safety over runtime template parsing
  • Rust developers who prefer writing templates directly in Rust rather than separate files

Not Ideal For

  • Projects that require external HTML template files for separation of concerns or designer collaboration
  • Applications needing advanced templating features like inheritance, partials, or block-based layouts
  • Dynamic web apps that must load and render templates at runtime without recompilation
  • Teams preferring declarative, HTML-like syntax over embedded Rust code for templates

Pros & Cons

Pros

Type-Safe Macros

Leverages Rust's macro system for compile-time validation of HTML/XML structure, preventing runtime errors and ensuring template correctness.

Stable Rust Support

Works with stable Rust (rustc >= 1.48) without needing nightly features, making it accessible and production-ready.

No-Std Compatibility

Can be compiled without std or alloc features, enabling use in embedded systems and resource-constrained environments with graceful degradation.

Automatic XSS Protection

Defaults to escaping text content to prevent cross-site scripting, with Raw wrapper available for controlled unescaped output when necessary.

Cons

Limited Template Features

Lacks built-in support for advanced templating constructs like inheritance or reusable components, forcing manual management of common layouts.

Macro Syntax Verbosity

The macro-based approach can lead to verbose and less intuitive code compared to concise, dedicated template languages like Handlebars or Jinja.

Inconsistent Error Handling

Error reporting behavior varies based on compilation features (std, alloc, or core), complicating debugging across different environments.

Frequently Asked Questions

Quick Stats

Stars352
Forks19
Contributors0
Open Issues3
Last commit1 month ago
CreatedSince 2015

Tags

#html-templating#html-template#template-engine#rust-library#web-development#rust#no-std#macro-based

Built With

R
Rust

Links & Resources

Website

Included in

Rust56.6k
Auto-fetched 17 hours ago

Related Projects

teratera

A template engine for Rust based on Jinja2/Django

Stars4,265
Forks332
Last commit1 day ago
maudmaud

:pencil: Compile-time HTML templates for Rust

Stars2,609
Forks174
Last commit2 months ago
handlebars-rusthandlebars-rust

Rust templating with Handlebars

Stars1,476
Forks155
Last commit5 days ago
askamaaskama

A template rendering engine based on Jinja, generating type-safe Rust code at compile time.

Stars1,147
Forks58
Last commit3 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub