Example 1: Inferred props
<table>
<thead><th>Name</th><th>SSN Number</th></thead>
<tbody>
<tr data-ld='{"@type": "Person"}' id=temp>
<td itemprop=name>Burt</td>
<td itemprop=ssn>123-45-6789</td>
<script be-definitive='{"inferProps": true}'></script>
</tr>
<tr data-ld='{"@type": "Person", "name": "Sally", "ssn": "987-65-4321"}'>
<template href=#temp></template>
</tr>
<tr data-ld='{"@type": "Person", "name": "Sally", "ssn": "987-65-4321"}'>
<template href=#temp></template>
</tr>
</tbody>
</table>Only clone the template for other tr's if innerHTML is empty.
<table>
<thead><th>Name</th><th>SSN Number</thead>
<tbody>
<template be-definitive 🫚 itemscope=my-item itemref="a13245 b39596"></template>
<tr id=a13245 be-definitive>
<td>
<my-item></my-item>
<span itemprop=name>Burt</span>
</td>
<td itemprop=ssn>123-45-6789</td>
</tr>
<tr id=b39596>
<td itemprop=address>654 Penny Lane</td>
<td itemprop=cellphone>345-25-2686<</td>
</tr>
<template itemscope=my-item></template>
</tbody>
</table>automatically captures the template based on itemref's. Auto expands others
- Install git.
- Fork/clone this repo.
- Install node.
- Open command window to folder where you cloned this repo.
-
npm install
-
npm run serve
- Open http://localhost:3030/demo/dev in a modern browser.
> npm run test
import 'be-definitive/be-definitive.js';<script type=module crossorigin=anonymous>
import 'https://esm.run/be-definitive';
</script>