Skip to content
UniKit

HTML to SWS template

Turn `{{var}}` and data-bind markers into SWS (Simple Web Server) template syntax: `{sws:html(var)}` by default for escaped HTML output, or `{sws:var}` when escaping is off. Only expression output is converted; `{sws:if ...}` / `{sws:loop ...}` control flow stays.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

HTML template

Result

The result can be copied directly.

Paste HTML to see the SWS template

Characters: 0 · Lines: 0 · Interpolations: 0 · data-bind bindings: 0

What this tool does

  • Turn a static HTML mock-up into a server template without retyping variables.
  • Audit which `{{variables}}` get escaped and which are emitted raw.
  • Make data-bind relationships explicit in the target template syntax.

Example

Input

<p>{{title}}</p>

Output

<p>{sws:html(title)}</p>

Defaults to `{sws:html(var)}` for escaped output; uncheck to emit `{sws:var}`.

Frequently asked questions

Is control flow converted too?

No. Only expression output is rewritten; loops and conditions already written in the template are kept as-is and never generated for you.

What about `{{a + b}}`?

It is not a valid identifier path (letters, digits, dots, indexes), so it is left in the output and not recorded in statements.

What does the escape switch do?

On emits an escaped form such as `{sws:html(title)}`, off emits `{sws:title}`; both only touch echo positions.

Does it validate template syntax?

No. The output is a text rewrite; correctness has to be verified in the target runtime or template engine.

Keywords:html2swssimple web serverdeveloper

Related tools