Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use htl #41

Open
data-compute-geek opened this issue May 31, 2022 · 2 comments
Open

How to use htl #41

data-compute-geek opened this issue May 31, 2022 · 2 comments

Comments

@data-compute-geek
Copy link

data-compute-geek commented May 31, 2022

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

<script src='????'></script>

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

@lionel-rowe
Copy link

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>

@Hvass-Labs
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants