Class: Juli::Visitor::Slidy

Inherits:
Html show all
Defined in:
lib/juli/visitor/slidy.rb

Overview

This visits Absyn tree and generates HTML for Slideshow.

Text files under juli-repository must have ‘.txt’ extention.

Almost all are the same as Html VISITOR.

OPTIONS

-t template

specify template

Instance Attribute Summary

Attributes inherited from Html

#macros, #wikiname_visited

Instance Method Summary collapse

Methods inherited from Html

#initialize, #run_file, #template=, #visit_array, #visit_compact_dictionary_list, #visit_compact_dictionary_list_item, #visit_dictionary_list, #visit_dictionary_list_item, #visit_ordered_list, #visit_str, #visit_unordered_list, #visit_verbatim

Methods included from Html::Helper

#header_id, #relative_from

Methods included from Html::TagHelper

#content_tag, #tag

Methods included from Util

#camelize, conf, find_template, in_filename, juli_repo, mkdir, out_filename, str_limit, str_trim, to_wikiname, underscore, usage, visitor, visitor_list

Methods inherited from Absyn::Visitor

#initialize, #run_file, #visit_array, #visit_compact_dictionary_list, #visit_compact_dictionary_list_item, #visit_dictionary_list, #visit_dictionary_list_item, #visit_node, #visit_ordered_list, #visit_str, #visit_unordered_list, #visit_verbatim

Constructor Details

This class inherits a constructor from Juli::Visitor::Html

Instance Method Details

#run_bulkObject

bulk-mode for slideshow generation doesn’t make sense so that it just warns and return quickly.



13
14
15
# File 'lib/juli/visitor/slidy.rb', line 13

def run_bulk
  STDERR.printf("bulk-mode in Slidy is not supported.\n")
end

#visit_chapter(n) ⇒ Object

overwrite to:

  • add ‘slide’ stylesheet-class at level==1

  • include all contents in ‘slide’ stylesheet-class even title



20
21
22
23
24
25
26
27
28
29
# File 'lib/juli/visitor/slidy.rb', line 20

def visit_chapter(n)
  attr = {:id=>n.dom_id}
  if n.level==1
    attr.merge!(:class=>'slide')
  end
  (:div, attr) do
    header_link(n) +
    n.blocks.accept(self)
  end + "\n"
end