You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import html_dsl
const page = html:
heads:
title "Title"
meta(name="foo", content="bar")
bodys:
p "Powered by Nim Metaprogramming"
`<!--` "HTML Comment"
a(text="Nim", href="https://nim-lang.org")
divs:
p "Example"
assert page isstring
echo page
Click to see Output
Build for Development:
<!DOCTYPE html><htmlclass='has-navbar-fixed-top'><head><metacharset="utf-8"><metaname="viewport" content="width=device-width,initial-scale=1"><metaname="foo" content="bar" ><title>Title</title></head><bodyclass='has-navbar-fixed-top'><p> Powered by Nim Metaprogramming</p><!-- HTML Comment --><ahref="https://nim-lang.org" > Nim</a><div><p> Example</p><p> Example</p></div></body></html>
Build for Release:
<!DOCTYPE html><htmlclass='has-navbar-fixed-top'><head><metacharset="utf-8"><metaname="viewport" content="width=device-width,initial-scale=1"><metaname="foo" content="bar" ><title>Title</title></head><bodyclass='has-navbar-fixed-top'><p>Powered by Nim Metaprogramming</p><ahref="https://nim-lang.org" >Nim</a><div><p>Example</p><p>Example</p></div></body></html>
Design
1 file, ~300 Lines of Code, as fast as const, 42 Kilobytes Hello World file size.