I need to convert the html.slim files in my Ruby on Rails application to html.erb. Is there any easy way to do it? I tried many options listed in Stack Overflow and other sites. But nothing worked for me. I found a converter http://slim2html.raving.systems/ and a html to slim converter http://html2slim.herokuapp.com/ . It is not of my use since it does not work the other way around. Should I have to do it manually? Please help.
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
-
Why does the box-shadow property not apply to a
I just did it using Codepen.io
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.
You can then copy that out.
You can!
First, make sure you have already installed
slim-rails
. You can install it by callinggem install slim-rails
.Then write something in the
input.html
Finally, you open the terminal and call:
echo `slimrb input.html` > output.html
NOTE: it is
`
, not'
or"
Open file
output.html
, that's what you looking for!@duykhoa's answer is best and best for converting a whole file, but you can also use the inspector to see and copy the compiled HTML (CTRL+SHIFT+I in Chrome or right-click and then click on
inspect
to inspect an element).