Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/westonganger/ruby_view_template_converters

Complete solutions to convert ERB, SLIM, AND HAML with the least amount of manual effort
https://github.com/westonganger/ruby_view_template_converters

erb file-conversion file-converter haml slim template-converter template-language templating-engine

Last synced: 17 days ago
JSON representation

Complete solutions to convert ERB, SLIM, AND HAML with the least amount of manual effort

Awesome Lists containing this project

README

        

# Ruby View Template Converters

Gem Version
CI Status
RubyGems Downloads

Complete solutions to convert ERB, SLIM, AND HAML with the least amount of manual effort.

Features:

- Converts ERB, SLIM, or HAML
- Support conversion in both directions for each view template language

## Installation

```
gem install ruby_view_template_converters
```

Or if you want to download and use the scripts directly you can download from the [`bin/` folder](./bin/)

## Command Line Usage

### Convert from ERB

#### ERB to SLIM

```
ruby_view_template_converters --erb-to-haml
```

#### ERB to HAML (TBD - Help wanted)

```
ruby_view_template_converters --erb-to-haml
```

### Convert from SLIM

#### SLIM to ERB

```
ruby_view_template_converters --slim-to-erb
```

#### SLIM to HAML (TBD - Help wanted)

```
ruby_view_template_converters --slim-to-haml
```

### Convert from HAML

#### HAML to ERB (TBD - Help wanted)

```
ruby_view_template_converters --haml-to-erb
```

#### HAML to SLIM (TBD - Help wanted)

```
ruby_view_template_converters --haml-to-slim
```

## Ruby Usage

```ruby
ViewTemplateConverters.erb_to_slim(file_path_or_glob)
ViewTemplateConverters.erb_to_haml(file_path_or_glob)

ViewTemplateConverters.slim_to_erb(file_path_or_glob)
ViewTemplateConverters.slim_to_haml(file_path_or_glob)

ViewTemplateConverters.haml_to_erb(file_path_or_glob)
ViewTemplateConverters.haml_to_slim(file_path_or_glob)
```

## Credits

Created & Maintained by [Weston Ganger](https://westonganger.com) - [@westonganger](https://github.com/westonganger)