Class: RD::RD2HTMLExtVisitor

Inherits:
RD2HTMLVisitor show all
Defined in:
lib/rd/rd2html-ext-lib.rb

Defined Under Namespace

Modules: EnableBr, HeadElement, HeadLineTitle, HeadlineSecno, NativeInline, RefExtension

Constant Summary collapse

OUTPUT_SUFFIX =

must-have constants

"html"
INCLUDE_SUFFIX =
["html"]
METACHAR =
{ "<" => "&lt;", ">" => "&gt;", "&" => "&amp;" }

Constants inherited from RD2HTMLVisitor

RD::RD2HTMLVisitor::SYSTEM_NAME, RD::RD2HTMLVisitor::SYSTEM_VERSION, RD::RD2HTMLVisitor::VERSION

Constants included from MethodParse

MethodParse::KIND2NUM

Constants inherited from Visitor

Visitor::SYSTEM_NAME, Visitor::SYSTEM_VERSION, Visitor::VERSION

Instance Attribute Summary collapse

Attributes inherited from RD2HTMLVisitor

#charset, #css, #footnotes, #foottexts, #html_link_rel, #html_link_rev, #lang, #output_rbl, #title, #use_old_anchor

Attributes inherited from OutputFormatVisitor

#filename, #include_suffix, #input_filename

Instance Method Summary collapse

Methods inherited from RD2HTMLVisitor

#add_foottext, #apply_to_Code, #apply_to_DescList, #apply_to_DescListItem, #apply_to_DocumentElement, #apply_to_Emphasis, #apply_to_EnumList, #apply_to_EnumListItem, #apply_to_Footnote, #apply_to_Foottext, #apply_to_Headline, #apply_to_Index, #apply_to_ItemList, #apply_to_ItemListItem, #apply_to_Keyboard, #apply_to_MethodList, #apply_to_MethodListItem, #apply_to_RefToElement, #apply_to_RefToOtherFile, #apply_to_Reference_with_RDLabel, #apply_to_Reference_with_URL, #apply_to_String, #apply_to_StringElement, #apply_to_TextBlock, #apply_to_Var, #apply_to_Verb, #apply_to_Verbatim, #consist_of_one_textblock_and_sublists, #get_footnote_num, #hyphen_escape, #is_this_textblock_only_one_block_of_parent_listitem?, #is_this_textblock_only_one_block_other_than_sublists_in_parent_listitem?, version

Methods included from MethodParse

analize_method, kind2num, kind2str, make_method_index, make_mindex_label, str2kind, tr_method

Methods inherited from RDVisitor

#apply_to_DescListItemTerm, #apply_to_MethodListItemTerm, #prepare_labels, #refer_external

Methods inherited from OutputFormatVisitor

#apply_to_Include

Methods included from SearchFile

#search_file

Methods inherited from Visitor

define_visit_Nonterminal, define_visit_Terminal, version, #visit_DescListItem, #visit_MethodListItem, #visit_Reference, #visit_children

Constructor Details

#initializeRD2HTMLExtVisitor

Returns a new instance of RD2HTMLExtVisitor.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/rd/rd2html-ext-lib.rb', line 21

def initialize
  @enum_count = [0, 0, 0, 0, 0, 0, 0]
  @levelold = 0
  @enum_start_level = 2
  @image_size = {}
  begin
    require 'image_size'
    @use_image_size = true
  rescue LoadError
    @use_image_size = false
  end

  super
end

Instance Attribute Details

#headObject

Returns the value of attribute head.



19
20
21
# File 'lib/rd/rd2html-ext-lib.rb', line 19

def head
  @head
end

#opt_enable_brObject

Returns the value of attribute opt_enable_br.



18
19
20
# File 'lib/rd/rd2html-ext-lib.rb', line 18

def opt_enable_br
  @opt_enable_br
end

#opt_head_elementObject

Returns the value of attribute opt_head_element.



18
19
20
# File 'lib/rd/rd2html-ext-lib.rb', line 18

def opt_head_element
  @opt_head_element
end

#opt_headline_secnoObject

Returns the value of attribute opt_headline_secno.



18
19
20
# File 'lib/rd/rd2html-ext-lib.rb', line 18

def opt_headline_secno
  @opt_headline_secno
end

#opt_headline_titleObject

Returns the value of attribute opt_headline_title.



18
19
20
# File 'lib/rd/rd2html-ext-lib.rb', line 18

def opt_headline_title
  @opt_headline_title
end

#opt_native_inlineObject

Returns the value of attribute opt_native_inline.



18
19
20
# File 'lib/rd/rd2html-ext-lib.rb', line 18

def opt_native_inline
  @opt_native_inline
end

#opt_ref_extensionObject

Returns the value of attribute opt_ref_extension.



18
19
20
# File 'lib/rd/rd2html-ext-lib.rb', line 18

def opt_ref_extension
  @opt_ref_extension
end

Instance Method Details

#install_enable_brObject



55
56
57
# File 'lib/rd/rd2html-ext-lib.rb', line 55

def install_enable_br
  extend EnableBr
end

#install_head_elementObject



75
76
77
# File 'lib/rd/rd2html-ext-lib.rb', line 75

def install_head_element
  extend HeadElement
end

#install_headline_secnoObject



59
60
61
62
# File 'lib/rd/rd2html-ext-lib.rb', line 59

def install_headline_secno
  extend HeadLineTitle
  extend HeadlineSecno
end

#install_headline_titleObject



47
48
49
# File 'lib/rd/rd2html-ext-lib.rb', line 47

def install_headline_title
  extend HeadLineTitle
end

#install_native_inlineObject



51
52
53
# File 'lib/rd/rd2html-ext-lib.rb', line 51

def install_native_inline
  extend NativeInline
end

#install_ref_extensionObject



64
65
66
67
68
69
70
71
72
73
# File 'lib/rd/rd2html-ext-lib.rb', line 64

def install_ref_extension
  extend RefExtension
  @ref_extension = []
  (methods + private_methods).sort.each do |m|
    if /^ref_ext/ =~ m
      @ref_extension.push(m.intern)
    end
  end
  @ref_extension.push(:default_ref_ext)
end

#visit(tree) ⇒ Object



36
37
38
39
40
41
42
43
44
45
# File 'lib/rd/rd2html-ext-lib.rb', line 36

def visit(tree)
  install_headline_title if opt_headline_title
  install_headline_secno if opt_headline_secno
  install_ref_extension if opt_ref_extension
  install_enable_br if opt_enable_br
  install_native_inline if opt_native_inline
  install_head_element if opt_head_element
  title_init if opt_headline_title || opt_headline_secno
  super
end