Class: Gary::Builder
- Inherits:
-
Markaby::Builder
- Object
- Markaby::Builder
- Gary::Builder
- Defined in:
- lib/gary.rb
Overview
Build de presentation slides.
Instance Attribute Summary collapse
-
#presentation_options ⇒ Object
readonly
Returns the value of attribute presentation_options.
Instance Method Summary collapse
-
#code(options = {}) ⇒ Object
Generates synta hightlight for code using albino.
-
#presentation(options = {}, &block) ⇒ Object
You must pass the presentation title.
-
#render ⇒ Object
Render the slideshow HTML.
-
#slide(options = {}, &block) ⇒ Object
Create a slide, you can pass some options, same options accepted by “div” tag.
Instance Attribute Details
#presentation_options ⇒ Object (readonly)
Returns the value of attribute presentation_options.
72 73 74 |
# File 'lib/gary.rb', line 72 def @presentation_options end |
Instance Method Details
#code(options = {}) ⇒ Object
Generates synta hightlight for code using albino
134 135 136 |
# File 'lib/gary.rb', line 134 def code( = {}) self << Albino.new([:code], [:type]).colorize end |
#presentation(options = {}, &block) ⇒ Object
You must pass the presentation title.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/gary.rb', line 81 def presentation( = {}, &block) raise "Must have a title" unless .has_key? :title @presentation_options = html do head do :name=>"defaultView", :content=>"slideshow" link.outlineStyle! :rel => 'stylesheet', :type => 'text/css', :href => 'assets/outline.css', :media => 'screen' link. :rel => 'stylesheet', :type => 'text/css', :href => '/print.css', :media => 'print' link. :rel => 'stylesheet', :type => 'text/css', :href => 'assets/style.css', :media => 'projection' link :rel => 'stylesheet', :type => 'text/css', :href => 'assets/prettify.css', :media => 'screen' script :src => "assets/jquery.js", :type => "text/javascript" script :src => "assets/slides.js", :type => "text/javascript" script :src => "assets/gary.js", :type => "text/javascript" title @presentation_options[:title] end body do div.layout! do div.controls! { } div.currentSlide! { } div.header! { } div. do h1 @presentation_options[:title] end div.microsoft! do self << "Microsoft's Internet Explorer browser has no built-in vector graphics machinery required for \"loss-free\" gradient background themes." end end div.presentation do instance_eval(&block) end end end end |
#render ⇒ Object
Render the slideshow HTML.
75 76 77 |
# File 'lib/gary.rb', line 75 def render to_s end |
#slide(options = {}, &block) ⇒ Object
Create a slide, you can pass some options, same options accepted by “div” tag.
127 128 129 130 131 |
# File 'lib/gary.rb', line 127 def ( = {}, &block) div. do div.container { instance_eval(&block) } end end |