htl icon indicating copy to clipboard operation
htl copied to clipboard

How to use htl

Open data-compute-geek opened this issue 2 years ago • 2 comments

Hi,

I installed the htl through npm, and want to use it in my browser. I have tried various methods and just could not make it work. Can anyone give me a hand?

I thought I read somewhere I can put some code as the following in my html

But no matter what, I cannot find it anywhere.

I would like to be able to use something like htl.svg, and htl.html in my scripts. How do I import htl ?

Thanks. Sean

data-compute-geek avatar May 31 '22 23:05 data-compute-geek

If you want to include NPM modules directly in your front-end code, consider using esm.sh along with native JS modules:

<script type="module">
import { html } from "https://esm.sh/[email protected]"
document.body.appendChild(html`<h1>imported successfully`)
</script>

lionel-rowe avatar Feb 06 '23 03:02 lionel-rowe

The following works on my web-page:

<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>

Then I can use e.g. htl.html and htl.svg

Hvass-Labs avatar Jan 18 '24 16:01 Hvass-Labs