dillonkearns / elm-review-html-to-elm

Turn HTML into Elm. With support for elm-tailwind-modules.
http://html-to-elm.com/
BSD 3-Clause "New" or "Revised" License
95 stars 9 forks source link

Finish regex replace rules to normalize Elm names #8

Closed dillonkearns closed 3 years ago

dillonkearns commented 3 years ago

One example that isn't yet implemented:

<div class="space-x-1.5">

Generates:

Tw.space_x_1.5

And should instead generate:

Tw.space_x_1_dot_5

See full list of rules https://github.com/matheus23/elm-tailwind-modules/blob/cd5809505934ff72c9b54fd1e181f67b53af8186/src/helpers.ts#L24-L59.

dillonkearns commented 3 years ago

I'm not aware of any remaining normalization rules that need to be applied.

@matheus23 do you think this code covers all the needed logic to scrub the names, or is there anything missing? https://github.com/dillonkearns/html-to-elm-tailwind-modules/blob/89c38a11c2eb9f3bbe68ffee2d886359a8bcd252/src/HtmlToTailwind.elm#L245-L255

matheus23 commented 3 years ago

Ah, I see. You copied the logic and removed unused stuff like the prefix and camel casing logic (which is essentially dead code in elm-tailwind-modules) and anything handling variants.

Looks good to me :)

dillonkearns commented 3 years ago

Excellent, I think this is in good shape for now then 👍