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

https://github.com/bahrus/be-metamorphic


https://github.com/bahrus/be-metamorphic

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

        

# be-metamorphic

be-metamorphic lets us party like it's 1999, and take advantage of the [increasingly popular](https://www.chromestatus.com/metrics/feature/timeline/popularity/79) XSLT, to turn a caterpillar of native HTML markup into a butterfly of web components-filled goodness.

[![Playwright Tests](https://github.com/bahrus/be-metamorphic/actions/workflows/CI.yml/badge.svg?branch=baseline)](https://github.com/bahrus/be-metamorphic/actions/workflows/CI.yml)

[![How big is this package in your project?](https://img.shields.io/bundlephobia/minzip/be-metamorphic?style=for-the-badge)](https://bundlephobia.com/result?p=be-metamorphic)

## Problem Statements

1. Progressively enhance a web page by converting swaths of native HTML, or tag names that are meaningful to the business, into web components, once component dependencies are downloaded.
2. ~~Generate table of contents from large document.~~ This will be handled by be-restated.

```html




  • Pineapple
    Occurs between red and yellow
    Expires
    Warning


  • Banana
    The yellow lengthy fruit
    Re-stock
    Error




```

When combined with xslt file:

```xslt









```

generates:

```html




Pineapple


Banana




```

The presence of the template (be-a-beacon) at the bottom is needed to let be-metamorphic know it can proceed with the transformation.

## Inlining the template

If no xslt property is specified, and the beacon template has non trivial content, see if the content is an xslt transform.