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

SuperHTML as a Templating Language Library #55

Open
Dorsug opened this issue Jan 23, 2025 · 1 comment
Open

SuperHTML as a Templating Language Library #55

Dorsug opened this issue Jan 23, 2025 · 1 comment

Comments

@Dorsug
Copy link

Dorsug commented Jan 23, 2025

The idea behind superhtml is great, the library part is currently completely unusable without lots of hacks to decouple it from the zine usage.
I was hoping this issue could be a starting point to get a roadmap to a usable independent library.

@kristoff-it
Copy link
Owner

Documentation is definitely missing and there's some polish work I still need to do to make it easier to integrate with SuperHTML, but it has absolutely zero dependency on Zine.

The library is designed to have the host application define the semantics of what is available to the user, so yes, in the case of Zine it uses Zine's logic, but you are supposed to create a new evaluation context tailored to your use case.

More specifically, most of the personalization is not directly used by SuperHTML, but it's actually passed down to Scripty, which is the component most directly affected by this design.

As an example, in Zine I have $page that represents the current page being rendered. If a webserver wanted to use SuperHTML as the templating language, it would probably want to have something else, like $request and $user. In that case it's the host application's (ie the webserver) responsibility to define what those things should be and which builtin functions they should expose.

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

2 participants