Skip to content

c0untd0wn/erb2slim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Erb2Slim

Converts erb template to slim template

Usage

First of all, you should install Erb2Slim as a gem.

gem install erb2slim

That's it!

Basically it gets an erb template string and returns the generated slim template as a string. Just use it like this:

require 'erb2slim'

slim_template_string = Erb2Slim.convert(erb_template_string)

How it works

Erb2Slim does not convert erb to slim directly. It first utilizes haml which supports converting html containing erb to haml. With this genertated haml, erb2slim now uses haml2slim to convert haml to slim.

Limitations

Currently, it only converts full html(erb) that contains doctype, html, head, and body tag correctly. In case of partial html(erb), the conversion is incorrect due to the limitation of the haml gem.

Required Gems

As mentioned above, 'haml' and 'haml2slim' are required.

About

Converts Erb templates to Slim templates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages