https://github.com/bahrus/h2o-transformation
https://github.com/bahrus/h2o-transformation
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bahrus/h2o-transformation
- Owner: bahrus
- License: mit
- Created: 2020-03-25T15:32:26.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-11-10T17:30:24.000Z (over 2 years ago)
- Last Synced: 2024-04-26T10:22:03.337Z (about 1 year ago)
- Language: TypeScript
- Size: 43.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# h2o-transformation
# h2o-tf
h20-transformation stands for HTML to Object Transformation.
For performance-oriented sites, where content is primarily, but not exclusively, HTML-based,
it's useful to be able to take incoming HTML, and, when needed, "decompile" the UI, extracting out an object.Syntax:
```html
My Header 1
My Header 2
Val 1
Val 2
- Item 1
Item 2
import {h2oTF} from 'h2o-transformation/h2o-tf.js';
import {h2oTable} from 'h2o-table/h2oTable.js';
import {h2oLili} from 'h2o-lili/h2oLili.js';
h2oTF(myContainer, {
destObj: {},
match: {
table: ['myTableList', {props: ['prop1', 'prop2']}]
},
psp: [
{
lhsType: HTMLTableElement,
rhsType: Array,
ctor: h2oTable,
},
{
lhsTag: HTMLUlElement,
rhsType: Array
ctor: h2oLili
}
]
})
```