move karax source code from 'src' to 'karax'; make karaxdsl work with native Nim; added jjson and jwebsockets modules

This commit is contained in:
Andreas Rumpf 2017-10-02 22:54:25 +02:00
commit 8e8ada7cd2
34 changed files with 407 additions and 203 deletions

View file

@ -1,4 +1,4 @@
include karaxprelude
include ../karax/prelude
block:
type

View file

@ -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
View 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

View file

@ -1 +1 @@
--path: "../src"
--path: "../karax"

View file

@ -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()