marko.marko (1398B)
1 <!doctype html> 2 <!-- html mode: tags, attributes, embedded languages --> 3 import { formatPrice } from "./util" 4 static const VERSION = 1 5 6 <style/styles> 7 .price { color: green } 8 </style> 9 <let/count=1/> 10 <const/[width, , ...dims]=box/> 11 <div.card#main class="cart" total:=sum ...rest ...(a ? b : c)> 12 <if=tag === "select" || count > 0> 13 <my-button size="lg" onClick=(e) => buy(e)>${count + 1}</my-button> 14 </if> 15 <else-if=fallback ?? choices/> 16 <for|item, index| of=items> 17 <span>${formatPrice(item.price)}</span> 18 </for> 19 <generic-list<Config<string>> a=1/> 20 <${dynamicTag} title="dynamic">body</${dynamicTag}> 21 </div> 22 <link 23 rel="canonical" 24 href=translated 25 ? localizeUrl(url, { locale }).href 26 : baseHref 27 > 28 <audio-player ratio=total / count volume=Math.max( 29 0, 30 settings.findIndex((s) => s.active), 31 )/> 32 <h${size} id:scoped>heading</> 33 <${"hello"}-world/> 34 <badge#item-${id}.tone-${kind} café="façade" x=`a${`b ${c}`}d`/> 35 <form onSubmit<T>(e) { go<T>(e) } action(a, b) msg="say \"hi\""/> 36 <effect() { cleanup() }>body prose</effect> 37 <await(promise)> 38 <@then|result|>${result}</@then> 39 </await> 40 <macro renderPrice|amount|>${formatPrice(amount)}</macro> 41 <div 42 class="multiline" 43 data-x=1 44 >text with & entity and \${an escaped placeholder}</div> 45 <textarea rows=3>literal <b>text</b> with ${count}</textarea> 46 <script> 47 const el = document.querySelector(".price"); 48 </script>