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

删除回忆录丶 提交于 2019-11-30 12:41:44

You can!

First, make sure you have already installed slim-rails. You can install it by calling gem 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!

Sirat

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.

@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).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!