Class: Gust

Inherits:
Object
  • Object
show all
Extended by:
Pygments
Defined in:
lib/gust.rb

Class Method Summary collapse

Class Method Details

.parse(code, options = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/gust.rb', line 11

def parse(code, options = {})
  return plain_text(code) unless options[:filename]

  case options[:filename]
    when /.*\.png$/ then image(options[:url])
    when /.*\.markdown$/, /.*\.md$/ then markdown(code)
    when /.*\.textile$/ then textile(code)
    else highlight(code, options) rescue plain_text(code)
  end

end