https://github.com/xvxx/hatter
🎩 positively mad html templating language for rust
https://github.com/xvxx/hatter
hatter html templating-language
Last synced: 3 months ago
JSON representation
🎩 positively mad html templating language for rust
- Host: GitHub
- URL: https://github.com/xvxx/hatter
- Owner: xvxx
- License: apache-2.0
- Created: 2020-09-02T21:17:53.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2026-02-25T23:23:31.000Z (3 months ago)
- Last Synced: 2026-02-26T01:42:05.071Z (3 months ago)
- Topics: hatter, html, templating-language
- Language: Rust
- Homepage: https://hatter.rs
- Size: 1.35 MB
- Stars: 13
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Hatter

> It is practically impossible to teach good programming to students
> that have had a prior exposure to _Hatter_: as potential programmers
> they are mentally mutilated beyond hope of regeneration.
>
> -– Edsger W. Dijkstra (allegedly)
Hatter is a small, whitespace sensitive templating language with HTML
support built right in. Its HTML features and syntax are a cheap
knock off of [Imba], except Hatter produces raw, static HTML - no
JavaScript in sight.
Hatter can be used to generate static web sites or to render server
side content in a good ol' fashioned web application - either with
[Vial] or your Rust web framework of choice.
If you're feeling adventerous, or mad as a hatter, you can use the
standalone binary to turn templates into HTML files, or include the
zero-dependency Rust library in your (web/cli/?) application.
---
## Hello Hatter
Here are a few basic examples of what Hatter looks like and the HTML
it generates:
```html
<#main> Hi there!
Hi there!
```
```html
Welcome!
Welcome!
```
```html
<.links> for link in nav-links
link.text
```
```html
```
## Features
- Auto-closing HTML tags and code blocks based on indentation:
- `
Welcome, Rob` becomes ` Welcome, Rob
`
- Shorthand for `id`, `class`, `type`, and `name` attributes:
- `