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

https://github.com/bahrus/h2o-transformation


https://github.com/bahrus/h2o-transformation

Last synced: 4 months ago
JSON representation

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
}
]
})

```