An open API service indexing awesome lists of open source software.

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

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.

![HTML Notification bubble](https://user-images.githubusercontent.com/1189414/54497190-708cfd00-48d6-11e9-9812-7ac7542c294e.png)

![HTML Input File Format Validation](fileformat-validate.png)

![HTML Input Mail Validation](email-validation.png)

# Use

```nim
import html_tools

echo 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`