https://github.com/juancarlospaco/nim-html-tools
HTML5 Tools for Nim, all Templates, No CSS, No Libs, No JS Framework
https://github.com/juancarlospaco/nim-html-tools
client-side client-side-validation frontend html5 nim nim-lang nim-language nimwc
Last synced: 2 months ago
JSON representation
HTML5 Tools for Nim, all Templates, No CSS, No Libs, No JS Framework
- Host: GitHub
- URL: https://github.com/juancarlospaco/nim-html-tools
- Owner: juancarlospaco
- License: mit
- Created: 2019-03-18T19:38:19.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-24T02:47:08.000Z (almost 6 years ago)
- Last Synced: 2025-01-26T14:48:41.197Z (4 months ago)
- Topics: client-side, client-side-validation, frontend, html5, nim, nim-lang, nim-language, nimwc
- Language: Nim
- Size: 54.7 KB
- Stars: 22
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Nim-HTML-Tools
- HTML5 Tools for Nim, all Templates, No CSS, No Libs, No JS Framework, No CSS Framework.
# Features
- [HTML Image Lazy Load.](https://codepen.io/FilipVitas/pen/pQBYQd)
- [HTML Input Email, that validates **before** Submit, uses IANA for validation.](https://coliff.github.io/html5-email-regex)
- [HTML Notification bubble, super easy to use.](https://user-images.githubusercontent.com/1189414/54497190-708cfd00-48d6-11e9-9812-7ac7542c294e.png)
- HTML Input File, validates File Format **before** Upload, by default for Images but you can customize it.
- HTML Minifier, super fast performance.
- RST/Markdown to HTML using Nim std lib.
- HTML Input Number, wont allow Negative, maxlenght is enforced, dir auto, etc.
- Designed for Nim std lib templating engine and NimWC, but can be used anywhere.


# Use
```nim
import html_toolsecho inputEmailHtml(value="[email protected]", name="myMail", class="is-rounded", id="myMail", placeholder="Email", required=true)
echo inputNumberHtml(value="42", name="myNumber", class="is-rounded", id="myNumber", placeholder="Integer", required=true)
echo inputFileHtml(name="myImage", class="is-rounded", id="myImage", required=true)
echo imgLazyLoadHtml(src="myImage.jpg", class="is-rounded", id="lazyAsHell")
echo "Notification"
echo rst2html("**Hello** *World*")
echo minifyHtml("some
HTML ") # Minifies when -d:release
```
(Not all parameters are required, on the example all parameters are used only for illustrative purposes)# Install
- `nimble install html_tools`