Class: HTMLIndex
- Inherits:
-
AbstractIndex
- Object
- AbstractIndex
- HTMLIndex
- Defined in:
- lib/langhelp/langhelp-base.rb
Overview
Information index class by HTML source
Direct Known Subclasses
Constant Summary
Constants inherited from AbstractIndex
Constants included from LocalVariables
LocalVariables::ANCHOR_BEGIN, LocalVariables::ANCHOR_END
Constants included from KanjiConverter
Instance Attribute Summary
Attributes inherited from AbstractIndex
Instance Method Summary collapse
- #init(x = {}) ⇒ Object
- #init_filename(x) ⇒ Object
-
#post_process(es_src) ⇒ Object
overridden by subclass.
-
#pre_process(html_src) ⇒ Object
overridden by subclass.
-
#space ⇒ Object
number of spaces between label and sexp.
-
#to_e(out) ⇒ Object
Dump into e-script pre_process -> HTML2TXT -> post_process.
Methods inherited from AbstractIndex
Methods included from LocalVariables
Methods included from FilenameString
#abbreviate_filename, #abbreviate_filename!, #normalize_filename!
Methods included from KanjiConverter
Methods included from MkArray
Methods included from EmacsLispString
Constructor Details
This class inherits a constructor from AbstractIndex
Instance Method Details
#init(x = {}) ⇒ Object
382 383 384 385 |
# File 'lib/langhelp/langhelp-base.rb', line 382 def init(x={}) @spaces = x[:spaces] || 20 init_filename x end |
#init_filename(x) ⇒ Object
387 388 389 390 391 392 393 394 395 396 397 |
# File 'lib/langhelp/langhelp-base.rb', line 387 def init_filename(x) if arg1 =~ /\.html$/ @index_page = arg1 @dir = File.dirname(@index_page) else @dir = x[:dir] @index_page = x[:index_page] end normalize_filename! @dir, @index_page end |
#post_process(es_src) ⇒ Object
overridden by subclass
414 415 416 |
# File 'lib/langhelp/langhelp-base.rb', line 414 def post_process(es_src) es_src end |
#pre_process(html_src) ⇒ Object
overridden by subclass
409 410 411 |
# File 'lib/langhelp/langhelp-base.rb', line 409 def pre_process(html_src) html_src end |
#space ⇒ Object
number of spaces between label and sexp
404 405 406 |
# File 'lib/langhelp/langhelp-base.rb', line 404 def space " "*@spaces end |
#to_e(out) ⇒ Object
Dump into e-script pre_process -> HTML2TXT -> post_process
420 421 422 423 424 425 426 427 |
# File 'lib/langhelp/langhelp-base.rb', line 420 def to_e(out) find_index unless @index_page f = Tempfile.new("lh") f.puts(pre_process(kconv{ File.read(@index_page) })) f.close out << post_process(kconv{ `#{conf[:HTML2TXT]} #{f.path}` }) end |