A script to convert raw html to swift/elementary syntax #46
alephao
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I waste a lot of time converting raw html to Swift/Elementary syntax, especially because I use stuff like tailwindui, so I wrote this javascript to do the conversion.
It takes some html as input, like
and outputs the swift/elementary version
It's not perfect, but it's been working well for me and literally saves me hours of manual converting.
I haven't wrapped it into an executable or plugin, so to use it you need to open your browser console and copy/paste the code, then you update the first line with the html you want to convert. I'm leaving this here, hope it is useful for you.
If you come up with a better UX than copy-pasting to browser console, pleas share 😬
https://gist.github.com/alephao/db44ab883394fba0a8ddcd5df62d3521
Beta Was this translation helpful? Give feedback.
All reactions