WebReflection / uhtml

A micro HTML/SVG render
MIT License
917 stars 37 forks source link

Suggested FAQ documentation #135

Open darcyparker opened 1 month ago

darcyparker commented 1 month ago

In the https://webreflection.github.io/uhtml/#faq, I suggest a section about tooling such as:

I am interested in recommendations on how to setup prettier to format uhtml's svg/html literals. (Is there such a solution? If so, I think this would a useful FAQ item too.

The vscode plugin support for syntax highlighting is nice. I noticed that neovim supports it OOTB with tree-sitter (Works nicely for me... here are screenshots here https://github.com/nvim-treesitter/nvim-treesitter/pull/3678 when support was added. I imagine other editors with tree-sitter support can do it too.)

Another topic I am interested in (but don't know if there is answer), is getting LSP support for the HTML/SVG elements and attributes with tagged templates. Syntax highlighting works with tree-sitter... I am still researching if there is a way to get LSP support.

darcyparker commented 1 month ago

I just tried https://github.com/runem/lit-analyzer/tree/master/packages/ts-lit-plugin and it works for uhtml's html template literals too. So I now have LSP support for the content inside uhtml's template literals - working in neovim. I imagine it works for any editor that has LSP.

Unfortunately it doesn't work with uhtml's svg template literals.... (yet)

darcyparker commented 1 month ago

It's also worth adding to the FAQ topic about signals, that it also works with https://github.com/tc39/proposal-signals https://github.com/proposal-signals/signal-polyfill

WebReflection commented 1 month ago

PR welcome 🥳