module Locomotive::Steam::Liquid::Filters::Text

Public Instance Methods

concat(input, *args) click to toggle source
# File lib/locomotive/steam/liquid/filters/text.rb, line 28
def concat(input, *args)
  result = input.to_s
  args.flatten.each { |a| result << a.to_s }
  result
end
dasherize(input) click to toggle source
# File lib/locomotive/steam/liquid/filters/text.rb, line 11
def dasherize(input)
  input.to_s.gsub(' ', '-').gsub('/', '-').dasherize
end
encode(input) click to toggle source
# File lib/locomotive/steam/liquid/filters/text.rb, line 15
def encode(input)
  Rack::Utils.escape(input)
end
ljust(input, integer, padstr = '') click to toggle source

left justify and padd a string

# File lib/locomotive/steam/liquid/filters/text.rb, line 40
def ljust(input, integer, padstr = '')
  input.to_s.ljust(integer, padstr)
end
markdown(input) click to toggle source
# File lib/locomotive/steam/liquid/filters/text.rb, line 48
def markdown(input)
  @context.registers[:services].markdown.to_html(input)
end
multi_line(input) click to toggle source

alias newline_to_br

# File lib/locomotive/steam/liquid/filters/text.rb, line 24
def multi_line(input)
  input.to_s.gsub("\n", '<br/>')
end
parameterize(input) click to toggle source
# File lib/locomotive/steam/liquid/filters/text.rb, line 19
def parameterize(input)
  input.parameterize
end
rjust(input, integer, padstr = '') click to toggle source

right justify and padd a string

# File lib/locomotive/steam/liquid/filters/text.rb, line 35
def rjust(input, integer, padstr = '')
  input.to_s.rjust(integer, padstr)
end
textile(input) click to toggle source
# File lib/locomotive/steam/liquid/filters/text.rb, line 44
def textile(input)
  @context.registers[:services].textile.to_html(input)
end
underscore(input) click to toggle source
# File lib/locomotive/steam/liquid/filters/text.rb, line 7
def underscore(input)
  input.to_s.gsub(' ', '_').gsub('/', '_').underscore
end