Class: Keydown::SlideDeck
- Inherits:
-
Object
- Object
- Keydown::SlideDeck
- Defined in:
- lib/keydown/slidedeck.rb
Defined Under Namespace
Classes: Context
Instance Attribute Summary collapse
-
#slides ⇒ Object
readonly
Returns the value of attribute slides.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(text) ⇒ SlideDeck
constructor
A new instance of SlideDeck.
- #to_html ⇒ Object
Constructor Details
#initialize(text) ⇒ SlideDeck
Returns a new instance of SlideDeck.
11 12 13 14 15 16 17 18 19 |
# File 'lib/keydown/slidedeck.rb', line 11 def initialize(text) @title = '' @slides = [] @text = text set_title extract_classnames! end |
Instance Attribute Details
#slides ⇒ Object (readonly)
Returns the value of attribute slides.
9 10 11 |
# File 'lib/keydown/slidedeck.rb', line 9 def @slides end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
8 9 10 |
# File 'lib/keydown/slidedeck.rb', line 8 def title @title end |
Instance Method Details
#to_html ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/keydown/slidedeck.rb', line 21 def to_html require 'tilt' css_files = ['css/keydown.css'] css_files += Dir.glob('css/*.css') css_files.uniq! extension_dirs = Dir.glob('deck.js/extensions/*').select {|f| File.directory? f} extension_css = extension_dirs.inject([]) do |files, dir| files += Dir.glob("#{dir}/*.css") files end context = Context.new(:title => @title, :css_files => css_files, :js_files => Dir.glob('js/**/*.js') || [], :slides => @slides, :extensions_js_files => Dir.glob('deck.js/extensions/**/*.js') || [], :extensions_css_files => extension_css) template = Tilt.new(File.join(Tasks.template_dir, 'index.html.haml')) template.render(context) end |