move karax source code from 'src' to 'karax'; make karaxdsl work with native Nim; added jjson and jwebsockets modules
This commit is contained in:
parent
bb1732c834
commit
8e8ada7cd2
34 changed files with 407 additions and 203 deletions
|
|
@ -1,4 +1,4 @@
|
|||
include karaxprelude
|
||||
include ../karax/prelude
|
||||
|
||||
block:
|
||||
type
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
include "../src/karax"
|
||||
import "../src/karaxdsl"
|
||||
include "../karax/karax"
|
||||
import "../karax/karaxdsl"
|
||||
|
||||
proc hasDom(n: Vnode) =
|
||||
if n.kind in {VNodeKind.component, VNodeKind.vthunk, VNodeKind.dthunk}:
|
||||
|
|
|
|||
20
tests/nativehtmlgen.nim
Normal file
20
tests/nativehtmlgen.nim
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
## Simple test that shows Karax can also do client-side HTML rendering.
|
||||
|
||||
import "../karax" / [karaxdsl, vdom]
|
||||
|
||||
when defined(js):
|
||||
{.error: "Use 'nim c' to compile this example".}
|
||||
|
||||
let tab = buildHtml(table):
|
||||
tr:
|
||||
td:
|
||||
text "Cell A"
|
||||
td:
|
||||
text "Cell B"
|
||||
tr:
|
||||
td:
|
||||
text "Cell C"
|
||||
td:
|
||||
text "Cell D"
|
||||
|
||||
echo tab
|
||||
|
|
@ -1 +1 @@
|
|||
--path: "../src"
|
||||
--path: "../karax"
|
||||
|
|
|
|||
|
|
@ -14,5 +14,6 @@ proc main =
|
|||
exec("nim js examples/mediaplayer/playerapp.nim")
|
||||
exec("nim js examples/carousel/carousel.nim")
|
||||
exec("nim js -d:nodejs -r tests/difftest.nim")
|
||||
exec("nim c tests/nativehtmlgen.nim")
|
||||
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue