Re:Show HN: Satori – Convert HTML and CSS to SVG in Millisec...
by gnrlst on Tuesday October 11, 2022 @05:28AM
(#33161181)
Love the project! Sorry to be pedantic, but the claim is technically false. You don't actually support HTML and CSS. You support JSX. As someone who doesn't use React due to the abomination of mixing html and css within the JS, do you have plans to actually support regular HTML and CSS? Or provide a dedicated transpiler? (I'm not familiar with the react ecosystem, so likely one already exists?)
[ Parent
| on HN ]
Re:Show HN: Satori – Convert HTML and CSS to SVG in Millisec...
by tngranados on Tuesday October 11, 2022 @07:08AM
(#33161865)
The claim is correct, it supports a subset of HTML and CSS[0]. You can even check the demo page[1], it has examples with HTML and inline styles.
[0]: https://github.com/vercel/satori#html-elements [1]: https://og-playground.vercel.app
Re:Show HN: Satori – Convert HTML and CSS to SVG in Millisec...
by gnrlst on Tuesday October 11, 2022 @09:05AM
(#33162880)
[0] "supports a limited subset of HTML and CSS features" (and it still requires jsx-esque syntax with curly braces)
[1] uses JSX
So, yeah, my comment still stands.
Re:Show HN: Satori – Convert HTML and CSS to SVG in Millisec...
by shuding on Tuesday October 11, 2022 @09:13AM
(#33162961)
JSX here is just a way to represent the HTML information because you can't write HTML in JavaScript. It is NOT required. But with the JSX representation, the lib doesn't have to parse it again, and it's using it as JSON, check the "Use without JSX" section in the docs: https://github.com/vercel/satori#use-without-jsx