Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I convert html.slim to html.erb?

I have many html.slim files that I would like to convert into html.erb files since I am not familiar with the slim syntax. Is there a converter for slim to erb?

I found a converter for html to slim that has the functionality I am looking for but it does not do slim to erb. http://html2slim.herokuapp.com/

like image 233
MicFin Avatar asked Apr 24 '14 18:04

MicFin


People also ask

How do I convert HTML slim to HTML ERB?

erb: Here, we will see how to change the slim file to erb file. In CLI, you can use an inbuilt command in slim file which is used to convert these files. slimrb is a command-line tool that means convert and –erb is indicating that the file is going to be converted in the erb format.

How to convert slim to html?

Start a new pen. Choosing Slim as your HTML Markdown language. Paste in your Slim - then click the view compiled button in your HTML pane. You'll see the straight HTML version of your markup.


2 Answers

try the slimrb utility...

slimrb --erb html.slim
like image 138
new publicvoid Avatar answered Sep 19 '22 05:09

new publicvoid


I believe, you're actually looking for Slim::ERBConverter itself.

  • If you are on rails projects, check out slim-rails how to integrate to your project.

  • If you're on CLI, you even could use slimrb to easily convert many html.slim files into html.erb files with a single command.

  • If you prefer online converter like you refer, there are simple online tools to help you convert e.g Slim to HTML / ERB, which is basically utilized Slim::ERBConverter itself.

like image 40
gizipp Avatar answered Sep 22 '22 05:09

gizipp