如何将html.slim文件转换为html或html.erb? [英] How can I convert html.slim files to html or html.erb?

查看:166
本文介绍了如何将html.slim文件转换为html或html.erb?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将我的Ruby on Rails应用程序中的html.slim文件转换为html.erb。有没有简单的方法来做到这一点?我尝试了Stack Overflow和其他网站列出的许多选项。但没有为我工作。我发现了一个转换器 http://slim2html.raving.systems/ 和一个HTML格式转换器http://html2slim.herokuapp.com/ 。这不是我的用途,因为它不能以其他方式工作。我应该手动去做吗?请帮忙。 首先,确保您已经安装了 slim-rails 。你可以通过调用 gem install slim-rails 来安装它。

然后在 input.html



最后,您打开终端并打电话:

echo`slimrb input.html`> output.html



注意:它是` ,而不是'



打开文件 output.html ,这就是你想要的!


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.

解决方案

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!

这篇关于如何将html.slim文件转换为html或html.erb?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆