Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/westonganger/ruby_view_template_converters
- Owner: westonganger
- Created: 2021-07-19T20:19:39.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-07-19T21:56:31.000Z (over 3 years ago)
- Last Synced: 2024-10-30T00:36:36.785Z (2 months ago)
- Topics: erb, file-conversion, file-converter, haml, slim, template-converter, template-language, templating-engine
- Language: Ruby
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Ruby View Template Converters
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)