# json-html-tpl

> Json-like template language exported to html.

Latest version **0.8.0** (published 2018-03-15) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install json-html-tpl
pnpm add json-html-tpl
yarn add json-html-tpl
bun add json-html-tpl
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.8.0 |
| Published | 2018-03-15 |
| First published | 2018-03-15 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 31.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | pavlovt |

## Links

- npm: https://www.npmjs.com/package/json-html-tpl
- npm.io page: https://npm.io/package/json-html-tpl

## Dependencies (1)

- [chevrotain](https://npm.io/package/chevrotain.md) *

## Recent versions

- 0.8.0 (latest) — 2018-03-15

## README

# Easy to write and understand templating language
Json-like template language exported to html.

The main idea is to be able to write clear and readable code because html contains too much boilerplate and it is very hard to understand its meaning.

The language should be able to convert this:
```
div.row {
    div.col {
        form :submit=submit() {
            input type=number v-model=zzz

            select.tst-z v-model=choose {
                option v-for="v in options" :value="v.id" {
                    ''title: '' {{v.title}}
                }
            }

            button.btn.btn-primary { ''Submit'' }
        }
    }
}
```
into this:
```html
<div class="row">
    <div class="col">
        <form :submit="submit()">
            <input type="number" v-model="zzz" />
            <select v-model="choose" class="tst">
                <option v-for="v in options" :value="v.id">{{v.title}}</option>
            </select>

            <button class="btn btn-primary">Submit</button>
        </form>
    </div>
</div>
```
## Why another template language?
Why create another template language when we have others like [jade](http://jade-lang.com/) and [pug](https://github.com/pugjs/pug)?

From my point of view python-like languages look simple but actually are very hard to read and understand. And you can never be sure where the code block ends :)

For me the difference between pug and jhtml is like the difference between sass and scss (guess why no one uses sass :))

The language will not have any logical constructs (like "if", "foreach") because it is aimed to be used with Vue.js or Angular.

The language is not ready yet but I am working actively on it.

---
_Source: https://npm.io/package/json-html-tpl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
