jonx
Javascript natively works well with JSON, so the idea behind this module is to do UI with JSON as much as possible and finally convert to HTML as the last step.
This would allow building templates that are based purely on JSON and transforming JSON.
TODO
This is a work in progress, and some critical functionality is in the works still:
- There is no browser build though there are no dependencies which would break this for the browser.
- There is no ability to convert from HTML to json yet
- There is no ability to transform JSON dynamically (templates).
Install
npm install jonx
API
It is best to read the unit tests under test directory to understand how to use this. The API is still under flux.
Here is a complicated example which cover bulk of the interesting cases.
jonx
Output HTML:
First Div First Span Second Span