class Qwik::PresenGenerator
Constants
- REPLACE_H
Public Class Methods
generate(site, pagename, wabisabi, theme=nil)
click to toggle source
# File vendor/qwik/lib/qwik/act-presen.rb, line 161 def self.generate(site, pagename, wabisabi, theme=nil) page = site[pagename] title = page.get_title wabisabi = resolve_h(wabisabi) wabisabi = resolve_slide(wabisabi) #theme ||= 'i18n' theme ||= 'qwikworld' #theme = 'qwikblack' #theme = 'qwikborder' return html_page(title, theme, wabisabi, pagename) end
resolve_h(wabisabi)
click to toggle source
# File vendor/qwik/lib/qwik/act-presen.rb, line 177 def self.resolve_h(wabisabi) wabisabi.each_tag(:h2, :h3, :h4, :h5, :h6){|w| w[0] = REPLACE_H[w[0]] w } end
resolve_slide(wabisabi)
click to toggle source
# File vendor/qwik/lib/qwik/act-presen.rb, line 184 def self.resolve_slide(wabisabi) presentation = [] slide = [] presentation << slide wabisabi.each {|e| if e.is_a?(Array) && e[0] == :h1 && 0 < slide.size slide = [] presentation << slide end slide << e } return presentation.map {|slide| [:div, {:class=>'slide'}, slide] } end
Private Class Methods
html_page(title, theme, wabisabi, pagename)
click to toggle source
# File vendor/qwik/lib/qwik/act-presen.rb, line 203 def self.html_page(title, theme, wabisabi, pagename) theme_href = ".theme/s5/#{theme}/slides.css" html = [[:"!DOCTYPE", 'html', 'PUBLIC', '-//W3C//DTD HTML 4.01 Transitional//EN', 'http://www.w3.org/TR/html4/loose.dtd'], [:html, {:'xmlns'=>'http://www.w3.org/1999/xhtml', :'xmlns:v'=>'urn:schemas-microsoft-com:vml'}, [:head, [:title, title], [:meta, {:name=>'defaultView', :content=>'slideshow'}], [:meta, {:name=>'controlVis', :content=>'hidden'}], [:link, {:rel=>'stylesheet', :href=>theme_href, :type=>'text/css', :media=>'projection', :id=>'slideProj'}], [:link, {:rel=>'stylesheet', :href=>'.theme/s5/default/outline.css', :type=>'text/css', :media=>'screen', :id=>'outlineStyle'}], [:link, {:rel=>'stylesheet', :href=>'.theme/s5/default/print.css', :type=>'text/css', :media=>'print', :id=>'slidePrint'}], [:link, {:rel=>'stylesheet', :href=>'.theme/s5/default/opera.css', :type=>'text/css', :media=>'projection', :id=>'operaFix'}], [:style, {:type=>'text/css', :media=>'all'}, ''], [:script, {:src=>'.theme/s5/default/slides.js', :type=>'text/javascript'}, '']], [:body, [:div, {:class=>'layout'}, [:div, {:id=>'controls'}, ''], [:div, {:id=>'currentSlide'}, ''], [:div, {:id=>'header'}, ''], [:div, {:id=>'footer'}, [:h1, [:a, {:href=>"#{pagename}.html"}, title]]]], [:div, {:class=>'presentation'}, wabisabi]]]] return html end