Skip to content

.zamnHTML without the <angle brackets>

A new, modern and fast way to write HTML with { } blocks instead of closing tags. Easy to read, quick to write, and with AI coding agent support for code generation.

zamn

Write this ​

zamn
nav.top {
  a(href=/) Home
  a(href=/docs :class={ active: onDocs }) Docs
  button(@click=toggleTheme)= themeLabel
}

Get this ​

html
<nav class="top">
  <a href="/">Home</a>
  <a href="/docs" :class="{ active: onDocs }">Docs</a>
  <button @click="toggleTheme">{{ themeLabel }}</button>
</nav>

With the advent of coding agents and a faster pace of development, I was thinking about a better format to replace HTML, without the issues other formats have (pug, for example). The main goal is to make it readable, so a human can quickly validate agent-generated code, and yet simple and explained for an agent to write and validate, with optimized token usage.

zamn compiles to plain HTML, so it works anywhere HTML does: a static page, an email template, or the <template> of a Vue component.

Read the introduction or try it in the playground.

Cheatsheet ​

WriteGet
div, button, .card, #appan element; without a tag it is implicitly a div
a.link#home(href=/) Homeclasses, ids and attributes follow the tag, text after a space
a(href="/" target=_blank)attributes; quote a value with spaces, commas or brackets
input(disabled checked=false)true or no value is a boolean attribute; false drops it
style={fontSize: 12px}style="font-size:12px;"
:class={ active: on }, @click="go()"bindings and events, as written; binded JS values like { ... } and [...] may omit quotes
ul { li One }children go in { }, the only way to nest
li: a(href=/) Homeone child on the same line
ul { li { b x } li { b y } }blocks on one line
| text, |a statement of text; a bare | is one space
|{ … }text over several lines, line breaks kept, useful with pre or when writing inline template
p Read #{a(href=/docs) the docs}.an element inside text
h1= title, h1 {{ title }}{{ title }} for your framework
\{, \}escape braces in text
script … /scriptraw content, not parsed or escaped; same for style
// note, /* … */comments, left out of the HTML
//! note, /*! … */HTML comments
doctype html<!DOCTYPE html>
zamn
article.post {
  h2.title= post.title
  p Read #{a(href=/docs) the docs} first.
  ul.tags {
    li(v-for="tag in post.tags" :key=tag)= tag
  }
  button(@click="like(post)" :disabled=busy) Like
}

Reminders ​

  • Text runs to the end of its line or to the } that closes its block: p { b bold i italic } is one b with text "bold i italic". Put the next child on a new line, or after the }: p { b { | bold } i italic }.
  • Indentation means nothing. Nest with { }, and let Prettier indent.
  • Quote a value containing spaces, commas or brackets: title="Page title", v-for="(item, i) in items".
  • Text is escaped: tags in text show as text. Write nested elements as #{b bold}.
  • Logic belongs to your framework: v-if, v-for, components.
  • Check with zamn --validate, then format with prettier --write.
  • Give your agent the skill or the rules.

Released under the MIT License.