HTML / ERB to Slim Converter Online Tool

Online tool to convert HTML or ERB to Slim template
HTML / ERB content.
Slim content.

About Slim

Slim is a Ruby template language whose goal is reduce the syntax to the essential parts. Syntax similar with Python, but for HTML.

Example code:

      
doctype html
html
head
  title Slim Examples
  meta name="keywords" content="template language"
  meta name="author" content=author
  javascript:
    alert('Slim supports embedded javascript!')

body
  h1 Markup examples

  #content
    p This example shows you what a basic Slim file looks like.

    == yield

    - unless items.empty?
      table
        - items.each do |item|
          tr
            td.name = item.name
            td.price = item.price
    - else
      p
       | No items found.  Please add some inventory.
         Thank you!

  div id="footer"
    = render 'footer'
    | Copyright © #{year} #{author}
      
    

About ERB

ERB is an implementation of eRuby written purely in the Ruby programming language and included in the Ruby standard library.

An ERB template can be generated by running a piece of code written using the ERB object. A simple example is as shown below.

      
require 'erb'
x = 400
simple_template = "Value of x is: is <%= x %>."
renderer = ERB.new(simple_template)
puts output = renderer.result(binding)