# Copyright 2013 Google Inc. All Rights Reserved. # Licensed under the Apache License, Version 2.0, found in the LICENSE file. require "sinatra" require "haml" require "liquid" require "redcarpet" require "slim" class SinatraTemplatesApp < Sinatra::Base HELLOS = ["Hello", "Hola", "Bonjour", "Guten Tag", "こんにちは", "привет"] enable :inline_templates get "/erb" do erb :erb end get "/haml" do haml :haml end get "/liquid" do liquid :liquid, locals: { hellos: HELLOS } end get "/slim" do slim :slim end get "/markdown" do markdown(:markdown) end end __END__ @@ erb @@ haml %html %body %ul#hi - HELLOS.each do |hello| %li.greeting =hello World! @@ liquid @@ markdown * Hello World! * Hola World! * Bonjour World! * Gutentag World! * こんにちは World! * привет World! @@ slim html body ul id="hi" - HELLOS.each do |hello| li.greeting = hello | World!