Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

HAML to Phlex, Slim to Phlex #405

Open
bb opened this issue Sep 13, 2024 · 2 comments
Open

HAML to Phlex, Slim to Phlex #405

bb opened this issue Sep 13, 2024 · 2 comments

Comments

@bb
Copy link
Contributor

bb commented Sep 13, 2024

Is your feature request related to a problem? Please describe.
In some Projects, I use HAML or Slim templates. It would be great if I could convert snippets from there to Phlex in one simple step.

Describe the solution you'd like
When pasting/typing into the ERB field, it would be nice to auto-detect the input format (ERB or HAML or Slim) and do the transformation to Phlex.
Instead of auto-detect, it could be aided by a format select box providing the available values.

One could try going directly from HAML to Phlex using e.g. https://github.com/LukeClancy/haml2phlex or from HAML to ERB e.g. using https://github.com/elia/haml2erb and then use the existing approach for ERB to Phlex. Another option might be integrating Tilt and changing its evaluation from executing to outputting the Ruby code.

@marcoroth
Copy link
Owner

Hey @bb, thanks for opening this issue!

Do you want to spike this idea to see where it could go? I think I'd personally prefer the haml2erb way as a "pre-step" so we can leverage the whole remaining logic phlexing has around custom elements, Rails helpers, component names, method extraction etc.

@bb
Copy link
Contributor Author

bb commented Sep 13, 2024

Hi @marcoroth,

thanks for the guidance regarding the pre-step. I already considered doing a spike but also wanted to post the request here to gauge interest, get recommendations like yours and of course because I'm lazy 😜.

I'll give it a shot, but if anybody wants to take this, please go ahead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants