marcoroth/herb

🌿 A modern templating language for the HTML+ERB you already have.

TypeScript

1,328

2,297 commits

updated Oct 10, 2026

See the code

README

Herb HTML+ERB Toolchain

Herb

A modern templating language for the HTML+ERB you already have.

One language and toolchain that understands your HTML and Ruby together.

Lint · Format · Analyze · Render · Tooling

Gem Version Crates.io Version npm Version VS Code Marketplace Open VSX Documentation playground pkg.pr.new License Issues


Herb is a modern templating language for the HTML+ERB you already have.

Your .html.erb files are already HTML+ERB. Herb reads the HTML and the Ruby in them as one document, so it can tell you about an unclosed tag, a mismatched element or a missing %> with the file, the line and what to change, before the page renders. The same understanding drives a linter, a formatter, a language server for your editor and Herb::Engine, which renders your templates the way Erubi does and escapes each value for where it sits.

With the Rails 8.2 framework defaults, Rails renders HTML templates with Herb::Engine. ReActionView makes those templates reactive, and brings the error overlays, the dev tools and per-tag instrumentation to the page.

Documentation

herb-tools.dev

Installation

Check your templates without adding anything to your project:

gem exec herb analyze

Add the gem:

bundle add herb

Run the linter and the formatter:

npx @herb-tools/linter
npx @herb-tools/formatter

Installation covers editors, CI and installing from a Git branch.

Ecosystem

Tools

ProjectDescription
Herb LinterFinds mistakes and enforces conventions in HTML+ERB templates.
Herb FormatterFormats HTML+ERB templates consistently. (experimental)
Herb Language ServerDiagnostics, hovers and formatting in VS Code, Zed, Neovim and other editors.
Herb Dev ServerWatches your templates and patches the open page as you save. (experimental)
Herb Dev ToolsIn-browser tools for inspecting and debugging rendered templates.

Rendering

ProjectDescription
Herb::EngineHTML-aware ERB rendering engine, API-compatible with Erubi.
Herb Client RuntimeUpdates the parts of a rendered page that changed, in place. (experimental)
ReActionViewReactive templates, error overlays and dev tools for Rails.

Building on Herb

The Herb Parser is a fast, portable, HTML-aware ERB parser written in C, with bindings for Ruby, JavaScript, Java, Rust and WebAssembly. The Projects page lists it together with the libraries for building your own tools on the Herb syntax tree.

Contributing

Bug reports and pull requests are welcome on GitHub. CONTRIBUTING.md explains how to set up Herb for local development.

License

This project is available as open source under the terms of the MIT License.

engine
erb
hacktoberfest
html
parser
ruby
views

marcoroth/herb

🌿 A modern templating language for the HTML+ERB you already have.

TypeScript

1,328

2,297 commits

updated Oct 10, 2026

See the code

README

Herb HTML+ERB Toolchain

Herb

A modern templating language for the HTML+ERB you already have.

One language and toolchain that understands your HTML and Ruby together.

Lint · Format · Analyze · Render · Tooling

Gem Version Crates.io Version npm Version VS Code Marketplace Open VSX Documentation playground pkg.pr.new License Issues


Herb is a modern templating language for the HTML+ERB you already have.

Your .html.erb files are already HTML+ERB. Herb reads the HTML and the Ruby in them as one document, so it can tell you about an unclosed tag, a mismatched element or a missing %> with the file, the line and what to change, before the page renders. The same understanding drives a linter, a formatter, a language server for your editor and Herb::Engine, which renders your templates the way Erubi does and escapes each value for where it sits.

With the Rails 8.2 framework defaults, Rails renders HTML templates with Herb::Engine. ReActionView makes those templates reactive, and brings the error overlays, the dev tools and per-tag instrumentation to the page.

Documentation

herb-tools.dev

Installation

Check your templates without adding anything to your project:

gem exec herb analyze

Add the gem:

bundle add herb

Run the linter and the formatter:

npx @herb-tools/linter
npx @herb-tools/formatter

Installation covers editors, CI and installing from a Git branch.

Ecosystem

Tools

ProjectDescription
Herb LinterFinds mistakes and enforces conventions in HTML+ERB templates.
Herb FormatterFormats HTML+ERB templates consistently. (experimental)
Herb Language ServerDiagnostics, hovers and formatting in VS Code, Zed, Neovim and other editors.
Herb Dev ServerWatches your templates and patches the open page as you save. (experimental)
Herb Dev ToolsIn-browser tools for inspecting and debugging rendered templates.

Rendering

ProjectDescription
Herb::EngineHTML-aware ERB rendering engine, API-compatible with Erubi.
Herb Client RuntimeUpdates the parts of a rendered page that changed, in place. (experimental)
ReActionViewReactive templates, error overlays and dev tools for Rails.

Building on Herb

The Herb Parser is a fast, portable, HTML-aware ERB parser written in C, with bindings for Ruby, JavaScript, Java, Rust and WebAssembly. The Projects page lists it together with the libraries for building your own tools on the Herb syntax tree.

Contributing

Bug reports and pull requests are welcome on GitHub. CONTRIBUTING.md explains how to set up Herb for local development.

License

This project is available as open source under the terms of the MIT License.

engine
erb
hacktoberfest
html
parser
ruby
views

Project health

RubyGems

Latest release

0.11.0 · Sep 24, 2026

Releases this year

24

Significant stargazers

(top 24 of 58)

Benoit Daloze

492 followers · starred Dec 2025

Hiroshi SHIBATA

1,672 followers · starred Apr 2025

Connor Shea

154 followers · starred Nov 2025

Alexandre ZANNI

2,400 followers · starred Oct 2025