Yet another implementation for Slim template language.
Slimi provides almost the same functionality as Slim, with a few additional useful features, such as generating AST with detailed location information about embedded Ruby codes.
Originally, Slimi was developed for Slimcop, a RuboCop runner for Slim template.
It uses Slimi to apply rubocop --auto-correct
to embedded Ruby codes in Slim template.
Add this line to your application's Gemfile.
gem 'slimi'
This will cause app/views/**/*.slim
files to be rendered by Slimi.
Slimi can be tested from command line by slimi
executable. This takes Slim code from STDIN and converts it into another form.
$ slimi --help
Commands:
slimi compile # Convert Slim into Ruby
slimi erb # Convert Slim into ERB
slimi help [COMMAND] # Describe available commands or one specific command
slimi parse # Convert Slim into Temple expression
slimi render # Convert Slim into HTML
- Line indicators
- Vebatim text
- Inline HTML
- Control
- Output
- HTML comment
- Code comment
- IE conditional comment
- Tags
- Doctype declaration
- Closed tags
- Trailing and leading white space
- Inline tags
- Text content
- Dynamic content
- Tag shortcuts
- Dynamic tags
- Attributes
- Attributes wrapper
- Quoted attributes
- Ruby attributes
- Boolean attributes
- Attribute merging
- Attribute shortcuts
- Splat attributes
- Plugins
- Include partials
- Translator/I18n
- Logic-less mode
- Smart text mode
- CLI
- Convert Slim to Ruby
- Convert Slim to HTML
- Convert Slim to ERB
- Slimi-only features
- Embedded Ruby code location
- Support for annotate_rendered_view_with_filenames
- Convert Slim to Temple expression by CLI