readme.rst: fixed a typo and made the snippet runnable
This commit is contained in:
parent
1bbd9c694e
commit
d08a0356d2
1 changed files with 3 additions and 1 deletions
|
|
@ -338,7 +338,7 @@ modules can be used since there is no JS interpreter.
|
||||||
const places = @["boston", "cleveland", "los angeles", "new orleans"]
|
const places = @["boston", "cleveland", "los angeles", "new orleans"]
|
||||||
|
|
||||||
proc render*(): string =
|
proc render*(): string =
|
||||||
let node = buildHtml(tdiv(class = "mt-3")):
|
let vnode = buildHtml(tdiv(class = "mt-3")):
|
||||||
h1: text "My Web Page"
|
h1: text "My Web Page"
|
||||||
p: text "Hello world"
|
p: text "Hello world"
|
||||||
ul:
|
ul:
|
||||||
|
|
@ -351,3 +351,5 @@ modules can be used since there is no JS interpreter.
|
||||||
dt: text "Can I use Karax for server side HTML rendering?"
|
dt: text "Can I use Karax for server side HTML rendering?"
|
||||||
dd: text "Yes"
|
dd: text "Yes"
|
||||||
result = $vnode
|
result = $vnode
|
||||||
|
|
||||||
|
echo render()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue