Closed cmwelsh closed 11 years ago
I thought this was a bug specific to this project. I am going to move this to the main GitHub project for the composer. Slim template generation is just not working well enough yet.
In rails_apps_composer, I can remove the "description" meta-tag in the layout when Slim is selected, if that is the only problem. The "description" meta-tag is largely superfluous. But is that all that fails when Slim is selected?
I think it also happened in app/views/layouts/_messages.html.slim. The bug occurs when html_to_slim encounters ternary operators. It usually messes up the parentheses (or more).
Is there an open issue for html_to_slim? Have you reported it? It'd be nice to see this resolved without working around it in rails_apps_composer. In any case, thanks for bringing it to my attention.
There are known deficiencies in the Haml2Slim[1] gem. I'm not sure what the next step would be - I just wanted to make you aware. :)
"Due to the complex logic behind both Haml's and Slim's parsers, there is currently no way of reliably converting between Haml and Slim templates. Haml2Slim only serves as a preliminary tool for templates conversion. You should always manually verify the converted templates."
Yes, I saw that warning when I looked for a way to convert ERB to Slim. Tell me, do you think it's worthwhile to continue to offer Slim as an option for rails_apps_composer? I don't use Slim but wanted to offer the option to use Slim.
Perhaps you could mark it as "experimental, due to the templates not being converted 100% properly yet". A novice is more likely to want something that "just works" and save themselves the hassle.
Good point. I'll add a note to the prompt.
I had to change this line when I generated a new Rails application using this recipe and Slim templates. The generated Slim template had a syntax error.
The reason seems to be that Haml2Slim is buggy. Perhaps we can work around this with a less complicated erb template.