https://github.com/byteface/nom
nom is a nim dom
https://github.com/byteface/nom
Last synced: 9 months ago
JSON representation
nom is a nim dom
- Host: GitHub
- URL: https://github.com/byteface/nom
- Owner: byteface
- License: mit
- Created: 2022-07-08T11:43:42.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-07-08T14:44:07.000Z (over 3 years ago)
- Last Synced: 2025-05-12T04:52:28.728Z (11 months ago)
- Language: Nim
- Size: 63.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nom: A Nim DOM
Nom is a Nim DOM!
# About
Trying nim for the first time. Created a small project to play around with it.
Nom lets you create html templates direclty in nim-lang.
```
echo html(body(Div(h1("Hello World!")), id="page", class="greeting"))
```
Use the $ to render the dom to a string. i.e.
```
var document = html(body(Div(h1("Hello World!")), id="page", class="greeting"))
resp = $document
```
# Setup
Looks like you install 'choosenim'
https://nim-lang.org/install_unix.html
Then run ```choosenim 1.6.0```
# Compiling
To compile the DOM do...
```
nimble build
```
# Running tests
To run these tests, execute...
```
nimble test
```
# Running examples
See examples folder.
tbc
# Installing
I think it will be something like...
```
nimble install https://github.com/byteface/nom
```
# Gotchas
The 'div' keyword in nim is already a binary division operator so our div requires an uppercase D not to clash. i.e. ```Div('some content')```
alternatively it appears you can wrap it backticks i.e. ```\`div\`('some test')```