Class: Scarlet::Formatters::HTML

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/scarlet/formatters/html.rb

Instance Attribute Summary

Attributes included from Base

#slide

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Base

#initialize

Class Method Details

.default_templateObject



15
16
17
# File 'lib/scarlet/formatters/html.rb', line 15

def self.default_template
  File.join(File.dirname(__FILE__), "..", "templates", "html", "default.erb")
end

Instance Method Details

#textObject



7
8
9
10
11
12
13
# File 'lib/scarlet/formatters/html.rb', line 7

def text
  process_code do |code, language, before, after|
    "#{before}<notextile><div class=\"code\">" + Scarlet::Highlighter.run(code, :format => "html", :lexer => language) + "</div></notextile>#{after}"
  end
  
  RedCloth.new(slide.text).to_html
end