Skip to content
New issue

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

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

Already on GitHub? # to your account

What is the difference between HTML and DynamicHTML? #388

Closed
revolter opened this issue Mar 7, 2021 · 3 comments · Fixed by #389
Closed

What is the difference between HTML and DynamicHTML? #388

revolter opened this issue Mar 7, 2021 · 3 comments · Fixed by #389
Assignees
Labels
question Further information is requested

Comments

@revolter
Copy link

revolter commented Mar 7, 2021

I'm sorry if this is not the best place to ask questions, but I couldn't find any official documentation except the README file.

What are the differences between HTML and DynamicHTML, and how do I know when I need to use one over the other?

@MaxDesiatov
Copy link
Collaborator

DynamicHTML is provided by the TokamakDOM module and has a listeners property with a corresponding initializer parameter. You can pass closures that can handle onclick, onmouseover and other DOM events for you (check out MDN docs for the full list). HTML doesn't support event listeners, and is declared in the TokamakStaticHTML module, which TokamakDOM re-exports. The benefit of HTML is that you can use it for static rendering in libraries like TokamakVapor and TokamakPublish. Does that answer your question?

@MaxDesiatov MaxDesiatov added the question Further information is requested label Mar 7, 2021
@revolter
Copy link
Author

revolter commented Mar 7, 2021

Yes, thank you! Maybe this answer could be added in the code documentation or somewhere on GitHub.

@MaxDesiatov
Copy link
Collaborator

Great point, I'm on it 👍

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
question Further information is requested
Development

Successfully merging a pull request may close this issue.

2 participants