[ HOME ] also see SiSU Metadata Harvest - Authors
'
@alph.each do |x|
a << if x =~/[0-9]/; ''
else
%{#{x}, }
end
end
@output[:html_mnt] << a if @opt.cmd.inspect =~/-M/
@output[:html] << a.join
end
def html_tail
a=[]
a <<<
#{string}
} do_html(html) do_html_maintenance(html) if @output[:html_mnt].class==File end def do_string_default(attrib,string) html=%{#{string}
} do_html(html) end def do_string_maintenance(attrib,string) html=%{#{string}
} do_html_maintenance(html) if @output[:html_mnt].class==File end def do_string_name(attrib,string) f=/^(\S)/.match(string)[1] if @letter < f while @letter < f if @alph.length > 0 @letter=@alph.shift if @output[:html_mnt].class==File @output[:html_mnt] << %{\n} end @output[:html] << %{\n} else break end end end name=string.strip.gsub(/\s+/,'_') html=%{} do_html(html) do_html_maintenance(html) if @output[:html_mnt].class==File end def do_array(lv,array) lv+=1 array.each do |b| do_case(lv,b) end end def do_hash_md(attrib,hash) html=%{#{hash[:title]} - #{hash[:author]}} do_string_default(attrib,html) end def do_hash_md_maintenance(attrib,hash) if @output[:html_mnt].class==File #should not be run for presentation output html=%{[src] #{hash[:title]} - #{hash[:author]}} do_string_maintenance(attrib,html) end end def do_hash(lv,hash) lv+=1 key=[] hash.each_key do |m| if m == :md do_case(lv,hash[m]) elsif m != :title and m != :author and m != :filename and m != :file and m != :rough_idx and m != :page key << m elsif m == :title do_hash_md('work',hash) do_hash_md_maintenance('work',hash) end end if key.length > 0 key.sort.each do |m| attrib="lev#{lv}" lv==0 ? do_string_name(attrib,m) : do_string(attrib,m) do_case(lv,hash[m]) end end end def do_case(lv,a) y = a.class case when y==String attrib="lev#{lv}" lv==0 ? do_string_name(attrib,a) : do_string(attrib,a) when y==Array do_array(lv,a) when y==Hash do_hash(lv,a) end end def html_body the_idx=@the_idx the_idx.sort.each do |a| do_case(-1,a) end end self end def screen_print def do_string(lv,string) s=' '*4 puts s*lv + string end def do_array(lv,array) lv+=1 array.each do |b| do_case(lv,b) end end def do_hash_md(lv,hash) string=hash[:title] + ' - ' + hash[:author] do_string(lv,string) end def do_hash(lv,hash) lv+=1 key=[] hash.each_key do |m| if m == :md do_case(lv,hash[m]) elsif m != :title and m != :author and m != :filename and m != :file and m != :rough_idx and m != :page key << m elsif m == :title do_hash_md(lv,hash) end end if key.length > 0 key.sort.each do |m| do_string(lv,m) do_case(lv,hash[m]) end end end def do_case(lv,a) s=' '*4 y = a.class case when y==String do_string(lv,a) when y==Array do_array(lv,a) when y==Hash do_hash(lv,a) end end def cycle the_idx=@the_idx the_idx.each do |a| do_case(-1,a) end end self end def screen_print_unsorted def do_string(lv,string) s=' '*4 puts s*lv + string end def do_array(lv,array) lv+=1 array.each do |b| do_case(lv,b) end end def do_hash_md(lv,hash) string=hash[:title] + ' - ' + hash[:author] do_string(lv,string) end def do_hash(lv,hash) lv+=1 hash.each_key do |m| if m == :md do_case(lv,hash[m]) else if m != :title and m != :author and m != :filename and m != :file and m != :rough_idx and m != :page do_string(lv,m) do_case(lv,hash[m]) elsif m == :title do_hash_md(lv,hash) else end end end end def do_case(lv,a) s=' '*4 y = a.class case when y==String do_string(lv,a) when y==Array do_array(lv,a) when y==Hash do_hash(lv,a) end end def cycle the_idx=@the_idx the_idx.each do |a| do_case(-1,a) end end self end end end __END__ terms -|_ t{tl1} -|_ {fa}[fa]{filenames and other details} | |_ {tl2} -|_ {fa}[fa]{filenames and other details} | | |_{tl3} -|_ {fa}[fa]{filenames and other details} | | | |_{tl4} - {fa}[fa]{filenames and other details} | | | | | | | |_{tl4a} - {fa}[fa]{filenames and other details} | | | | | | | |_{tl4b} - {fa}[fa]{filenames and other details} | | | | | | | |_ ... | | | | | |_{tl3a} - {fa}[fa]{filenames and other details} | | | |_{tl2a} - {fa}[fa]{filenames and other details} | |_ t{tl1a} -|_ {fa}[fa]{filenames and other details} |_ ...