diff options
author | Ralph Amissah <ralph@amissah.com> | 2012-05-01 23:30:34 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2012-05-01 23:31:05 -0400 |
commit | aae35fa1dd9c736bbb8dc93e66fed2188007465c (patch) | |
tree | cbcbfa8ff24b3ce8668e9a15edab8a4ea9d4b9bf /lib/sisu/v3/harvest_authors.rb | |
parent | v3: 3.2.6 version & changelog "opened" (diff) |
v3: harvest (metadata, site/document summary) fixes
* harvest_topics, sort fix
* harvest_authors, minor fix
* sst content parsing lang dir
* output file location, currently works for (by?) :language & :filetype
Diffstat (limited to 'lib/sisu/v3/harvest_authors.rb')
-rw-r--r-- | lib/sisu/v3/harvest_authors.rb | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/lib/sisu/v3/harvest_authors.rb b/lib/sisu/v3/harvest_authors.rb index 5bb702be..2c541c48 100644 --- a/lib/sisu/v3/harvest_authors.rb +++ b/lib/sisu/v3/harvest_authors.rb @@ -57,7 +57,7 @@ ** Description: simple xml representation (sax style) =end -module SiSU_Harvest_Authors +module SiSU_HarvestAuthors require_relative 'author_format' # author_format.rb class Songsheet @@the_idx_authors={} @@ -85,11 +85,11 @@ module SiSU_Harvest_Authors end lang_hash_file_array.each_pair do |lang,a| idx_array[lang] ||= [] - idx_array=SiSU_Harvest_Authors::Harvest.new(@opt,@env,a,filename,name,idx_array,lang).extract_harvest + idx_array=SiSU_HarvestAuthors::Harvest.new(@opt,@env,a,filename,name,idx_array,lang).extract_harvest end end - the_idx=SiSU_Harvest_Authors::Index.new(idx_array,@@the_idx_authors).construct_book_author_index - SiSU_Harvest_Authors::OutputIndex.new(@opt,the_idx).html_print.html_songsheet + the_idx=SiSU_HarvestAuthors::Index.new(idx_array,@@the_idx_authors).construct_book_author_index + SiSU_HarvestAuthors::OutputIndex.new(@opt,the_idx).html_print.html_songsheet end end class Harvest @@ -130,7 +130,7 @@ module SiSU_Harvest_Authors else name.sub(/\.ss[mt]$/,'') end - page=if @env.output_dir_structure.by_language_code? + page=if @env.output_dir_structure.by? == :language "#{lang}/sisu_manifest.html" else "sisu_manifest.#{lang}.html" @@ -174,7 +174,8 @@ module SiSU_Harvest_Authors @opt,@the_idx=opt,the_idx @env=SiSU_Env::InfoEnv.new @rc=SiSU_Env::GetInit.instance.sisu_yaml.rc - @alph=%W[9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z] + @alphabet_list=%W[9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z] + @alph=@alphabet_list.dup @letter=@alph.shift @vz=SiSU_Env::GetInit.instance.skin end @@ -183,7 +184,7 @@ module SiSU_Harvest_Authors @output ||={} @output[lng] ||={} harvest_pth,file='','' - if @env.output_dir_structure.by_language_code? + if @env.output_dir_structure.by? == :language harvest_pth="#{@env.path.webserv}/#{@opt.base_stub}/#{lng}/manifest" file="#{harvest_pth}/authors.html" else @@ -212,17 +213,17 @@ module SiSU_Harvest_Authors end def html_head_adjust(lng,type='') css_path,topics='','' - if @env.output_dir_structure.by_language_code? + if @env.output_dir_structure.by? == :language css_path=(type !~/maintenance/) \ ? '../../_sisu/css/harvest.css' : 'harvest.css' topics='topics.html' - elsif @env.output_dir_structure.by_filetype? + elsif @env.output_dir_structure.by? == :filetype css_path=(type !~/maintenance/) \ ? '../_sisu/css/harvest.css' : 'harvest.css' topics="topics.#{lng}.html" - elsif @env.output_dir_structure.by_filename? + elsif @env.output_dir_structure.by? == :filename css_path=(type !~/maintenance/) \ ? '../_sisu/css/harvest.css' : 'harvest.css' @@ -231,10 +232,10 @@ module SiSU_Harvest_Authors ln=SiSU_i18n::Languages.new.language.list harvest_languages='' @the_idx.keys.each do |lng| - if @env.output_dir_structure.by_language_code? + if @env.output_dir_structure.by? == :language harvest_pth="../../#{lng}/manifest" file="#{harvest_pth}/authors.html" - else @env.output_dir_structure.by_filetype? + else @env.output_dir_structure.by? == :filetype harvest_pth='.' file="#{harvest_pth}/authors.#{lng}.html" end @@ -312,6 +313,11 @@ WOK end def do_string_name(lng,attrib,string) f=/^(\S)/.match(string[0])[1] + if @lng != lng + @alph=@alphabet_list.dup + @letter=@alph.shift + @lng = lng + end if @letter < f while @letter < f if @alph.length > 0 @@ -338,13 +344,13 @@ WOK @output[lng][:html] << x works=[] a[1][:md].each do |x| - if @env.output_dir_structure.by_language_code? + if @env.output_dir_structure.by? == :language manifest_pth="#{@env.path.output}/#{x[:file]}" manifest_at=x[:file] + '.html' - elsif @env.output_dir_structure.by_filetype? + elsif @env.output_dir_structure.by? == :filetype manifest_name=x[:file] manifest_at=x[:file] + '.' + lng + '.html' - elsif @env.output_dir_structure.by_filename? + elsif @env.output_dir_structure.by? == :filename manifest_at="../#{x[:file]}/#{x[:page]}" end work=[ "#{x[:date]} #{x[:title]}", %{<p class="publication">#{x[:date]} <a href="#{manifest_at}">#{x[:title]}</a>, #{x[:author][:authors_s]}</p>} ] |