Class: HTML

Inherits:
AbstractIndex show all
Defined in:
lib/langhelp/langhelp-base.rb

Defined Under Namespace

Classes: Converter, SingleHTML, Tag

Constant Summary

Constants inherited from AbstractIndex

AbstractIndex::SPACES

Constants included from LocalVariables

LocalVariables::ANCHOR_BEGIN, LocalVariables::ANCHOR_END

Constants included from KanjiConverter

KanjiConverter::KCONVERTERS

Instance Attribute Summary

Attributes inherited from AbstractIndex

#arg1, #conf, #title

Instance Method Summary collapse

Methods inherited from AbstractIndex

#initialize, #output_title

Methods included from LocalVariables

#insert_local_variables

Methods included from FilenameString

#abbreviate_filename, #abbreviate_filename!, #normalize_filename!

Methods included from KanjiConverter

#encoding, #kconv

Methods included from MkArray

#mkarray

Methods included from EmacsLispString

#lisp_dump_string

Constructor Details

This class inherits a constructor from AbstractIndex

Instance Method Details

#add_html(html) ⇒ Object



599
600
601
602
# File 'lib/langhelp/langhelp-base.rb', line 599

def add_html(html)
  obj = single_html_factory(html)
  @additional_htmls << obj unless @additional_htmls.include? obj
end

#each_html(&block) ⇒ Object



604
605
606
607
# File 'lib/langhelp/langhelp-base.rb', line 604

def each_html(&block)
  @single_htmls.each &block
  @additional_htmls.each &block
end

#init(x = {}) ⇒ Object



580
581
582
583
584
585
586
587
588
589
590
591
592
# File 'lib/langhelp/langhelp-base.rb', line 580

def init(x={})
  @x = x
  @basedir = x[:basedir]
  @recursive = x[:recursive]
  @single_htmls = mkarray(x[:HTML]).flatten.map{|html|
    html = File.join(@basedir, html) if @basedir
    normalize_filename! html
    Dir[html]
  }.flatten.map{|html|
    single_html_factory html
  }
  @additional_htmls = []
end

#tagifyObject



609
610
611
# File 'lib/langhelp/langhelp-base.rb', line 609

def tagify
  each_html {|single| single.tagify }
end

#to_e(out) ⇒ Object



613
614
615
# File 'lib/langhelp/langhelp-base.rb', line 613

def to_e(out)
  each_html {|single| single.to_e out }
end