Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/planety/kview
For karax html preview written in Nim.
https://github.com/planety/kview
jester karax nim prologue web
Last synced: 3 days ago
JSON representation
For karax html preview written in Nim.
- Host: GitHub
- URL: https://github.com/planety/kview
- Owner: planety
- License: bsd-3-clause
- Created: 2020-02-09T07:36:19.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-23T02:00:01.000Z (over 4 years ago)
- Last Synced: 2024-11-10T22:35:45.165Z (8 days ago)
- Topics: jester, karax, nim, prologue, web
- Language: Nim
- Homepage:
- Size: 13.7 KB
- Stars: 9
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Test Prologue](https://github.com/planety/kview/workflows/Test%20Prologue/badge.svg)
# kview
### Installation
```text
nimble install kview
```For karax html preview written in Nim.
```nim
# app.nim
import os, strutilsfrom kview import writeExample
import karax / [karaxdsl, vdom]const
places = @["boston", "cleveland", "los angeles", "new orleans"]
first = "first"
second = "second"# will write app_login.html
proc login*(name: string): string {.writeExample.} =
let vnode = buildHtml(tdiv(class = "mt-3")):
h1: text "My Web Page"
p: text "Hello " & name
ul:
for place in places:
li: text place
dl:
dt: text "Can I use Karax for client side single page apps?"
dd: text "Yes"dt: text "Can I use Karax for server side HTML rendering?"
dd: text "Yes"
result = $vnodediscard login(first)
discard login(second)assert readFile("app_login.html").strip() == """
My Web Page
Hello first
- boston
- cleveland
- los angeles
- new orleans
- Can I use Karax for client side single page apps?
- Yes
- Can I use Karax for server side HTML rendering?
- Yes
""".strip()
```more examples in [tests](https://github.com/planety/kview/blob/master/tests/test.nim).