From 0e42ce6f34c3cfdf370f439f58c4e3de8b05ea92 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 6 Jan 2014 22:42:31 -0500 Subject: v5: cosmetic code, case statement --- data/doc/sisu/CHANGELOG_v5 | 2 + lib/sisu/v5/ao_doc_objects.rb | 36 +-- lib/sisu/v5/ao_doc_str.rb | 110 ++++---- lib/sisu/v5/ao_expand_insertions.rb | 12 +- lib/sisu/v5/ao_numbering.rb | 6 +- lib/sisu/v5/cgi_pgsql.rb | 2 +- lib/sisu/v5/cgi_sqlite.rb | 6 +- lib/sisu/v5/concordance.rb | 6 +- lib/sisu/v5/db_import.rb | 6 +- lib/sisu/v5/db_load_tuple.rb | 10 +- lib/sisu/v5/db_select.rb | 8 +- lib/sisu/v5/dbi.rb | 4 +- lib/sisu/v5/defaults.rb | 20 +- lib/sisu/v5/digests.rb | 24 +- lib/sisu/v5/html.rb | 12 +- lib/sisu/v5/html_minitoc.rb | 12 +- lib/sisu/v5/i18n.rb | 140 +++++----- lib/sisu/v5/manpage.rb | 20 +- lib/sisu/v5/options.rb | 88 +++---- lib/sisu/v5/param.rb | 8 +- lib/sisu/v5/param_identify_markup.rb | 4 +- lib/sisu/v5/po4a.rb | 14 +- lib/sisu/v5/po4a_set.rb | 92 +++---- lib/sisu/v5/prog_text_translation.rb | 458 ++++++++++++++++----------------- lib/sisu/v5/screen_text_color.rb | 118 ++++----- lib/sisu/v5/sst_convert_markup.rb | 32 +-- lib/sisu/v5/sst_do_inline_footnotes.rb | 4 +- lib/sisu/v5/sysenv.rb | 178 ++++++------- lib/sisu/v5/texinfo.rb | 6 +- lib/sisu/v5/texpdf.rb | 24 +- lib/sisu/v5/texpdf_format.rb | 264 +++++++++---------- lib/sisu/v5/txt_asciidoc.rb | 6 +- lib/sisu/v5/txt_markdown.rb | 6 +- lib/sisu/v5/txt_plain.rb | 18 +- lib/sisu/v5/txt_rst.rb | 6 +- lib/sisu/v5/txt_shared.rb | 92 +++---- lib/sisu/v5/txt_textile.rb | 18 +- lib/sisu/v5/utils.rb | 38 +-- lib/sisu/v5/wikispeak.rb | 8 +- lib/sisu/v5/xhtml.rb | 12 +- lib/sisu/v5/xhtml_epub2_concordance.rb | 6 +- lib/sisu/v5/xml_odf_odt_format.rb | 30 +-- lib/sisu/v5/xml_sax.rb | 12 +- 43 files changed, 984 insertions(+), 994 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 3708b83f..9cc283db 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -45,6 +45,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.1.4.orig.tar.xz * docbook, fictionbook, some tidying +* cosmetic, code case statement + * year updated, code headers %% 5.1.3.orig.tar.xz (2013-12-15:49/7) diff --git a/lib/sisu/v5/ao_doc_objects.rb b/lib/sisu/v5/ao_doc_objects.rb index 30c4ec55..229edee4 100644 --- a/lib/sisu/v5/ao_doc_objects.rb +++ b/lib/sisu/v5/ao_doc_objects.rb @@ -108,28 +108,28 @@ module SiSU_AO_DocumentStructure end def heading_ln(lv) case lv - when /A/; 1 - when /B/; 2 - when /C/; 3 - when /1/; 4 - when /2/; 5 - when /3/; 6 - when /4/; 7 - when /5/; 8 - when /6/; 9 + when /A/ then 1 + when /B/ then 2 + when /C/ then 3 + when /1/ then 4 + when /2/ then 5 + when /3/ then 6 + when /4/ then 7 + when /5/ then 8 + when /6/ then 9 end end def heading_lv(ln) case ln.to_s - when /1/; 'A' - when /2/; 'B' - when /3/; 'C' - when /4/; '1' - when /5/; '2' - when /6/; '3' - when /7/; '4' - when /8/; '5' - when /9/; '6' + when /1/ then 'A' + when /2/ then 'B' + when /3/ then 'C' + when /4/ then '1' + when /5/ then '2' + when /6/ then '3' + when /7/ then '4' + when /8/ then '5' + when /9/ then '6' end end def heading(h,o=nil) diff --git a/lib/sisu/v5/ao_doc_str.rb b/lib/sisu/v5/ao_doc_str.rb index 40be4e30..f1e73362 100644 --- a/lib/sisu/v5/ao_doc_str.rb +++ b/lib/sisu/v5/ao_doc_str.rb @@ -97,15 +97,15 @@ module SiSU_AO_DocumentStructureExtract end def ln_get(lv) case lv - when /A/; 1 - when /B/; 2 - when /C/; 3 - when /1/; 4 - when /2/; 5 - when /3/; 6 - when /4/; 7 - when /5/; 8 - when /6/; 9 + when /A/ then 1 + when /B/ then 2 + when /C/ then 3 + when /1/ then 4 + when /2/ then 5 + when /3/ then 6 + when /4/ then 7 + when /5/ then 8 + when /6/ then 9 end end def image_test(str) @@ -401,8 +401,8 @@ module SiSU_AO_DocumentStructureExtract elsif @@flag[:code]==:off if t_o =~/^(?:code\{|[`]{3}\s+code)/ @@flag[:code]=case t_o - when /^code\{/; :curls - when /^[`]{3}\s+code/; :tics + when /^code\{/ then :curls + when /^[`]{3}\s+code/ then :tics else @@flag[:code] #error end @@counter=1 @@ -411,8 +411,8 @@ module SiSU_AO_DocumentStructureExtract t_o=SiSU_AO_DocumentStructure::ObjectComment.new.comment(h) elsif t_o =~/^(?:poem\{|[`]{3}\s+poem)/ @@flag[:poem]=case t_o - when /^poem\{/; :curls - when /^[`]{3}\s+poem/; :tics + when /^poem\{/ then :curls + when /^[`]{3}\s+poem/ then :tics else @@flag[:poem] #error end h={ obj: 'poem start' } #introduce a counter @@ -420,8 +420,8 @@ module SiSU_AO_DocumentStructureExtract tuned_file << t_o elsif t_o =~/^(?:group\{|[`]{3}\s+group)/ @@flag[:group]=case t_o - when /^group\{/; :curls - when /^[`]{3}\s+group/; :tics + when /^group\{/ then :curls + when /^[`]{3}\s+group/ then :tics else @@flag[:group] #error end h={ obj: 'group text start' } #introduce a counter @@ -429,8 +429,8 @@ module SiSU_AO_DocumentStructureExtract tuned_file << t_o elsif t_o =~/^(?:block\{|[`]{3}\s+block)/ @@flag[:block]=case t_o - when /^block\{/; :curls - when /^[`]{3}\s+block/; :tics + when /^block\{/ then :curls + when /^[`]{3}\s+block/ then :tics else @@flag[:block] #error end h={ obj: 'block text start' } #introduce a counter @@ -438,8 +438,8 @@ module SiSU_AO_DocumentStructureExtract tuned_file << t_o elsif t_o =~/^(?:alt\{|[`]{3}\s+alt)/ @@flag[:alt]=case t_o - when /^alt\{/; :curls - when /^[`]{3}\s+alt/; :tics + when /^alt\{/ then :curls + when /^[`]{3}\s+alt/ then :tics else @@flag[:alt] #error end h={ obj: 'alt text start' } #introduce a counter @@ -803,34 +803,22 @@ module SiSU_AO_DocumentStructureExtract end def possible_parents(child) case child - when /A~/ - 'none' - when /B~/ - 'A~' - when /C~/ - 'B~' - when /1/ - 'A~, B~, C~' - when /2/ - '1' - when /3/ - '2' + when /A~/ then 'none' + when /B~/ then 'A~' + when /C~/ then 'B~' + when /1/ then 'A~, B~, C~' + when /2/ then '1' + when /3/ then '2' end end def possible_children(parent) case parent - when /A~/ - 'B~, 1' - when /B~/ - 'C~, 1' - when /C~/ - '1' - when /1/ - '2' - when /2/ - '3' - when /3/ - 'none' + when /A~/ then 'B~, 1' + when /B~/ then 'C~, 1' + when /C~/ then '1' + when /1/ then '2' + when /2/ then '3' + when /3/ then 'none' end end self @@ -873,15 +861,15 @@ has incorrect level and/or parent level} #dob.ln now is determined, and set earlier, check how best to remove this --> if dob.is==:heading ln=case dob.lv - when 'A'; 1 - when 'B'; 2 - when 'C'; 3 - when '1'; 4 - when '2'; 5 - when '3'; 6 - when '4'; 7 - when '5'; 8 - when '6'; 9 + when 'A' then 1 + when 'B' then 2 + when 'C' then 3 + when '1' then 4 + when '2' then 5 + when '3' then 6 + when '4' then 7 + when '5' then 8 + when '6' then 9 end end if not dob.obj =~/~#|-#/ @@ -1245,15 +1233,15 @@ or this level should be 5~ rather #{dob.lv}" #level 6 ? %{<#{o[:lv]} id="#{o[:node]}">} : "" ln=case o[:lv] - when 'A'; 1 - when 'B'; 2 - when 'C'; 3 - when '1'; 4 - when '2'; 5 - when '3'; 6 - when '4'; 7 - when '5'; 8 - when '6'; 9 + when 'A' then 1 + when 'B' then 2 + when 'C' then 3 + when '1' then 4 + when '2' then 5 + when '3' then 6 + when '4' then 7 + when '5' then 8 + when '6' then 9 end h={ tag: tag, node: o[:node], lv: o[:lv], ln: ln, status: o[:status] } SiSU_AO_DocumentStructure::ObjectStructure.new.xml_dom(h) #downstream code utilise else ignore like comments diff --git a/lib/sisu/v5/ao_expand_insertions.rb b/lib/sisu/v5/ao_expand_insertions.rb index a306787a..60117e1d 100644 --- a/lib/sisu/v5/ao_expand_insertions.rb +++ b/lib/sisu/v5/ao_expand_insertions.rb @@ -68,12 +68,12 @@ module SiSU_AO_Insertions def output_filetypes_in_cmd(cmd_shortcut,lnk=nil) #make list of file types in shortcut command (as configured), e.g. when sisu -3 is used cf_defaults=SiSU_Env::InfoProcessingFlag.new cmd_list=case cmd_shortcut.inspect - when /0/; cf_defaults.cf_0 - when /1/; cf_defaults.cf_1 - when /2/; cf_defaults.cf_2 - when /3/; cf_defaults.cf_3 - when /4/; cf_defaults.cf_4 - when /5/; cf_defaults.cf_5 + when /0/ then cf_defaults.cf_0 + when /1/ then cf_defaults.cf_1 + when /2/ then cf_defaults.cf_2 + when /3/ then cf_defaults.cf_3 + when /4/ then cf_defaults.cf_4 + when /5/ then cf_defaults.cf_5 end file_type_names={} file_type_names[:gen],file_type_names[:src]=[],[] diff --git a/lib/sisu/v5/ao_numbering.rb b/lib/sisu/v5/ao_numbering.rb index 5a91a118..0458d626 100644 --- a/lib/sisu/v5/ao_numbering.rb +++ b/lib/sisu/v5/ao_numbering.rb @@ -98,9 +98,9 @@ module SiSU_AO_Numbering def number_sub_heading(dob,num,title_no) unless dob.obj =~/\d+\.|(?:chapter|article|section|clause)\s+\d+/i #name selection arbitrary, fix dob.obj=case dob.name - when /-/; dob.obj.gsub(/^/,"#{title_no} ") - when /^#/; dob.obj.gsub(/^/,"#{title_no} ") - when /^[a-z_\.]+/; dob.obj.gsub(/^/,"#{title_no} ") + when /-/ then dob.obj.gsub(/^/,"#{title_no} ") + when /^#/ then dob.obj.gsub(/^/,"#{title_no} ") + when /^[a-z_\.]+/ then dob.obj.gsub(/^/,"#{title_no} ") else dob.name=title_no if dob.name=~/^$/ #where title contains title number dob.obj.gsub(/^/,"#{title_no} ") if title_no =~/\d+/ #main, where title number is to be provided #watch changed placement diff --git a/lib/sisu/v5/cgi_pgsql.rb b/lib/sisu/v5/cgi_pgsql.rb index a16b94bd..33e43b46 100644 --- a/lib/sisu/v5/cgi_pgsql.rb +++ b/lib/sisu/v5/cgi_pgsql.rb @@ -167,7 +167,7 @@ module SiSU_CGI_PgSQL # set file permissions to 755 WOK a=case @webserv - when /pwd/; '' + when /pwd/ then '' else <<-WOK sudo cp -vi #{Dir.pwd}/#{@cgi_file_name} /usr/lib/cgi-bin/.; \\ diff --git a/lib/sisu/v5/cgi_sqlite.rb b/lib/sisu/v5/cgi_sqlite.rb index 243fa3ab..8ebe0c16 100644 --- a/lib/sisu/v5/cgi_sqlite.rb +++ b/lib/sisu/v5/cgi_sqlite.rb @@ -100,13 +100,13 @@ module SiSU_CGI_SQLite end f2 << %{ selected_db=case cgi['db']\n} serve.each do |x| - f2 << %{ when /#{Db[:name_prefix]}#{x}/; ''\n} + f2 << %{ when /#{Db[:name_prefix]}#{x}/ then ''\n} end f2 << " end\n" f3 << %{ db_name='#{@name_of_sqlite_db_file}'\n} f3 << %{ db_sqlite=case cgi['db']\n} serve.each do |x| - f3 << %{ when /#{Db[:name_prefix]}#{x}/; "#{@env.path.webserv}/#{x}/\#{db_name}"\n} + f3 << %{ when /#{Db[:name_prefix]}#{x}/ then "#{@env.path.webserv}/#{x}/\#{db_name}"\n} end f3 << %{ else '#{@env.path.webserv}/#{serve[0]}/\#{db_name}'\n end\n} if FileTest.writable?('.') @@ -139,7 +139,7 @@ module SiSU_CGI_SQLite # set file permissions to 755 WOK a=case @webserv - when /pwd/; '' + when /pwd/ then '' else <<-WOK sudo cp -vi #{Dir.pwd}/#{@cgi_file_name} /usr/lib/cgi-bin/.; \\ diff --git a/lib/sisu/v5/concordance.rb b/lib/sisu/v5/concordance.rb index 996b6530..55892ab7 100644 --- a/lib/sisu/v5/concordance.rb +++ b/lib/sisu/v5/concordance.rb @@ -327,9 +327,9 @@ WOK end else @word_map[word] << case line - when @rxp_lv1; location_seg('T1',ocn) #fix @rxp_lv # Mx[:lv_o] - when @rxp_lv2; location_seg('T2',ocn) #fix @rxp_lv # Mx[:lv_o] - when @rxp_lv3; location_seg('T3',ocn) #fix @rxp_lv # Mx[:lv_o] + when @rxp_lv1 then location_seg('T1',ocn) #fix @rxp_lv # Mx[:lv_o] + when @rxp_lv2 then location_seg('T2',ocn) #fix @rxp_lv # Mx[:lv_o] + when @rxp_lv3 then location_seg('T3',ocn) #fix @rxp_lv # Mx[:lv_o] end end end diff --git a/lib/sisu/v5/db_import.rb b/lib/sisu/v5/db_import.rb index e94caa83..2289613d 100644 --- a/lib/sisu/v5/db_import.rb +++ b/lib/sisu/v5/db_import.rb @@ -330,9 +330,9 @@ module SiSU_DbImport t=SiSU_DbTuple::LoadDocuments.new(@conn,@col,@opt,@file_maint) @tuple_array << t.tuple case @col[:lev] - when /1/; @col[:lv1]+=1 - when /2/; @col[:lv2]+=1 - when /3/; @col[:lv3]+=1 + when /1/ then @col[:lv1]+=1 + when /2/ then @col[:lv2]+=1 + when /3/ then @col[:lv3]+=1 end @col[:lev]=@col[:plaintext]=@col[:body]='' elsif data.is==:heading \ diff --git a/lib/sisu/v5/db_load_tuple.rb b/lib/sisu/v5/db_load_tuple.rb index 5c71a189..9bad5757 100644 --- a/lib/sisu/v5/db_load_tuple.rb +++ b/lib/sisu/v5/db_load_tuple.rb @@ -104,11 +104,11 @@ module SiSU_DbTuple if @opt.act[:verbose][:set]==:on if @col[:lev].inspect =~/[12356789]/ lev=case @col[:lev].inspect - when /1/; ':A' - when /2/; ':B' - when /3/; ':C' - when /5/; ' 2' - when /6/; ' 3' + when /1/ then ':A' + when /2/ then ':B' + when /3/ then ':C' + when /5/ then ' 2' + when /6/ then ' 3' end puts %{#{lev}>\t#{@col[:lv1]}\t#{@col[:lv2]}\t#{@col[:lv3]}\t#{@col[:lv4]}\t#{@col[:lv5]}\t#{@col[:lv6]}\t#{@col[:ocn]}\t#{@col[:node]}\t#{@col[:ocns]}} elsif @col[:lev].inspect =~/[4]/ diff --git a/lib/sisu/v5/db_select.rb b/lib/sisu/v5/db_select.rb index d8f5dc27..06d8c429 100644 --- a/lib/sisu/v5/db_select.rb +++ b/lib/sisu/v5/db_select.rb @@ -173,8 +173,8 @@ module SiSU_DbSelect db_exist? @sdb_import.marshal_load tell=case @sql_type - when /sqlite/; SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],"sqlite3 #{@db.sqlite.db} database?") - when /pg/; SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],"pgaccess or psql #{@db.psql.db} database?") + when /sqlite/ then SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],"sqlite3 #{@db.sqlite.db} database?") + when /pg/ then SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],"pgaccess or psql #{@db.psql.db} database?") else '???' end tell.puts_grey if @opt.act[:verbose][:set]==:on @@ -183,8 +183,8 @@ module SiSU_DbSelect @sdb_remove_doc.remove @sdb_import.marshal_load tell=case @sql_type - when /sqlite/; SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],"sqlite3 #{@db.sqlite.db} database?") - when /pg/; SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],"pgaccess or psql #{@db.psql.db} database?") + when /sqlite/ then SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],"sqlite3 #{@db.sqlite.db} database?") + when /pg/ then SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],"pgaccess or psql #{@db.psql.db} database?") else '???' end tell.puts_grey if @opt.act[:verbose][:set]==:on diff --git a/lib/sisu/v5/dbi.rb b/lib/sisu/v5/dbi.rb index ee88d14e..d92f1964 100644 --- a/lib/sisu/v5/dbi.rb +++ b/lib/sisu/v5/dbi.rb @@ -127,8 +127,8 @@ manually create the database: "#{cX.green}#{@db.db}#{cX.off}" if it does not yet end def connect case @sql_type - when /pg/; read_psql - when /sqlite/; read_sqlite + when /pg/ then read_psql + when /sqlite/ then read_sqlite end SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],"DBI (#{@sql_type}) #{@opt.mod}",@opt.fno).dbi_title unless @opt.act[:quiet][:set]==:on begin diff --git a/lib/sisu/v5/defaults.rb b/lib/sisu/v5/defaults.rb index aad8970d..fd56c2c4 100644 --- a/lib/sisu/v5/defaults.rb +++ b/lib/sisu/v5/defaults.rb @@ -564,8 +564,8 @@ module SiSU_Viz if italics_list r=italics_list.dup x=case r - when /\/i$/; 'i' - else '' + when /\/i$/ then 'i' + else '' end r=r.gsub(/^\/(.+?)\/i?/,'\1'). gsub(/\(/,'(?:') # avoid need to escape use of brackets within regex provided @@ -585,8 +585,8 @@ module SiSU_Viz if bold_list r=bold_list.dup x=case r - when /\/i$/; 'i' - else '' + when /\/i$/ then 'i' + else '' end r.gsub(/^\/(.+?)\/i?/,'\1'). gsub(/\(/,'(?:') # avoid need to escape use of brackets within regex provided @@ -1199,12 +1199,12 @@ WOK end def dimensions case @papersize - when /a4/; a4 - when /letter/; letter - when /legal/; legal - when /b5/; b5 - when /a5/; a5 - else a4 + when /a4/ then a4 + when /letter/ then letter + when /legal/ then legal + when /b5/ then b5 + when /a5/ then a5 + else a4 end end end diff --git a/lib/sisu/v5/digests.rb b/lib/sisu/v5/digests.rb index e5f0b0ae..2b010374 100644 --- a/lib/sisu/v5/digests.rb +++ b/lib/sisu/v5/digests.rb @@ -336,17 +336,17 @@ module SiSU_DigestView data.each do |t_o| if t_o.is==:heading x=case t_o.ln - when 1; l[1] +=1 #fix Mx[:lv_o] + when 1 then l[1] +=1 #fix Mx[:lv_o] ' '*0 << ':A' - when 2; l[2] +=1 #fix Mx[:lv_o] + when 2 then l[2] +=1 #fix Mx[:lv_o] ' '*1 << ':B' - when 3; l[3] +=1 #fix Mx[:lv_o] + when 3 then l[3] +=1 #fix Mx[:lv_o] ' '*2 << ':C' - when 4; l[4] +=1 #fix Mx[:lv_o] + when 4 then l[4] +=1 #fix Mx[:lv_o] ' '*3 << '1' - when 5; l[5] +=1 #fix Mx[:lv_o] + when 5 then l[5] +=1 #fix Mx[:lv_o] ' '*4 << '2' - when 6; l[6] +=1 #fix Mx[:lv_o] + when 6 then l[6] +=1 #fix Mx[:lv_o] ' '*5 << '3' else nil end @@ -359,12 +359,12 @@ module SiSU_DigestView ao_structure_summary("document structure[*]\n") [0,1,2,3,4,5,6].each do |y| v=case y - when 1; ':A' - when 2; ':B' - when 3; ':C' - when 4; '1 ' - when 5; '2 ' - when 6; '3 ' + when 1 then ':A' + when 2 then ':B' + when 3 then ':C' + when 4 then '1 ' + when 5 then '2 ' + when 6 then '3 ' end ao_structure_summary("#{v} = #{l[y]}\n") if l[y] > 0 end diff --git a/lib/sisu/v5/html.rb b/lib/sisu/v5/html.rb index fda8e8ab..4ff58c43 100644 --- a/lib/sisu/v5/html.rb +++ b/lib/sisu/v5/html.rb @@ -259,12 +259,12 @@ module SiSU_HTML toc=if dob_toc.is ==:heading \ || dob.is==:heading_insert toc=case dob_toc.ln - when 1; SiSU_HTML::Source::Toc.new(@md,dob_toc).level_1 - when 2; SiSU_HTML::Source::Toc.new(@md,dob_toc).level_2 - when 3; SiSU_HTML::Source::Toc.new(@md,dob_toc).level_3 - when 4; SiSU_HTML::Source::Toc.new(@md,dob_toc).level_4 - when 5; SiSU_HTML::Source::Toc.new(@md,dob_toc).level_5 - when 6; SiSU_HTML::Source::Toc.new(@md,dob_toc).level_6 + when 1 then SiSU_HTML::Source::Toc.new(@md,dob_toc).level_1 + when 2 then SiSU_HTML::Source::Toc.new(@md,dob_toc).level_2 + when 3 then SiSU_HTML::Source::Toc.new(@md,dob_toc).level_3 + when 4 then SiSU_HTML::Source::Toc.new(@md,dob_toc).level_4 + when 5 then SiSU_HTML::Source::Toc.new(@md,dob_toc).level_5 + when 6 then SiSU_HTML::Source::Toc.new(@md,dob_toc).level_6 else nil end end diff --git a/lib/sisu/v5/html_minitoc.rb b/lib/sisu/v5/html_minitoc.rb index 0ca5b95c..65cfe91a 100644 --- a/lib/sisu/v5/html_minitoc.rb +++ b/lib/sisu/v5/html_minitoc.rb @@ -89,12 +89,12 @@ gsub(@pat_strip_heading_name,'\1') #gsub(/(.*?)<\/a>(.*)/,'\1') #2002w42 altered gsub - problematic? - suspect toc=case txt.ln - when 1; SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_1 - when 2; SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_2 - when 3; SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_3 - when 4; SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_4 - when 5; SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_5 - when 6; SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_6 + when 1 then SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_1 + when 2 then SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_2 + when 3 then SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_3 + when 4 then SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_4 + when 5 then SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_5 + when 6 then SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_6 else end @toc << toc diff --git a/lib/sisu/v5/i18n.rb b/lib/sisu/v5/i18n.rb index caa3d7ee..cd8daba1 100644 --- a/lib/sisu/v5/i18n.rb +++ b/lib/sisu/v5/i18n.rb @@ -260,76 +260,76 @@ module SiSU_TextTranslation def tex_name(char) @lang=if char case char - when 'sq'; 'albanian' - when 'am'; 'amharic' - #when 'ar'; 'arabic' # see polyglossia - when 'hy'; 'armenian' - #when ''; 'asturian' # polyglossia - #when ''; 'bahasai' # polyglossia - #when ''; 'bahasam' # polyglossia - when 'eu'; 'basque' - when 'bn'; 'bengali' - when 'pt_BR'; 'brazilian' - when 'br'; 'breton' - when 'bg'; 'bulgarian' - when 'ca'; 'catalan' # see polyglossia - #when ''; 'coptic' # polyglossia - when 'hr'; 'croatian' - when 'cs'; 'czech' - when 'da'; 'danish' - #when ''; 'divehi' # polyglossia - when 'nl'; 'dutch' # see polyglossia - when 'en'; 'english' # see polyglossia - when 'eo'; 'esperanto' # see polyglossia - when 'et'; 'estonian' - when 'gl'; 'galician' - when 'de'; 'german' - when 'el'; 'greek' #gl ? - when 'he'; 'hebrew' - when 'hi'; 'hindi' - when 'is'; 'icelandic' - when 'ia'; 'interlingua' - when 'ga'; 'irish' - when 'it'; 'italian' - #when ''; 'farsi' # polyglossia - when 'fi'; 'finnish' - when 'fr'; 'french' - when 'lo'; 'lao' - when 'la'; 'latin' - when 'lv'; 'latvian' - when 'lt'; 'lithuanian' - #when ''; 'lsorbian' # polyglossia - #when ''; 'magyar' # polyglossia - when 'ml'; 'malayalam' - when 'mr'; 'marathi' - #when 'hu'; 'magyar' - when 'no'; 'norske' - when 'nn'; 'nynorsk' - when 'oc'; 'occitan' - when 'pl'; 'polish' - when 'pt'; 'portuges' - when 'ro'; 'romanian' - when 'ru'; 'russian' - when 'se'; 'samin' #(check sami?) - when 'sa'; 'sanskrit' - when 'sr'; 'serbian' - #when ''; 'scottish' # polyglossia (gd (Gaelic (Scots))) - when 'sk'; 'slovak' - when 'sl'; 'slovenian' - when 'es'; 'spanish' - when 'sv'; 'swedish' - when 'ta'; 'tamil' - when 'te'; 'telugu' - when 'th'; 'thai' - when 'tr'; 'turkish' - when 'tk'; 'turkmen' - when 'uk'; 'ukrainian' - when 'ur'; 'urdu' - #when ''; 'usorbian' # polyglossia - when 'vi'; 'vietnamese' - when 'cy'; 'welsh' - when 'us'; 'USenglish' # depreciated, see iso-639-2 - else 'english' + when 'sq' then 'albanian' + when 'am' then 'amharic' + #when 'ar' then 'arabic' # see polyglossia + when 'hy' then 'armenian' + #when '' then 'asturian' # polyglossia + #when '' then 'bahasai' # polyglossia + #when '' then 'bahasam' # polyglossia + when 'eu' then 'basque' + when 'bn' then 'bengali' + when 'pt_BR' then 'brazilian' + when 'br' then 'breton' + when 'bg' then 'bulgarian' + when 'ca' then 'catalan' # see polyglossia + #when '' then 'coptic' # polyglossia + when 'hr' then 'croatian' + when 'cs' then 'czech' + when 'da' then 'danish' + #when '' then 'divehi' # polyglossia + when 'nl' then 'dutch' # see polyglossia + when 'en' then 'english' # see polyglossia + when 'eo' then 'esperanto' # see polyglossia + when 'et' then 'estonian' + when 'gl' then 'galician' + when 'de' then 'german' + when 'el' then 'greek' #gl ? + when 'he' then 'hebrew' + when 'hi' then 'hindi' + when 'is' then 'icelandic' + when 'ia' then 'interlingua' + when 'ga' then 'irish' + when 'it' then 'italian' + #when '' then 'farsi' # polyglossia + when 'fi' then 'finnish' + when 'fr' then 'french' + when 'lo' then 'lao' + when 'la' then 'latin' + when 'lv' then 'latvian' + when 'lt' then 'lithuanian' + #when '' then 'lsorbian' # polyglossia + #when '' then 'magyar' # polyglossia + when 'ml' then 'malayalam' + when 'mr' then 'marathi' + #when 'hu' then 'magyar' + when 'no' then 'norske' + when 'nn' then 'nynorsk' + when 'oc' then 'occitan' + when 'pl' then 'polish' + when 'pt' then 'portuges' + when 'ro' then 'romanian' + when 'ru' then 'russian' + when 'se' then 'samin' #(check sami?) + when 'sa' then 'sanskrit' + when 'sr' then 'serbian' + #when '' then 'scottish' # polyglossia (gd (Gaelic (Scots))) + when 'sk' then 'slovak' + when 'sl' then 'slovenian' + when 'es' then 'spanish' + when 'sv' then 'swedish' + when 'ta' then 'tamil' + when 'te' then 'telugu' + when 'th' then 'thai' + when 'tr' then 'turkish' + when 'tk' then 'turkmen' + when 'uk' then 'ukrainian' + when 'ur' then 'urdu' + #when '' then 'usorbian' # polyglossia + when 'vi' then 'vietnamese' + when 'cy' then 'welsh' + when 'us' then 'USenglish' # depreciated, see iso-639-2 + else then 'english' end else 'english' end diff --git a/lib/sisu/v5/manpage.rb b/lib/sisu/v5/manpage.rb index af234596..0fe2b0b1 100644 --- a/lib/sisu/v5/manpage.rb +++ b/lib/sisu/v5/manpage.rb @@ -238,10 +238,10 @@ WOK times=wrapped.length times=78 if times > 78 @manpage[:body] << case lv - when 1; '.SH ' << wrapped.upcase << break_line << break_line - when 2..3; '.SH ' << wrapped.upcase << break_line << break_line - when 4; '.SH ' << wrapped.upcase << break_line << break_line - when 5..6; '.SH ' << wrapped.upcase << break_line << break_line + when 1 then '.SH ' << wrapped.upcase << break_line << break_line + when 2..3 then '.SH ' << wrapped.upcase << break_line << break_line + when 4 then '.SH ' << wrapped.upcase << break_line << break_line + when 5..6 then '.SH ' << wrapped.upcase << break_line << break_line end else @manpage[:body] << if wrapped =~/^\.BI\s/ # main text, contents, body KEEP @@ -341,12 +341,12 @@ WOK if dob.is==:heading manpage_structure(dob) dob.obj=case dob.ln - when 1; x.heading_body1 - when 2; x.heading_body2 - when 3; x.heading_body3 - when 4; x.heading_body4 - when 5; x.heading_body5 - when 6; x.heading_body6 + when 1 then x.heading_body1 + when 2 then x.heading_body2 + when 3 then x.heading_body3 + when 4 then x.heading_body4 + when 5 then x.heading_body5 + when 6 then x.heading_body6 end elsif dob.is==:para manpage_structure(dob) diff --git a/lib/sisu/v5/options.rb b/lib/sisu/v5/options.rb index 1feeacdd..65af15b4 100644 --- a/lib/sisu/v5/options.rb +++ b/lib/sisu/v5/options.rb @@ -494,51 +494,51 @@ module SiSU_Commandline unless m.empty? m.each do |s| case s - when /^--(?:color-toggle)$/; c=c+'c' - when /^--(?:color-off)$/; c=c+'k' - when /^--(?:conf|config|configure|init|initialize|init-site)$/; c=c+'CC' - when /^--(?:ao|dal?|machine|abstraction|abs)$/; c=c+'m' - when /^--(?:txt|text|plaintext)$/; c=c+'t' - when /^--(?:html)$/; c=c+'h' - when /^--(?:html-scroll|html-seg)$/; c=c+'H' + when /^--(?:color-toggle)$/ then c=c+'c' + when /^--(?:color-off)$/ then c=c+'k' + when /^--(?:conf|config|configure|init|initialize|init-site)$/ then c=c+'CC' + when /^--(?:ao|dal?|machine|abstraction|abs)$/ then c=c+'m' + when /^--(?:txt|text|plaintext)$/ then c=c+'t' + when /^--(?:html)$/ then c=c+'h' + when /^--(?:html-scroll|html-seg)$/ then c=c+'H' mod << s - when /^--(?:epub)$/; c=c+'e' - when /^--(?:od[ft])$/; c=c+'o' - when /^--(?:pdf)$/; c=c+'p' - when /^--pdf-(?:a4|a5|b5|legal|letter)$/; c=c+'p' - when /^--pdf-(?:p|l|portrait|landscape)$/; c=c+'L' - when /^--pdf-(?:p(?:ortrait)?|l(?:andscape)?)-(?:a4|letter|a5|b5|legal)$/; c=c+'L' - when /^--pdf-(?:a4|letter|a5|b5|legal)-(?:p(?:ortrait)?|l(?:andscape)?)$/; c=c+'L' - when /^--(?:concordance|wordmap)$/; c=c+'w' - when /^--(?:manpage|man)$/; c=c+'i' - when /^--(?:texinfo)$/; c=c+'I' - when /^--(?:xhtml)$/; c=c+'b' - when /^--(?:xml-sax)$/; c=c+'x' - when /^--(?:xml-dom)$/; c=c+'X' - when /^--(?:images)$/; c=c+'j' - when /^--(?:hash-digests)$/; c=c+'N' - when /^--(?:po4a|pot?)$/; c=c+'P' - when /^--(?:termsheet)$/; c=c+'T' - when /^--(?:manifest)$/; c=c+'y' - when /^--(?:qrcode)$/; c=c+'Q' - when /^--(?:sqlite)$/; c=c+'d' - when /^--(?:pg|pg?sql|postgresql)$/; c=c+'D' - when /^--(?:remote|rsync)$/; c=c+'R' - when /^--(?:scp)$/; c=c+'r' - when /^--(?:source)$/; c=c+'s' - when /^--(?:sisupod|pod)$/; c=c+'S' - when /^--(?:git)$/; c=c+'g' - when /^--(?:urls)$/; c=c+'U' - when /^--(?:zap|delete)$/; c=c+'Z' - when /^--(?:sample-search-form)$/; c=c+'F' - when /^--(?:webserv|webrick)$/; c=c+'W' - when /^--(?:profile)$/; c=c+'E' - when /^--(?:maintenance|keep-processing-files)$/; c=c+'M' - when /^--(?:verbose[=-]3)$/; c=c+'VM' - when /^--(?:verbose[=-]2|Verbose|VERBOSE)$/; c=c+'V' - when /^--(?:verbose(?:[=-]1)?)$/; c=c+'v' - when /^--(?:version)$/; c=c+'v' - when /^--(?:verbose[=-]0|quiet|silent)$/; c=c+'q' + when /^--(?:epub)$/ then c=c+'e' + when /^--(?:od[ft])$/ then c=c+'o' + when /^--(?:pdf)$/ then c=c+'p' + when /^--pdf-(?:a4|a5|b5|legal|letter)$/ then c=c+'p' + when /^--pdf-(?:p|l|portrait|landscape)$/ then c=c+'L' + when /^--pdf-(?:p(?:ortrait)?|l(?:andscape)?)-(?:a4|letter|a5|b5|legal)$/ then c=c+'L' + when /^--pdf-(?:a4|letter|a5|b5|legal)-(?:p(?:ortrait)?|l(?:andscape)?)$/ then c=c+'L' + when /^--(?:concordance|wordmap)$/ then c=c+'w' + when /^--(?:manpage|man)$/ then c=c+'i' + when /^--(?:texinfo)$/ then c=c+'I' + when /^--(?:xhtml)$/ then c=c+'b' + when /^--(?:xml-sax)$/ then c=c+'x' + when /^--(?:xml-dom)$/ then c=c+'X' + when /^--(?:images)$/ then c=c+'j' + when /^--(?:hash-digests)$/ then c=c+'N' + when /^--(?:po4a|pot?)$/ then c=c+'P' + when /^--(?:termsheet)$/ then c=c+'T' + when /^--(?:manifest)$/ then c=c+'y' + when /^--(?:qrcode)$/ then c=c+'Q' + when /^--(?:sqlite)$/ then c=c+'d' + when /^--(?:pg|pg?sql|postgresql)$/ then c=c+'D' + when /^--(?:remote|rsync)$/ then c=c+'R' + when /^--(?:scp)$/ then c=c+'r' + when /^--(?:source)$/ then c=c+'s' + when /^--(?:sisupod|pod)$/ then c=c+'S' + when /^--(?:git)$/ then c=c+'g' + when /^--(?:urls)$/ then c=c+'U' + when /^--(?:zap|delete)$/ then c=c+'Z' + when /^--(?:sample-search-form)$/ then c=c+'F' + when /^--(?:webserv|webrick)$/ then c=c+'W' + when /^--(?:profile)$/ then c=c+'E' + when /^--(?:maintenance|keep-processing-files)$/ then c=c+'M' + when /^--(?:verbose[=-]3)$/ then c=c+'VM' + when /^--(?:verbose[=-]2|Verbose|VERBOSE)$/ then c=c+'V' + when /^--(?:verbose(?:[=-]1)?)$/ then c=c+'v' + when /^--(?:version)$/ then c=c+'v' + when /^--(?:verbose[=-]0|quiet|silent)$/ then c=c+'q' else mod << s #mod only contains command modifiers; commands converted to character end end diff --git a/lib/sisu/v5/param.rb b/lib/sisu/v5/param.rb index a54e7de1..9585696e 100644 --- a/lib/sisu/v5/param.rb +++ b/lib/sisu/v5/param.rb @@ -958,9 +958,9 @@ module SiSU_Param raise "Old markup style in file #{@fns}, current version #{@sisu_version[:project]} #{@sisu_version[:version]} #{@sisu_version[:date_stamp]} #{@sisu_version[:date]}:\n\t\t#{para}\n\n" end @code_flag=case para - when /^code\{\s*$/; true - when /^\}code\s*$/; false - else @code_flag + when /^code\{\s*$/ then true + when /^\}code\s*$/ then false + else @code_flag end regx_header=/^@\S+?:[+-]?\s/ if para =~regx_header \ @@ -1126,7 +1126,7 @@ module SiSU_Param when /~\^(?:\s|$)/m #% processing mk=para.scan(/~\^(?:\s|$)/) mk.each { |e| @en[:mark] +=1 } - when /^\^~\s+\S/; @en[:note] +=1 #% processing + when /^\^~\s+\S/ then @en[:note] +=1 #% processing end end if para =~/~\{|\^~ |~\^|\{.+?\[[1-6]\]\}\S+?\.ss[tm]/m diff --git a/lib/sisu/v5/param_identify_markup.rb b/lib/sisu/v5/param_identify_markup.rb index b042c9bc..f6884c7d 100644 --- a/lib/sisu/v5/param_identify_markup.rb +++ b/lib/sisu/v5/param_identify_markup.rb @@ -151,8 +151,8 @@ module SiSU_MarkupType end def series s=case identify.version[:determined].to_s - when /^[01]\./; '1.0' - when /^[2]\./; '2.0' + when /^[01]\./ then '1.0' + when /^[2]\./ then '2.0' else '2.0' end "series #{s}" diff --git a/lib/sisu/v5/po4a.rb b/lib/sisu/v5/po4a.rb index 36dd360c..990600aa 100644 --- a/lib/sisu/v5/po4a.rb +++ b/lib/sisu/v5/po4a.rb @@ -821,13 +821,13 @@ GSUB @p_num=SiSU_Po4aUtils::ParagraphNumber.new(paranum) end case dob_src.is - when :heading; pot_structure_heading(dob_src,notes_s,dob_trn,notes_t) - when :para; pot_structure_para(dob_src,notes_s,dob_trn,notes_t) - when :group; pot_structure_group(dob_src,notes_s,dob_trn,notes_t) - when :block; pot_structure_block(dob_src,notes_s,dob_trn,notes_t) - when :verse; pot_structure_verse(dob_src,notes_s,dob_trn,notes_t) - when :code; pot_structure_code(dob_src,notes_s,dob_trn,notes_t) - when :table; pot_structure_table(dob_src,notes_s,dob_trn,notes_t) + when :heading then pot_structure_heading(dob_src,notes_s,dob_trn,notes_t) + when :para then pot_structure_para(dob_src,notes_s,dob_trn,notes_t) + when :group then pot_structure_group(dob_src,notes_s,dob_trn,notes_t) + when :block then pot_structure_block(dob_src,notes_s,dob_trn,notes_t) + when :verse then pot_structure_verse(dob_src,notes_s,dob_trn,notes_t) + when :code then pot_structure_code(dob_src,notes_s,dob_trn,notes_t) + when :table then pot_structure_table(dob_src,notes_s,dob_trn,notes_t) end if defined? dob_src.idx \ and not dob_src.idx.nil? \ diff --git a/lib/sisu/v5/po4a_set.rb b/lib/sisu/v5/po4a_set.rb index cca13311..33ccc33f 100644 --- a/lib/sisu/v5/po4a_set.rb +++ b/lib/sisu/v5/po4a_set.rb @@ -217,52 +217,52 @@ WOK end def start_is_match case @p - when /^#{Mx[:meta_o]}(title)#{Mx[:meta_c]}\s*(.+?)$/; header($1,@md.title.full,'meta','dc') #dc 1 - when /^#{Mx[:meta_o]}(creator|author)#{Mx[:meta_c]}\s*(.+?)$/; header('creator',$2,'meta','dc') #dc 2 - when /^#{Mx[:meta_o]}(subject)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 3 - when /^#{Mx[:meta_o]}(description)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 4 - when /^#{Mx[:meta_o]}(publisher)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 5 - when /^#{Mx[:meta_o]}(contributor)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 6 - when /^#{Mx[:meta_o]}(date)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 7 - when /^#{Mx[:meta_o]}(date\.created)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(date\.issued)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(date\.available)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(date\.valid)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(date\.modified)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(type)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 8 - when /^#{Mx[:meta_o]}(format)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 9 - when /^#{Mx[:meta_o]}(identifier)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 10 - when /^#{Mx[:meta_o]}(source)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 11 - when /^#{Mx[:meta_o]}(language)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 12 - when /^#{Mx[:meta_o]}(relation)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 13 - when /^#{Mx[:meta_o]}(coverage)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 14 - when /^#{Mx[:meta_o]}(rights)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 15 - when /^#{Mx[:meta_o]}(keywords)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(copyright)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(translator|translated_by)#{Mx[:meta_c]}\s*(.+?)$/; header('translator',$2) - when /^#{Mx[:meta_o]}(illustrator|illustrated_by)#{Mx[:meta_c]}\s*(.+?)$/; header('illustrator',$2) - when /^#{Mx[:meta_o]}(prepared_by)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(digitized_by)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(comments?)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(abstract)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(tags?)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(catalogue)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(class(?:ify)?_loc)#{Mx[:meta_c]}\s*(.+?)$/; header('classify_loc',$2,'meta','extra') - when /^#{Mx[:meta_o]}(class(?:ify)?_dewey)#{Mx[:meta_c]}\s*(.+?)$/; header('classify_dewey',$2,'meta','extra') - when /^#{Mx[:meta_o]}(class(?:ify)?_pg)#{Mx[:meta_c]}\s*(.+?)$/; header('classify_pg',$2,'meta','extra') - when /^#{Mx[:meta_o]}(class(?:ify)?_isbn)#{Mx[:meta_c]}\s*(.+?)$/; header('classify_isbn',$2,'meta','extra') - when /^#{Mx[:meta_o]}(toc|structure)#{Mx[:meta_c]}\s*(.+?)$/; header('structure',$2,'process','instruct') - when /^#{Mx[:meta_o]}(level|page|markup)#{Mx[:meta_c]}\s*(.+?)$/; header('markup',$2,'process','instruct') - when /^#{Mx[:meta_o]}(bold)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') - when /^#{Mx[:meta_o]}(italics|itali[sz]e)#{Mx[:meta_c]}\s*(.+?)$/; header('italicize',$2,'process','instruct') - when /^#{Mx[:meta_o]}(vocabulary|wordlist)#{Mx[:meta_c]}\s*(.+?)$/; header('vocabulary',$2,'process','instruct') - when /^#{Mx[:meta_o]}(css|stylesheet)#{Mx[:meta_c]}\s*(.+?)$/; header('css',$2,'process','instruct') - when /^#{Mx[:meta_o]}(links)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') - when /^#{Mx[:meta_o]}(prefix)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') #add a & b - when /^#{Mx[:meta_o]}(suffix)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') - when /^#{Mx[:meta_o]}(information)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') - when /^#{Mx[:meta_o]}(contact)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') - when /^#{Mx[:meta_o]}(rcs|cvs)#{Mx[:meta_c]}\s*(.+?)$/; header('version',$2,'process','instruct') + when /^#{Mx[:meta_o]}(title)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,@md.title.full,'meta','dc') #dc 1 + when /^#{Mx[:meta_o]}(creator|author)#{Mx[:meta_c]}\s*(.+?)$/ then header('creator',$2,'meta','dc') #dc 2 + when /^#{Mx[:meta_o]}(subject)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 3 + when /^#{Mx[:meta_o]}(description)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 4 + when /^#{Mx[:meta_o]}(publisher)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 5 + when /^#{Mx[:meta_o]}(contributor)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 6 + when /^#{Mx[:meta_o]}(date)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 7 + when /^#{Mx[:meta_o]}(date\.created)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(date\.issued)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(date\.available)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(date\.valid)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(date\.modified)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(type)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 8 + when /^#{Mx[:meta_o]}(format)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 9 + when /^#{Mx[:meta_o]}(identifier)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 10 + when /^#{Mx[:meta_o]}(source)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 11 + when /^#{Mx[:meta_o]}(language)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 12 + when /^#{Mx[:meta_o]}(relation)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 13 + when /^#{Mx[:meta_o]}(coverage)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 14 + when /^#{Mx[:meta_o]}(rights)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 15 + when /^#{Mx[:meta_o]}(keywords)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(copyright)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(translator|translated_by)#{Mx[:meta_c]}\s*(.+?)$/ then header('translator',$2) + when /^#{Mx[:meta_o]}(illustrator|illustrated_by)#{Mx[:meta_c]}\s*(.+?)$/ then header('illustrator',$2) + when /^#{Mx[:meta_o]}(prepared_by)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(digitized_by)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(comments?)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(abstract)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(tags?)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(catalogue)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(class(?:ify)?_loc)#{Mx[:meta_c]}\s*(.+?)$/ then header('classify_loc',$2,'meta','extra') + when /^#{Mx[:meta_o]}(class(?:ify)?_dewey)#{Mx[:meta_c]}\s*(.+?)$/ then header('classify_dewey',$2,'meta','extra') + when /^#{Mx[:meta_o]}(class(?:ify)?_pg)#{Mx[:meta_c]}\s*(.+?)$/ then header('classify_pg',$2,'meta','extra') + when /^#{Mx[:meta_o]}(class(?:ify)?_isbn)#{Mx[:meta_c]}\s*(.+?)$/ then header('classify_isbn',$2,'meta','extra') + when /^#{Mx[:meta_o]}(toc|structure)#{Mx[:meta_c]}\s*(.+?)$/ then header('structure',$2,'process','instruct') + when /^#{Mx[:meta_o]}(level|page|markup)#{Mx[:meta_c]}\s*(.+?)$/ then header('markup',$2,'process','instruct') + when /^#{Mx[:meta_o]}(bold)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'process','instruct') + when /^#{Mx[:meta_o]}(italics|itali[sz]e)#{Mx[:meta_c]}\s*(.+?)$/ then header('italicize',$2,'process','instruct') + when /^#{Mx[:meta_o]}(vocabulary|wordlist)#{Mx[:meta_c]}\s*(.+?)$/ then header('vocabulary',$2,'process','instruct') + when /^#{Mx[:meta_o]}(css|stylesheet)#{Mx[:meta_c]}\s*(.+?)$/ then header('css',$2,'process','instruct') + when /^#{Mx[:meta_o]}(links)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'process','instruct') + when /^#{Mx[:meta_o]}(prefix)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'process','instruct') #add a & b + when /^#{Mx[:meta_o]}(suffix)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'process','instruct') + when /^#{Mx[:meta_o]}(information)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'process','instruct') + when /^#{Mx[:meta_o]}(contact)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'process','instruct') + when /^#{Mx[:meta_o]}(rcs|cvs)#{Mx[:meta_c]}\s*(.+?)$/ then header('version',$2,'process','instruct') else nil end end diff --git a/lib/sisu/v5/prog_text_translation.rb b/lib/sisu/v5/prog_text_translation.rb index f3c20076..98319960 100644 --- a/lib/sisu/v5/prog_text_translation.rb +++ b/lib/sisu/v5/prog_text_translation.rb @@ -67,35 +67,35 @@ module SiSU_Translate def initialize(md,doc_lang,trans_str='') @md,@doc_lang,@trans_str=md,doc_lang,trans_str @lang_class=case @doc_lang - when /American/i; English.new(md,doc_lang,trans_str) # tag depreciated, see iso 639-2 - when /English/i; English.new(md,doc_lang,trans_str) - when /French/i; French.new(md,doc_lang,trans_str) - when /German/i; German.new(md,doc_lang,trans_str) - when /Italian/i; Italian.new(md,doc_lang,trans_str) - when /Spanish/i; Spanish.new(md,doc_lang,trans_str) - when /Portuguese Brazil|Brazilian(?: Portuguese)?/i; - Portuguese.new(md,doc_lang,trans_str) # tag depreciated, see iso 639-2 - when /Portuguese/i; Portuguese.new(md,doc_lang,trans_str) - when /Swedish/i; Swedish.new(md,doc_lang,trans_str) - when /Danish/i; Danish.new(md,doc_lang,trans_str) - when /Finnish/i; Finnish.new(md,doc_lang,trans_str) - when /Norwegian/i; Norwegian.new(md,doc_lang,trans_str) - when /Icelandic/i; Icelandic.new(md,doc_lang,trans_str) - when /Dutch/i; Dutch.new(md,doc_lang,trans_str) - when /Estonian/i; Estonian.new(md,doc_lang,trans_str) - when /Hungarian/i; Hungarian.new(md,doc_lang,trans_str) - when /Polish/i; Polish.new(md,doc_lang,trans_str) - when /Romanian/i; Romanian.new(md,doc_lang,trans_str) - when /Russian/i; Russian.new(md,doc_lang,trans_str) - when /Greek/i; Greek.new(md,doc_lang,trans_str) - when /Ukranian/i; Ukranian.new(md,doc_lang,trans_str) - when /Turkish/i; Turkish.new(md,doc_lang,trans_str) - when /Slovenian/i; Slovenian.new(md,doc_lang,trans_str) - when /Croatian/i; Croatian.new(md,doc_lang,trans_str) - when /Slovak(?:ian)?/i; Slovak.new(md,doc_lang,trans_str) - when /Czech/i; Czech.new(md,doc_lang,trans_str) - when /Bulgarian/i; Bulgarian.new(md,doc_lang,trans_str) - else English.new(md,doc_lang,trans_str) + when /American/i then English.new(md,doc_lang,trans_str) # tag depreciated, see iso 639-2 + when /English/i then English.new(md,doc_lang,trans_str) + when /French/i then French.new(md,doc_lang,trans_str) + when /German/i then German.new(md,doc_lang,trans_str) + when /Italian/i then Italian.new(md,doc_lang,trans_str) + when /Spanish/i then Spanish.new(md,doc_lang,trans_str) + when /Portuguese Brazil|Brazilian(?: Portuguese)?/i + Portuguese.new(md,doc_lang,trans_str) # tag depreciated, see iso 639-2 + when /Portuguese/i then Portuguese.new(md,doc_lang,trans_str) + when /Swedish/i then Swedish.new(md,doc_lang,trans_str) + when /Danish/i then Danish.new(md,doc_lang,trans_str) + when /Finnish/i then Finnish.new(md,doc_lang,trans_str) + when /Norwegian/i then Norwegian.new(md,doc_lang,trans_str) + when /Icelandic/i then Icelandic.new(md,doc_lang,trans_str) + when /Dutch/i then Dutch.new(md,doc_lang,trans_str) + when /Estonian/i then Estonian.new(md,doc_lang,trans_str) + when /Hungarian/i then Hungarian.new(md,doc_lang,trans_str) + when /Polish/i then Polish.new(md,doc_lang,trans_str) + when /Romanian/i then Romanian.new(md,doc_lang,trans_str) + when /Russian/i then Russian.new(md,doc_lang,trans_str) + when /Greek/i then Greek.new(md,doc_lang,trans_str) + when /Ukranian/i then Ukranian.new(md,doc_lang,trans_str) + when /Turkish/i then Turkish.new(md,doc_lang,trans_str) + when /Slovenian/i then Slovenian.new(md,doc_lang,trans_str) + when /Croatian/i then Croatian.new(md,doc_lang,trans_str) + when /Slovak(?:ian)?/i then Slovak.new(md,doc_lang,trans_str) + when /Czech/i then Czech.new(md,doc_lang,trans_str) + when /Bulgarian/i then Bulgarian.new(md,doc_lang,trans_str) + else English.new(md,doc_lang,trans_str) end end def filename @@ -280,38 +280,38 @@ module SiSU_Translate end def language_list case @trans_str - when /American/i; 'American English' # tag depreciated, see iso 639-2 - when /English/i; 'English' - when /French/i; 'français' - when /German/i; 'Deutsch' - when /Italian/i; 'Italiano' - when /Spanish/i; 'español' - when /Portuguese Brazil|Brazilian(?: Portuguese)?/i; - 'Brazilian Português' # tag depreciated, see iso 639-2 - when /Portuguese/i; 'Português' - when /Swedish/i; 'svenska' - when /Danish/i; 'dansk' - when /Finnish/i; 'suomi' - when /Norwegian/i; 'norsk' - when /Icelandic/i; 'Icelandic' - when /Dutch/i; 'Nederlands' - when /Estonian/i; 'Estonian' - when /Hungarian/i; 'Hungarian' - when /Polish/i; 'polski' - when /Romanian/i; 'română' - when /Russian/i; 'Русский (Russkij)' - when /Greek/i; 'Ελληνικά (Ellinika)' - when /Ukranian/i; 'українська (ukrajins\'ka)' - when /Turkish/i; 'Türkçe' - when /Slovenian/i; 'Slovenian' - when /Croatian/i; 'Croatian' - when /Slovak(?:ian)?/i; 'slovensky' #slovensky ? - when /Czech/i; 'česky' - when /Bulgarian/i; 'Български (Bəlgarski)' - when /Japanese/i; '日本語 (Nihongo)' - when /Korean/i; '한국어 (Hangul)' - #when /Catalan/i; 'català' - else 'English' + when /American/i then 'American English' # tag depreciated, see iso 639-2 + when /English/i then 'English' + when /French/i then 'français' + when /German/i then 'Deutsch' + when /Italian/i then 'Italiano' + when /Spanish/i then 'español' + when /Portuguese Brazil|Brazilian(?: Portuguese)?/i + 'Brazilian Português' # tag depreciated, see iso 639-2 + when /Portuguese/i then 'Português' + when /Swedish/i then 'svenska' + when /Danish/i then 'dansk' + when /Finnish/i then 'suomi' + when /Norwegian/i then 'norsk' + when /Icelandic/i then 'Icelandic' + when /Dutch/i then 'Nederlands' + when /Estonian/i then 'Estonian' + when /Hungarian/i then 'Hungarian' + when /Polish/i then 'polski' + when /Romanian/i then 'română' + when /Russian/i then 'Русский (Russkij)' + when /Greek/i then 'Ελληνικά (Ellinika)' + when /Ukranian/i then 'українська (ukrajins\'ka)' + when /Turkish/i then 'Türkçe' + when /Slovenian/i then 'Slovenian' + when /Croatian/i then 'Croatian' + when /Slovak(?:ian)?/i then 'slovensky' #slovensky ? + when /Czech/i then 'česky' + when /Bulgarian/i then 'Български (Bəlgarski)' + when /Japanese/i then '日本語 (Nihongo)' + when /Korean/i then '한국어 (Hangul)' + #when /Catalan/i then 'català' + else 'English' end #check on 中文 and عربي end @@ -499,34 +499,34 @@ module SiSU_Translate end def language_list_translated case @trans_str - when /American/i; 'American English' # tag depreciated, see iso 639-2 - when /English/i; 'English' - when /French/i; 'French' - when /German/i; 'German' - when /Italian/i; 'Italian' - when /Spanish/i; 'Spanish' - when /Portuguese Brazil|Brazilian(?: Portuguese)?/i; - 'Brazilian Portuguese' # tag depreciated, see iso 639-2 - when /Portuguese/i; 'Portuguese' - when /Swedish/i; 'Swedish' - when /Danish/i; 'Danish' - when /Finnish/i; 'Finnish' - when /Norwegian/i; 'Norwegian' - when /Icelandic/i; 'Icelandic' - when /Dutch/i; 'Dutch' - when /Estonian/i; 'Estonian' - when /Hungarian/i; 'Hungarian' - when /Polish/i; 'Polish' - when /Romanian/i; 'Romanian' - when /Russian/i; 'Russian' - when /Greek/i; 'Greek' - when /Ukranian/i; 'Ukranian' - when /Turkish/i; 'Turkish' - when /Slovenian/i; 'Slovenian' - when /Croatian/i; 'Croatian' - when /Slovak(?:ian)?/i; 'Slovakian' - when /Czech/i; 'Czech' - when /Bulgarian/i; 'Bulgarian' + when /American/i then 'American English' # tag depreciated, see iso 639-2 + when /English/i then 'English' + when /French/i then 'French' + when /German/i then 'German' + when /Italian/i then 'Italian' + when /Spanish/i then 'Spanish' + when /Portuguese Brazil|Brazilian(?: Portuguese)?/i + 'Brazilian Portuguese' # tag depreciated, see iso 639-2 + when /Portuguese/i then 'Portuguese' + when /Swedish/i then 'Swedish' + when /Danish/i then 'Danish' + when /Finnish/i then 'Finnish' + when /Norwegian/i then 'Norwegian' + when /Icelandic/i then 'Icelandic' + when /Dutch/i then 'Dutch' + when /Estonian/i then 'Estonian' + when /Hungarian/i then 'Hungarian' + when /Polish/i then 'Polish' + when /Romanian/i then 'Romanian' + when /Russian/i then 'Russian' + when /Greek/i then 'Greek' + when /Ukranian/i then 'Ukranian' + when /Turkish/i then 'Turkish' + when /Slovenian/i then 'Slovenian' + when /Croatian/i then 'Croatian' + when /Slovak(?:ian)?/i then 'Slovakian' + when /Czech/i then 'Czech' + when /Bulgarian/i then 'Bulgarian' else @trans_str end end @@ -714,34 +714,34 @@ module SiSU_Translate end def language_list_translated case @trans_str - when /American/i; 'Anglais americain' # tag depreciated, see iso 639-2 - when /English/i; 'Anglais' - when /French/i; 'Français' - when /German/i; 'Allemand' - when /Italian/i; 'Italien' - when /Spanish/i; 'Espagnol' - when /Portuguese Brazil|Brazilian(?: Portuguese)?/i; - 'Portugais brésilien' # tag depreciated, see iso 639-2 - when /Portuguese/i; 'Portugais' - when /Swedish/i; 'Suédois' - when /Danish/i; 'Danois' - when /Finnish/i; 'Finnois' - when /Norwegian/i; 'Norvégien' - when /Icelandic/i; 'Islandais' - when /Dutch/i; 'Néerlandais' - when /Estonian/i; 'Estonien' - when /Hungarian/i; 'Hongrois' - when /Polish/i; 'Polonais' - when /Romanian/i; 'Roumain' - when /Russian/i; 'Russe' - when /Greek/i; 'Grec' - when /Ukranian/i; 'Ukrainien' - when /Turkish/i; 'Turc' - when /Slovenian/i; 'Slovène' - when /Croatian/i; 'Croate' - when /Slovak(?:ian)?/i; 'Slovaque' - when /Czech/i; 'Tcheque' - when /Bulgarian/i; 'Bulgare' + when /American/i then 'Anglais americain' # tag depreciated, see iso 639-2 + when /English/i then 'Anglais' + when /French/i then 'Français' + when /German/i then 'Allemand' + when /Italian/i then 'Italien' + when /Spanish/i then 'Espagnol' + when /Portuguese Brazil|Brazilian(?: Portuguese)?/i + 'Portugais brésilien' # tag depreciated, see iso 639-2 + when /Portuguese/i then 'Portugais' + when /Swedish/i then 'Suédois' + when /Danish/i then 'Danois' + when /Finnish/i then 'Finnois' + when /Norwegian/i then 'Norvégien' + when /Icelandic/i then 'Islandais' + when /Dutch/i then 'Néerlandais' + when /Estonian/i then 'Estonien' + when /Hungarian/i then 'Hongrois' + when /Polish/i then 'Polonais' + when /Romanian/i then 'Roumain' + when /Russian/i then 'Russe' + when /Greek/i then 'Grec' + when /Ukranian/i then 'Ukrainien' + when /Turkish/i then 'Turc' + when /Slovenian/i then 'Slovène' + when /Croatian/i then 'Croate' + when /Slovak(?:ian)?/i then 'Slovaque' + when /Czech/i then 'Tcheque' + when /Bulgarian/i then 'Bulgare' else @trans_str end end @@ -926,34 +926,34 @@ module SiSU_Translate end def language_list_translated case @trans_str - when /American/i; 'Amerikanisch-Englisch' # tag depreciated, see iso 639-2 - when /English/i; 'Englisch' - when /French/i; 'Französisch' - when /German/i; 'Deutsch' - when /Italian/i; 'Italienisch' - when /Spanish/i; 'Spanisch' - when /Portuguese Brazil|Brazilian(?: Portuguese)?/i; - 'Brasilianisch-Portugiesisch' # tag depreciated, see iso 639-2 - when /Portuguese/i; 'Portugiesisch' - when /Swedish/i; 'Schwedisch' - when /Danish/i; 'Dänisch' - when /Finnish/i; 'Finnisch' - when /Norwegian/i; 'Norwegisch' - when /Icelandic/i; 'Isländisch' - when /Dutch/i; 'Niederländisch' - when /Estonian/i; 'Estnisch' - when /Hungarian/i; 'Ungarisch' - when /Polish/i; 'Polnisch' - when /Romanian/i; 'Rumänisch' - when /Russian/i; 'Russisch' - when /Greek/i; 'Griechisch' - when /Ukranian/i; 'Ukrainisch' - when /Turkish/i; 'Türkisch' - when /Slovenian/i; 'Slovenisch' - when /Croatian/i; 'Kroatisch' - when /Slovak(?:ian)?/i; 'Slovakisch' - when /Czech/i; 'Tschechisch' - when /Bulgarian/i; 'Bulgarisch' + when /American/i then 'Amerikanisch-Englisch' # tag depreciated, see iso 639-2 + when /English/i then 'Englisch' + when /French/i then 'Französisch' + when /German/i then 'Deutsch' + when /Italian/i then 'Italienisch' + when /Spanish/i then 'Spanisch' + when /Portuguese Brazil|Brazilian(?: Portuguese)?/i + 'Brasilianisch-Portugiesisch' # tag depreciated, see iso 639-2 + when /Portuguese/i then 'Portugiesisch' + when /Swedish/i then 'Schwedisch' + when /Danish/i then 'Dänisch' + when /Finnish/i then 'Finnisch' + when /Norwegian/i then 'Norwegisch' + when /Icelandic/i then 'Isländisch' + when /Dutch/i then 'Niederländisch' + when /Estonian/i then 'Estnisch' + when /Hungarian/i then 'Ungarisch' + when /Polish/i then 'Polnisch' + when /Romanian/i then 'Rumänisch' + when /Russian/i then 'Russisch' + when /Greek/i then 'Griechisch' + when /Ukranian/i then 'Ukrainisch' + when /Turkish/i then 'Türkisch' + when /Slovenian/i then 'Slovenisch' + when /Croatian/i then 'Kroatisch' + when /Slovak(?:ian)?/i then 'Slovakisch' + when /Czech/i then 'Tschechisch' + when /Bulgarian/i then 'Bulgarisch' else @trans_str end end @@ -1138,34 +1138,34 @@ module SiSU_Translate end def language_list_translated case @trans_str - when /American/i; 'Inglés Americano' # tag depreciated, see iso 639-2 - when /English/i; 'Inglés' - when /French/i; 'Francés' - when /German/i; 'Alemán' - when /Italian/i; 'Italiano' - when /Spanish/i; 'Español' - when /Portuguese Brazil|Brazilian(?: Portuguese)?/i; - 'Portugués de Brasil' # tag depreciated, see iso 639-2 - when /Portuguese/i; 'Portugués' - when /Swedish/i; 'Sueco' - when /Danish/i; 'Danés' - when /Finnish/i; 'Finés' - when /Norwegian/i; 'Noruego' - when /Icelandic/i; 'Islandés' - when /Dutch/i; 'Holandés' - when /Estonian/i; 'Estonio' - when /Hungarian/i; 'Húngaro' - when /Polish/i; 'Polaco' - when /Romanian/i; 'Rumano' - when /Russian/i; 'Ruso' - when /Greek/i; 'Griego' - when /Ukranian/i; 'Ucraniano' - when /Turkish/i; 'Turco' - when /Slovenian/i; 'Eslovaco' - when /Croatian/i; 'Croata' - when /Slovak(?:ian)?/i; 'Eslovaco' - when /Czech/i; 'Checo' - when /Bulgarian/i; 'Búlgaro' + when /American/i then 'Inglés Americano' # tag depreciated, see iso 639-2 + when /English/i then 'Inglés' + when /French/i then 'Francés' + when /German/i then 'Alemán' + when /Italian/i then 'Italiano' + when /Spanish/i then 'Español' + when /Portuguese Brazil|Brazilian(?: Portuguese)?/i + 'Portugués de Brasil' # tag depreciated, see iso 639-2 + when /Portuguese/i then 'Portugués' + when /Swedish/i then 'Sueco' + when /Danish/i then 'Danés' + when /Finnish/i then 'Finés' + when /Norwegian/i then 'Noruego' + when /Icelandic/i then 'Islandés' + when /Dutch/i then 'Holandés' + when /Estonian/i then 'Estonio' + when /Hungarian/i then 'Húngaro' + when /Polish/i then 'Polaco' + when /Romanian/i then 'Rumano' + when /Russian/i then 'Ruso' + when /Greek/i then 'Griego' + when /Ukranian/i then 'Ucraniano' + when /Turkish/i then 'Turco' + when /Slovenian/i then 'Eslovaco' + when /Croatian/i then 'Croata' + when /Slovak(?:ian)?/i then 'Eslovaco' + when /Czech/i then 'Checo' + when /Bulgarian/i then 'Búlgaro' else @trans_str end end @@ -1350,34 +1350,34 @@ module SiSU_Translate end def language_list_translated case @trans_str - when /American/i; 'Inglese USA' # tag depreciated, see iso 639-2 - when /English/i; 'Inglese' - when /French/i; 'Francese' - when /German/i; 'Tedesco' - when /Italian/i; 'Italiano' - when /Spanish/i; 'Spagnolo' - when /Portuguese Brazil|Brazilian(?: Portuguese)?/i; - 'Portoguese (Brasile)' # tag depreciated, see iso 639-2 - when /Portuguese/i; 'Portoguese' - when /Swedish/i; 'Svedese' - when /Danish/i; 'Danese' - when /Finnish/i; 'Finlandese' - when /Norwegian/i; 'Norvegese' - when /Icelandic/i; 'Islandese' - when /Dutch/i; 'Olandese' - when /Estonian/i; 'Estone' - when /Hungarian/i; 'Ungherese' - when /Polish/i; 'Polacco' - when /Romanian/i; 'Romeno' - when /Russian/i; 'Russo' - when /Greek/i; 'Greco' - when /Ukranian/i; 'Ucraino' - when /Turkish/i; 'Turco' - when /Slovenian/i; 'Sloveno' - when /Croatian/i; 'Croato' - when /Slovak(?:ian)?/i; 'Slovacco' - when /Czech/i; 'Ceco' - when /Bulgarian/i; 'Bulgaro' + when /American/i then 'Inglese USA' # tag depreciated, see iso 639-2 + when /English/i then 'Inglese' + when /French/i then 'Francese' + when /German/i then 'Tedesco' + when /Italian/i then 'Italiano' + when /Spanish/i then 'Spagnolo' + when /Portuguese Brazil|Brazilian(?: Portuguese)?/i + 'Portoguese (Brasile)' # tag depreciated, see iso 639-2 + when /Portuguese/i then 'Portoguese' + when /Swedish/i then 'Svedese' + when /Danish/i then 'Danese' + when /Finnish/i then 'Finlandese' + when /Norwegian/i then 'Norvegese' + when /Icelandic/i then 'Islandese' + when /Dutch/i then 'Olandese' + when /Estonian/i then 'Estone' + when /Hungarian/i then 'Ungherese' + when /Polish/i then 'Polacco' + when /Romanian/i then 'Romeno' + when /Russian/i then 'Russo' + when /Greek/i then 'Greco' + when /Ukranian/i then 'Ucraino' + when /Turkish/i then 'Turco' + when /Slovenian/i then 'Sloveno' + when /Croatian/i then 'Croato' + when /Slovak(?:ian)?/i then 'Slovacco' + when /Czech/i then 'Ceco' + when /Bulgarian/i then 'Bulgaro' else @trans_str end end @@ -1562,34 +1562,34 @@ module SiSU_Translate end def language_list_translated case @trans_str - when /American/i; 'Amerikanenglanti' # tag depreciated, see iso 639-2 - when /English/i; 'Englanti' - when /French/i; 'Ranska' - when /German/i; 'Saksa' - when /Italian/i; 'Italia' - when /Spanish/i; 'Espanja' - when /Portuguese Brazil|Brazilian(?: Portuguese)?/i; - 'Brasilian portugali' # tag depreciated, see iso 639-2 - when /Portuguese/i; 'Portugali' - when /Swedish/i; 'Ruotsi' - when /Danish/i; 'Tanska' - when /Finnish/i; 'Suomi' - when /Norwegian/i; 'Norja' - when /Icelandic/i; 'Islanti' - when /Dutch/i; 'Hollanti' - when /Estonian/i; 'Viro' - when /Hungarian/i; 'Unkari' - when /Polish/i; 'Puola' - when /Romanian/i; 'Romania' - when /Russian/i; 'Venäjä' - when /Greek/i; 'Kreikka' - when /Ukranian/i; 'Ukraina' - when /Turkish/i; 'Turkki' - when /Slovenian/i; 'Slovenia' - when /Croatian/i; 'Kroatia' - when /Slovak(?:ian)?/i; 'Slovakki' - when /Czech/i; 'Tsekki' - when /Bulgarian/i; 'Bulgaria' + when /American/i then 'Amerikanenglanti' # tag depreciated, see iso 639-2 + when /English/i then 'Englanti' + when /French/i then 'Ranska' + when /German/i then 'Saksa' + when /Italian/i then 'Italia' + when /Spanish/i then 'Espanja' + when /Portuguese Brazil|Brazilian(?: Portuguese)?/i + 'Brasilian portugali' # tag depreciated, see iso 639-2 + when /Portuguese/i then 'Portugali' + when /Swedish/i then 'Ruotsi' + when /Danish/i then 'Tanska' + when /Finnish/i then 'Suomi' + when /Norwegian/i then 'Norja' + when /Icelandic/i then 'Islanti' + when /Dutch/i then 'Hollanti' + when /Estonian/i then 'Viro' + when /Hungarian/i then 'Unkari' + when /Polish/i then 'Puola' + when /Romanian/i then 'Romania' + when /Russian/i then 'Venäjä' + when /Greek/i then 'Kreikka' + when /Ukranian/i then 'Ukraina' + when /Turkish/i then 'Turkki' + when /Slovenian/i then 'Slovenia' + when /Croatian/i then 'Kroatia' + when /Slovak(?:ian)?/i then 'Slovakki' + when /Czech/i then 'Tsekki' + when /Bulgarian/i then 'Bulgaria' else @trans_str end end diff --git a/lib/sisu/v5/screen_text_color.rb b/lib/sisu/v5/screen_text_color.rb index 18ed9926..42b0c698 100644 --- a/lib/sisu/v5/screen_text_color.rb +++ b/lib/sisu/v5/screen_text_color.rb @@ -121,69 +121,69 @@ module SiSU_Screen end def color case @color_instruct - when /invert/; @cX.invert - when /darkgrey_hi/; @cX.darkgrey_hi - when /grey_hi/; @cX.grey_hi - when /pink_hi/; @cX.pink_hi - when /fuchsia_hi/; @cX.fuchsia_hi - when /red_hi/; @cX.red_hi - when /orange_hi/; @cX.orange_hi - when /yellow_hi/; @cX.yellow_hi - when /brown_hi/; @cX.brown_hi - when /lightgreen_hi/; @cX.lightgreen_hi - when /green_hi/; @cX.green_hi - when /cyan_hi/; @cX.cyan_hi - when /blue_hi/; @cX.blue_hi - when /navy_hi/; @cX.navy_hi - when /white/; @cX.white - when /grey/; @cX.grey - when /pink/; @cX.pink - when /fuchsia/; @cX.fuchsia - when /ruby/; @cX.ruby - when /red/; @cX.red - when /orange/; @cX.orange - when /yellow/; @cX.yellow - when /brown/; @cX.brown - when /green/; @cX.green - when /darkgreen/; @cX.darkgreen - when /cyan/; @cX.cyan - when /blue/; @cX.blue - when /navy/; @cX.navy - when /close/; @cX.off - when /off/; @cX.off + when /invert/ then @cX.invert + when /darkgrey_hi/ then @cX.darkgrey_hi + when /grey_hi/ then @cX.grey_hi + when /pink_hi/ then @cX.pink_hi + when /fuchsia_hi/ then @cX.fuchsia_hi + when /red_hi/ then @cX.red_hi + when /orange_hi/ then @cX.orange_hi + when /yellow_hi/ then @cX.yellow_hi + when /brown_hi/ then @cX.brown_hi + when /lightgreen_hi/ then @cX.lightgreen_hi + when /green_hi/ then @cX.green_hi + when /cyan_hi/ then @cX.cyan_hi + when /blue_hi/ then @cX.blue_hi + when /navy_hi/ then @cX.navy_hi + when /white/ then @cX.white + when /grey/ then @cX.grey + when /pink/ then @cX.pink + when /fuchsia/ then @cX.fuchsia + when /ruby/ then @cX.ruby + when /red/ then @cX.red + when /orange/ then @cX.orange + when /yellow/ then @cX.yellow + when /brown/ then @cX.brown + when /green/ then @cX.green + when /darkgreen/ then @cX.darkgreen + when /cyan/ then @cX.cyan + when /blue/ then @cX.blue + when /navy/ then @cX.navy + when /close/ then @cX.off + when /off/ then @cX.off end end def colorize case @color_instruct - when /invert/; puts "#{@cX.invert}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" - when /darkgrey_hi/; puts "#{@cX.darkgrey_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" - when /grey_hi/; puts "#{@cX.grey_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" - when /pink_hi/; puts "#{@cX.pink_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" - when /fuchsia_hi/; puts "#{@cX.fuchsia_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" - when /red_hi/; puts "#{@cX.red_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" - when /orange_hi/; puts "#{@cX.orange_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" - when /yellow_hi/; puts "#{@cX.yellow_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" - when /brown_hi/; puts "#{@cX.brown_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" - when /lightgreen_hi/; puts "#{@cX.lightgreen_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" - when /green_hi/; puts "#{@cX.green_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" - when /cyan_hi/; puts "#{@cX.cyan_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" - when /blue_hi/; puts "#{@cX.blue_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" - when /navy_hi/; puts "#{@cX.navy_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" - when /bold/; puts "#{@cX.bold}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" - when /white/; puts "#{@cX.off}#{@txt[1]} #{@txt[2]}" - when /grey/; puts "#{@cX.grey}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" - when /pink/; puts "#{@cX.pink}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" - when /fuchsia/; puts "#{@cX.fuchsia}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" - when /ruby/; puts "#{@cX.ruby}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" - when /red/; puts "#{@cX.red}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" - when /orange/; puts "#{@cX.orange}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" - when /yellow/; puts "#{@cX.yellow}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" - when /brown/; puts "#{@cX.brown}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" - when /green/; puts "#{@cX.green}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" - when /darkgreen/; puts "#{@cX.darkgreen}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" - when /cyan/; puts "#{@cX.cyan}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" - when /blue/; puts "#{@cX.blue}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" - when /navy/; puts "#{@cX.navy}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + when /invert/ then puts "#{@cX.invert}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" + when /darkgrey_hi/ then puts "#{@cX.darkgrey_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" + when /grey_hi/ then puts "#{@cX.grey_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" + when /pink_hi/ then puts "#{@cX.pink_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" + when /fuchsia_hi/ then puts "#{@cX.fuchsia_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" + when /red_hi/ then puts "#{@cX.red_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" + when /orange_hi/ then puts "#{@cX.orange_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" + when /yellow_hi/ then puts "#{@cX.yellow_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" + when /brown_hi/ then puts "#{@cX.brown_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" + when /lightgreen_hi/ then puts "#{@cX.lightgreen_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" + when /green_hi/ then puts "#{@cX.green_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" + when /cyan_hi/ then puts "#{@cX.cyan_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" + when /blue_hi/ then puts "#{@cX.blue_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" + when /navy_hi/ then puts "#{@cX.navy_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" + when /bold/ then puts "#{@cX.bold}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + when /white/ then puts "#{@cX.off}#{@txt[1]} #{@txt[2]}" + when /grey/ then puts "#{@cX.grey}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + when /pink/ then puts "#{@cX.pink}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + when /fuchsia/ then puts "#{@cX.fuchsia}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + when /ruby/ then puts "#{@cX.ruby}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + when /red/ then puts "#{@cX.red}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + when /orange/ then puts "#{@cX.orange}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + when /yellow/ then puts "#{@cX.yellow}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + when /brown/ then puts "#{@cX.brown}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + when /green/ then puts "#{@cX.green}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + when /darkgreen/ then puts "#{@cX.darkgreen}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + when /cyan/ then puts "#{@cX.cyan}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + when /blue/ then puts "#{@cX.blue}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + when /navy/ then puts "#{@cX.navy}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" end end def sourcename(sourcefilename) diff --git a/lib/sisu/v5/sst_convert_markup.rb b/lib/sisu/v5/sst_convert_markup.rb index 23ac591b..cec67960 100644 --- a/lib/sisu/v5/sst_convert_markup.rb +++ b/lib/sisu/v5/sst_convert_markup.rb @@ -161,9 +161,9 @@ WOK def convert_filename_36_to_37 @opt.files.each do |f| s=case f - when /(\.s[1-3])$/; f.sub($1,'.sst') - when /(\.r[1-3])$/; f.sub($1,'.ssm') - when /(\.ri)$/; f.sub($1,'.ssi') + when /(\.s[1-3])$/ then f.sub($1,'.sst') + when /(\.r[1-3])$/ then f.sub($1,'.ssm') + when /(\.ri)$/ then f.sub($1,'.ssi') else f end pwd=Dir.pwd @@ -204,26 +204,26 @@ WOK if @opt.mod.inspect =~/--help/ then help elsif @opt.mod.inspect =~/(?:convert|to)[=-](?:xml |sxs|sax|sxd|dom|sxn|node)/ ext=case @opt.mod.inspect - when /(?:convert|to)[=-](?:xml|sxs|sax)/; '.sxs.xml' - when /(?:convert|to)[=-](?:sxd|dom)/; '.sxd.xml' - when /(?:convert|to)[=-](?:sxn|node)/; '.sxn.xml' + when /(?:convert|to)[=-](?:xml|sxs|sax)/ then '.sxs.xml' + when /(?:convert|to)[=-](?:sxd|dom)/ then '.sxd.xml' + when /(?:convert|to)[=-](?:sxn|node)/ then '.sxn.xml' end message("#{@opt.files.inspect}\n\nWARNING, PROCEED AT YOUR OWN RISK,\noverwriting any equivalent file with the extension #{ext}") mr=case @opt.mod.inspect - when /(?:convert|to)[=-](?:sxs|sax|xml )/; convert_to_simple_xml_model_sax - when /(?:convert|to)[=-](?:sxd|dom)/; convert_to_simple_xml_model_dom - when /(?:convert|to)[=-](?:sxn|node)/; convert_to_simple_xml_model_node + when /(?:convert|to)[=-](?:sxs|sax|xml )/ then convert_to_simple_xml_model_sax + when /(?:convert|to)[=-](?:sxd|dom)/ then convert_to_simple_xml_model_dom + when /(?:convert|to)[=-](?:sxn|node)/ then convert_to_simple_xml_model_node else help end else mr=case @opt.mod.inspect - when /(?:(?:37)?to-?38|--(?:convert|to)[=-](?:current|0.38))/; convert_37_to_38 - when /(?:(?:38)?to-?37|--(?:convert|to)[=-](?:0.37))/; convert_38_to_37 - when /(?:36to37)/; convert_filename_36_to_37 - when /(?:convert|from)[=-]kdi/; convert_kdi_to_sst - when /(?:(?:convert|from)[=-])?(?:xml_to_sst|xml2sst|sxml|sxs|sxd|sxd)/; convert_s_xml_to_sst - when /(?:convert|to)[=-]footnotes/; convert_footnotes - when /convert|default/; current_match_and_replace + when /(?:(?:37)?to-?38|--(?:convert|to)[=-](?:current|0.38))/ then convert_37_to_38 + when /(?:(?:38)?to-?37|--(?:convert|to)[=-](?:0.37))/ then convert_38_to_37 + when /(?:36to37)/ then convert_filename_36_to_37 + when /(?:convert|from)[=-]kdi/ then convert_kdi_to_sst + when /(?:(?:convert|from)[=-])?(?:xml_to_sst|xml2sst|sxml|sxs|sxd|sxd)/ then convert_s_xml_to_sst + when /(?:convert|to)[=-]footnotes/ then convert_footnotes + when /convert|default/ then current_match_and_replace else help end end diff --git a/lib/sisu/v5/sst_do_inline_footnotes.rb b/lib/sisu/v5/sst_do_inline_footnotes.rb index 470a07c1..b157ce16 100644 --- a/lib/sisu/v5/sst_do_inline_footnotes.rb +++ b/lib/sisu/v5/sst_do_inline_footnotes.rb @@ -340,8 +340,8 @@ module SiSU_ConvertFootnotes end def number_sub_heading(para,num,title_no) case para - when /#{num}~- /; para.gsub!(/#{num}~- /,"#{title_no} ") - when /^#{num}~#\s*/; para.gsub!(/^#{num}~#\s*/,"#{title_no} ") + when /#{num}~- / then para.gsub!(/#{num}~- /,"#{title_no} ") + when /^#{num}~#\s*/ then para.gsub!(/^#{num}~#\s*/,"#{title_no} ") when /^#{num}~[a-z_\.]+ / para.gsub!(/^#{num}~([a-z_\.]+)\s+(.+)/i,%{#{num}~\\1 #{title_no} \\2 <:name##{title_no}>}) else para.gsub!(/^#{num}~ /,"#{num}~#{title_no} #{title_no} ") #main diff --git a/lib/sisu/v5/sysenv.rb b/lib/sisu/v5/sysenv.rb index d6a46bc4..954fb179 100644 --- a/lib/sisu/v5/sysenv.rb +++ b/lib/sisu/v5/sysenv.rb @@ -937,63 +937,63 @@ module SiSU_Env def language lng={} case @language - when /^am$|Amharic/i; d,c,l=false,lang_lst['am'][:c], lang_lst['am'][:n] - when /^bg$|Bulgarian/i; d,c,l=false,lang_lst['bg'][:c], lang_lst['bg'][:n] - when /^bn$|Bengali/i; d,c,l=false,lang_lst['bn'][:c], lang_lst['bn'][:n] - when /^br$|Breton/i; d,c,l=false,lang_lst['br'][:c], lang_lst['br'][:n] - when /^ca$|Catalan/i; d,c,l=false,lang_lst['ca'][:c], lang_lst['ca'][:n] - when /^cs$|Czech/i; d,c,l=false,lang_lst['cs'][:c], lang_lst['cs'][:n] - when /^cy$|Welsh/i; d,c,l=false,lang_lst['cy'][:c], lang_lst['cy'][:n] - when /^da$|Danish|Dansk/i; d,c,l=false,lang_lst['da'][:c], lang_lst['da'][:n] - when /^de$|German/i; d,c,l=false,lang_lst['de'][:c], lang_lst['de'][:n] - when /^el$|Greek/i; d,c,l=false,lang_lst['el'][:c], lang_lst['el'][:n] - when /^en$|English/i; d,c,l=false,lang_lst['en'][:c], lang_lst['en'][:n] - when /^eo$|Esperanto/i; d,c,l=false,lang_lst['eo'][:c], lang_lst['eo'][:n] - when /^es$|Spanish|Espanol/i; d,c,l=false,lang_lst['es'][:c], lang_lst['es'][:n] - when /^et$|Estonian/i; d,c,l=false,lang_lst['et'][:c], lang_lst['et'][:n] - when /^eu$|Basque/i; d,c,l=false,lang_lst['eu'][:c], lang_lst['eu'][:n] - when /^fi$|Finnish|Finsk|Suomi/i; d,c,l=false,lang_lst['fi'][:c], lang_lst['fi'][:n] - when /^fr$|French|Francais/i; d,c,l=false,lang_lst['fr'][:c], lang_lst['fr'][:n] - when /^ga$|Irish/i; d,c,l=false,lang_lst['ga'][:c], lang_lst['ga'][:n] - when /^gl$|Galician/i; d,c,l=false,lang_lst['gl'][:c], lang_lst['gl'][:n] - when /^he$|Hebrew/i; d,c,l=false,lang_lst['he'][:c], lang_lst['he'][:n] - when /^hi$|Hindi/i; d,c,l=false,lang_lst['hi'][:c], lang_lst['hi'][:n] - when /^hr$|Croatian/i; d,c,l=false,lang_lst['hr'][:c], lang_lst['hr'][:n] - when /^hy$|Armenian/i; d,c,l=false,lang_lst['hy'][:c], lang_lst['hy'][:n] - when /^ia$|Interlingua/i; d,c,l=false,lang_lst['ia'][:c], lang_lst['ia'][:n] - when /^is$|Icelandic/i; d,c,l=false,lang_lst['is'][:c], lang_lst['is'][:n] - when /^it$|Italian/i; d,c,l=false,lang_lst['it'][:c], lang_lst['it'][:n] - when /^la$|Latin/i; d,c,l=false,lang_lst['la'][:c], lang_lst['la'][:n] - when /^lo$|Lao/i; d,c,l=false,lang_lst['lo'][:c], lang_lst['lo'][:n] - when /^lt$|Lithuanian/i; d,c,l=false,lang_lst['lt'][:c], lang_lst['lt'][:n] - when /^lv$|Latvian/i; d,c,l=false,lang_lst['lv'][:c], lang_lst['lv'][:n] - when /^ml$|Malayalam/i; d,c,l=false,lang_lst['ml'][:c], lang_lst['ml'][:n] - when /^mr$|Marathi/i; d,c,l=false,lang_lst['mr'][:c], lang_lst['mr'][:n] - when /^nl$|Dutch/i; d,c,l=false,lang_lst['nl'][:c], lang_lst['nl'][:n] - when /^no$|Norwegian|Norsk/i; d,c,l=false,lang_lst['no'][:c], lang_lst['no'][:n] - when /^nn$|Norwegian Nynorsk/i; d,c,l=false,lang_lst['nn'][:c], lang_lst['nn'][:n] - when /^oc$|Occitan/i; d,c,l=false,lang_lst['oc'][:c], lang_lst['oc'][:n] - when /^pl$|Polish/i; d,c,l=false,lang_lst['pl'][:c], lang_lst['pl'][:n] - when /^pt$|Portuguese/i; d,c,l=false,lang_lst['pt'][:c], lang_lst['pt'][:n] - when /^pt_BR$|Portuguese Brazil/i; d,c,l=false,lang_lst['pt_BR'][:c], lang_lst['pt_BR'][:n] - when /^ro$|Romanian/i; d,c,l=false,lang_lst['ro'][:c], lang_lst['ro'][:n] - when /^ru$|Russian/i; d,c,l=false,lang_lst['ru'][:c], lang_lst['ru'][:n] - when /^sa$|Sanskrit/i; d,c,l=false,lang_lst['sa'][:c], lang_lst['sa'][:n] - when /^se$|Sami/i; d,c,l=false,lang_lst['se'][:c], lang_lst['se'][:n] - when /^sk$|Slovak/i; d,c,l=false,lang_lst['sk'][:c], lang_lst['sk'][:n] - when /^sl$|Slovenian/i; d,c,l=false,lang_lst['sl'][:c], lang_lst['sl'][:n] - when /^sq$|Albanian/i; d,c,l=false,lang_lst['sq'][:c], lang_lst['sq'][:n] - when /^sr$|Serbian/i; d,c,l=false,lang_lst['sr'][:c], lang_lst['sr'][:n] - when /^sv$|Swedish|Svensk/i; d,c,l=false,lang_lst['sv'][:c], lang_lst['sv'][:n] - when /^ta$|Tamil/i; d,c,l=false,lang_lst['ta'][:c], lang_lst['ta'][:n] - when /^te$|Telugu/i; d,c,l=false,lang_lst['te'][:c], lang_lst['te'][:n] - when /^th$|Thai/i; d,c,l=false,lang_lst['th'][:c], lang_lst['th'][:n] - when /^tk$|Turkmen/i; d,c,l=false,lang_lst['tk'][:c], lang_lst['tk'][:n] - when /^tr$|Turkish/i; d,c,l=false,lang_lst['tr'][:c], lang_lst['tr'][:n] - when /^uk$|Ukranian/i; d,c,l=false,lang_lst['uk'][:c], lang_lst['uk'][:n] - when /^ur$|Urdu/i; d,c,l=false,lang_lst['ur'][:c], lang_lst['ur'][:n] - when /^us|American$|/i; d,c,l=false,lang_lst['en'][:c], lang_lst['en'][:n] - when /^vi$|Vietnamese/i; d,c,l=false,lang_lst['vi'][:c], lang_lst['vi'][:n] + when /^am$|Amharic/i then d,c,l=false,lang_lst['am'][:c], lang_lst['am'][:n] + when /^bg$|Bulgarian/i then d,c,l=false,lang_lst['bg'][:c], lang_lst['bg'][:n] + when /^bn$|Bengali/i then d,c,l=false,lang_lst['bn'][:c], lang_lst['bn'][:n] + when /^br$|Breton/i then d,c,l=false,lang_lst['br'][:c], lang_lst['br'][:n] + when /^ca$|Catalan/i then d,c,l=false,lang_lst['ca'][:c], lang_lst['ca'][:n] + when /^cs$|Czech/i then d,c,l=false,lang_lst['cs'][:c], lang_lst['cs'][:n] + when /^cy$|Welsh/i then d,c,l=false,lang_lst['cy'][:c], lang_lst['cy'][:n] + when /^da$|Danish|Dansk/i then d,c,l=false,lang_lst['da'][:c], lang_lst['da'][:n] + when /^de$|German/i then d,c,l=false,lang_lst['de'][:c], lang_lst['de'][:n] + when /^el$|Greek/i then d,c,l=false,lang_lst['el'][:c], lang_lst['el'][:n] + when /^en$|English/i then d,c,l=false,lang_lst['en'][:c], lang_lst['en'][:n] + when /^eo$|Esperanto/i then d,c,l=false,lang_lst['eo'][:c], lang_lst['eo'][:n] + when /^es$|Spanish|Espanol/i then d,c,l=false,lang_lst['es'][:c], lang_lst['es'][:n] + when /^et$|Estonian/i then d,c,l=false,lang_lst['et'][:c], lang_lst['et'][:n] + when /^eu$|Basque/i then d,c,l=false,lang_lst['eu'][:c], lang_lst['eu'][:n] + when /^fi$|Finnish|Finsk|Suomi/i then d,c,l=false,lang_lst['fi'][:c], lang_lst['fi'][:n] + when /^fr$|French|Francais/i then d,c,l=false,lang_lst['fr'][:c], lang_lst['fr'][:n] + when /^ga$|Irish/i then d,c,l=false,lang_lst['ga'][:c], lang_lst['ga'][:n] + when /^gl$|Galician/i then d,c,l=false,lang_lst['gl'][:c], lang_lst['gl'][:n] + when /^he$|Hebrew/i then d,c,l=false,lang_lst['he'][:c], lang_lst['he'][:n] + when /^hi$|Hindi/i then d,c,l=false,lang_lst['hi'][:c], lang_lst['hi'][:n] + when /^hr$|Croatian/i then d,c,l=false,lang_lst['hr'][:c], lang_lst['hr'][:n] + when /^hy$|Armenian/i then d,c,l=false,lang_lst['hy'][:c], lang_lst['hy'][:n] + when /^ia$|Interlingua/i then d,c,l=false,lang_lst['ia'][:c], lang_lst['ia'][:n] + when /^is$|Icelandic/i then d,c,l=false,lang_lst['is'][:c], lang_lst['is'][:n] + when /^it$|Italian/i then d,c,l=false,lang_lst['it'][:c], lang_lst['it'][:n] + when /^la$|Latin/i then d,c,l=false,lang_lst['la'][:c], lang_lst['la'][:n] + when /^lo$|Lao/i then d,c,l=false,lang_lst['lo'][:c], lang_lst['lo'][:n] + when /^lt$|Lithuanian/i then d,c,l=false,lang_lst['lt'][:c], lang_lst['lt'][:n] + when /^lv$|Latvian/i then d,c,l=false,lang_lst['lv'][:c], lang_lst['lv'][:n] + when /^ml$|Malayalam/i then d,c,l=false,lang_lst['ml'][:c], lang_lst['ml'][:n] + when /^mr$|Marathi/i then d,c,l=false,lang_lst['mr'][:c], lang_lst['mr'][:n] + when /^nl$|Dutch/i then d,c,l=false,lang_lst['nl'][:c], lang_lst['nl'][:n] + when /^no$|Norwegian|Norsk/i then d,c,l=false,lang_lst['no'][:c], lang_lst['no'][:n] + when /^nn$|Norwegian Nynorsk/i then d,c,l=false,lang_lst['nn'][:c], lang_lst['nn'][:n] + when /^oc$|Occitan/i then d,c,l=false,lang_lst['oc'][:c], lang_lst['oc'][:n] + when /^pl$|Polish/i then d,c,l=false,lang_lst['pl'][:c], lang_lst['pl'][:n] + when /^pt$|Portuguese/i then d,c,l=false,lang_lst['pt'][:c], lang_lst['pt'][:n] + when /^pt_BR$|Portuguese Brazil/i then d,c,l=false,lang_lst['pt_BR'][:c], lang_lst['pt_BR'][:n] + when /^ro$|Romanian/i then d,c,l=false,lang_lst['ro'][:c], lang_lst['ro'][:n] + when /^ru$|Russian/i then d,c,l=false,lang_lst['ru'][:c], lang_lst['ru'][:n] + when /^sa$|Sanskrit/i then d,c,l=false,lang_lst['sa'][:c], lang_lst['sa'][:n] + when /^se$|Sami/i then d,c,l=false,lang_lst['se'][:c], lang_lst['se'][:n] + when /^sk$|Slovak/i then d,c,l=false,lang_lst['sk'][:c], lang_lst['sk'][:n] + when /^sl$|Slovenian/i then d,c,l=false,lang_lst['sl'][:c], lang_lst['sl'][:n] + when /^sq$|Albanian/i then d,c,l=false,lang_lst['sq'][:c], lang_lst['sq'][:n] + when /^sr$|Serbian/i then d,c,l=false,lang_lst['sr'][:c], lang_lst['sr'][:n] + when /^sv$|Swedish|Svensk/i then d,c,l=false,lang_lst['sv'][:c], lang_lst['sv'][:n] + when /^ta$|Tamil/i then d,c,l=false,lang_lst['ta'][:c], lang_lst['ta'][:n] + when /^te$|Telugu/i then d,c,l=false,lang_lst['te'][:c], lang_lst['te'][:n] + when /^th$|Thai/i then d,c,l=false,lang_lst['th'][:c], lang_lst['th'][:n] + when /^tk$|Turkmen/i then d,c,l=false,lang_lst['tk'][:c], lang_lst['tk'][:n] + when /^tr$|Turkish/i then d,c,l=false,lang_lst['tr'][:c], lang_lst['tr'][:n] + when /^uk$|Ukranian/i then d,c,l=false,lang_lst['uk'][:c], lang_lst['uk'][:n] + when /^ur$|Urdu/i then d,c,l=false,lang_lst['ur'][:c], lang_lst['ur'][:n] + when /^us|American$|/i then d,c,l=false,lang_lst['en'][:c], lang_lst['en'][:n] + when /^vi$|Vietnamese/i then d,c,l=false,lang_lst['vi'][:c], lang_lst['vi'][:n] else d,c,l=true, lang_lst['en'][:c], lang_lst['en'][:n] #default end lng[:d],lng[:c],lng[:n]=d,c,l @@ -2184,8 +2184,8 @@ WOK end def usr_dir? case root_dir - when /^\/home/; false - else true + when /^\/home/ then false + else true end end def stub_dir @@ -2457,11 +2457,11 @@ WOK def webserv_host_base(opt=nil) if defined? @rc['webserv']['host'] case @rc['webserv']['host'] - when /https?:\/\//; @rc['webserv']['host'] - when /\S+/; "http://#{@rc['webserv']['host']}" - else defaults[:webserv_host_cgi] + when /https?:\/\// then @rc['webserv']['host'] + when /\S+/ then "http://#{@rc['webserv']['host']}" + else defaults[:webserv_host_cgi] end - else defaults[:webserv_host_cgi] + else defaults[:webserv_host_cgi] end end def webserv_cgi(opt=nil) #web url for local webserv (localhost, or hostname) @@ -2555,11 +2555,11 @@ WOK else '' end m=case show_output_on - when /webserv_cgi/; url.webserv_base_cgi(opt) - when /webserv/; @rc['webserv']['url_root'] - when /https?:\/\//; @rc['webserv_cgi']['file_links'] - when /\S+/; "http://#{@rc['webserv_cgi']['file_links']}" - else webserv_base_cgi(opt) + when /webserv_cgi/ then url.webserv_base_cgi(opt) + when /webserv/ then @rc['webserv']['url_root'] + when /https?:\/\// then @rc['webserv_cgi']['file_links'] + when /\S+/ then "http://#{@rc['webserv_cgi']['file_links']}" + else webserv_base_cgi(opt) end end end @@ -2593,15 +2593,15 @@ WOK else 'filesystem' end case output_type - when /^filesystem(?:_url)?/; url.dir_url - when /^remote(?:_webserv)?/; url.remote - when /^(?:webserv|local_webserv)/; url.local - when /^local(:\d+)/; url.hostname + $1 + '/' + stub_pwd - when /^localhost(:\d+)/; url.localhost + $1 + '/' + stub_pwd - when /^localhost/; url.localhost - when /^webrick/; url.webrick - when /^path/; url.webserv_map_pwd - else url.webserv_map_pwd + when /^filesystem(?:_url)?/ then url.dir_url + when /^remote(?:_webserv)?/ then url.remote + when /^(?:webserv|local_webserv)/ then url.local + when /^local(:\d+)/ then url.hostname + $1 + '/' + stub_pwd + when /^localhost(:\d+)/ then url.localhost + $1 + '/' + stub_pwd + when /^localhost/ then url.localhost + when /^webrick/ then url.webrick + when /^path/ then url.webserv_map_pwd + else url.webserv_map_pwd end end def images @@ -2699,18 +2699,18 @@ WOK if defined? @rc['default']['digest'] \ and @rc['default']['digest'] != nil case @rc['default']['digest'] - when /^sha(?:2|256)?$/; 'sha256' - when /^md5$/; 'md5' - else 'sha256' + when /^sha(?:2|256)?$/ then 'sha256' + when /^md5$/ then 'md5' + else 'sha256' end - else 'sha256' + else 'sha256' end end def length case digest.type - when /sha256/; 64 - when /md5/; 32 - else 64 + when /sha256/ then 64 + when /md5/ then 32 + else 64 end end def pattern @@ -3375,9 +3375,9 @@ WOK self.remote_host_base.each do |remote_conn| local_gen=@source_path remote_gen=case @opt.cmd - when /u/; "#{remote_conn[:name]}/#{@env.path.stub_pwd}/." #creates remote directory tree, this is not the usual function of u - when /[abhHNopwxXy]/; "#{remote_conn[:name]}/#{@env.path.stub_pwd}/#{@fnb}/." - else "#{remote_conn[:name]}/#{@env.path.stub_pwd}/." + when /u/ then "#{remote_conn[:name]}/#{@env.path.stub_pwd}/." #creates remote directory tree, this is not the usual function of u + when /[abhHNopwxXy]/ then "#{remote_conn[:name]}/#{@env.path.stub_pwd}/#{@fnb}/." + else "#{remote_conn[:name]}/#{@env.path.stub_pwd}/." end local_epub=@source_path_epub local_src=@source_path_src @@ -6672,9 +6672,9 @@ WOK @md=operation end case operation #watch - when /pdf/; @env_out='' + when /pdf/ then @env_out='' when /sql/ - when /xml|plaintext|ascii/; @env_out="#{@env.path.output}/#{@fnb}" #check change of name to plaintext from ascii + when /xml|plaintext|ascii/ then @env_out="#{@env.path.output}/#{@fnb}" #check change of name to plaintext from ascii else if defined? @md.sfx_src \ and @md.sfx_src =~/ss[ftsumc]/ diff --git a/lib/sisu/v5/texinfo.rb b/lib/sisu/v5/texinfo.rb index b0b43c4f..ba890be3 100644 --- a/lib/sisu/v5/texinfo.rb +++ b/lib/sisu/v5/texinfo.rb @@ -311,9 +311,9 @@ module SiSU_TexInfo mono=SiSU_TexInfoFormat::Texinfo.new(@md,dob) if dob.is==:heading case dob.ln - when 1; dob=mono.level1 - when 2; dob=mono.level2 - when 3; dob=mono.level3 + when 1 then dob=mono.level1 + when 2 then dob=mono.level2 + when 3 then dob=mono.level3 when 4; dob=mono.level4 n_menu+=1 diff --git a/lib/sisu/v5/texpdf.rb b/lib/sisu/v5/texpdf.rb index 3ec84387..4239fac2 100644 --- a/lib/sisu/v5/texpdf.rb +++ b/lib/sisu/v5/texpdf.rb @@ -215,12 +215,12 @@ module SiSU_TeX landscape_pdf="#{pwd}/#{tex_fn_base}.landscape.pdf" end case papersize - when /a4/; pdf_p=@f.pdf_p_a4; pdf_l=@f.pdf_l_a4 - when /a5/; pdf_p=@f.pdf_p_a5; pdf_l=@f.pdf_l_a5 - when /b5/; pdf_p=@f.pdf_p_b5; pdf_l=@f.pdf_l_b5 - when /letter/; pdf_p=@f.pdf_p_letter; pdf_l=@f.pdf_l_letter - when /legal/; pdf_p=@f.pdf_p_legal; pdf_l=@f.pdf_l_legal - else pdf_p=@f.pdf_p_a4; pdf_l=@f.pdf_l_a4 + when /a4/ then pdf_p=@f.pdf_p_a4; pdf_l=@f.pdf_l_a4 + when /a5/ then pdf_p=@f.pdf_p_a5; pdf_l=@f.pdf_l_a5 + when /b5/ then pdf_p=@f.pdf_p_b5; pdf_l=@f.pdf_l_b5 + when /letter/ then pdf_p=@f.pdf_p_letter; pdf_l=@f.pdf_l_letter + when /legal/ then pdf_p=@f.pdf_p_legal; pdf_l=@f.pdf_l_legal + else pdf_p=@f.pdf_p_a4; pdf_l=@f.pdf_l_a4 end FileUtils::mkdir_p(@md.file.output_path.pdf.dir) unless FileTest.directory?(@md.file.output_path.pdf.dir) cX=SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set]).cX @@ -279,12 +279,12 @@ module SiSU_TeX end end case @md.papersize_array[0] #default pdf - when /a4/; pdf_p=@f.pdf_p_a4; pdf_l=@f.pdf_l_a4 - when /a5/; pdf_p=@f.pdf_p_a5; pdf_l=@f.pdf_l_a5 - when /b5/; pdf_p=@f.pdf_p_b5; pdf_l=@f.pdf_l_b5 - when /letter/; pdf_p=@f.pdf_p_letter; pdf_l=@f.pdf_l_letter - when /legal/; pdf_p=@f.pdf_p_legal; pdf_l=@f.pdf_l_legal - else pdf_p=@f.pdf_p_a4; pdf_l=@f.pdf_l_a4 + when /a4/ then pdf_p=@f.pdf_p_a4; pdf_l=@f.pdf_l_a4 + when /a5/ then pdf_p=@f.pdf_p_a5; pdf_l=@f.pdf_l_a5 + when /b5/ then pdf_p=@f.pdf_p_b5; pdf_l=@f.pdf_l_b5 + when /letter/ then pdf_p=@f.pdf_p_letter; pdf_l=@f.pdf_l_letter + when /legal/ then pdf_p=@f.pdf_p_legal; pdf_l=@f.pdf_l_legal + else pdf_p=@f.pdf_p_a4; pdf_l=@f.pdf_l_a4 end if @md.opt.act[:pdf_p][:set]==:on if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{pdf_p}") diff --git a/lib/sisu/v5/texpdf_format.rb b/lib/sisu/v5/texpdf_format.rb index abbe17f4..d97f3618 100644 --- a/lib/sisu/v5/texpdf_format.rb +++ b/lib/sisu/v5/texpdf_format.rb @@ -134,11 +134,11 @@ module SiSU_TeX_Pdf row_break='\\\\\\' if @dob.is==:table tw=case @dob.tmp[:paper_size] - when /a4/i; @tx.a4.landscape.w #European default, SiSU default - when /letter/i; @tx.letter.landscape.w #U.S. default - when /legal/i; @tx.legal.landscape.w #U.S. alternative - when /book|b5/i; @tx.b5.landscape.w #book default - larger - when /a5/i; @tx.a5.landscape.w + when /a4/i then @tx.a4.landscape.w #European default, SiSU default + when /letter/i then @tx.letter.landscape.w #U.S. default + when /legal/i then @tx.legal.landscape.w #U.S. alternative + when /book|b5/i then @tx.b5.landscape.w #book default - larger + when /a5/i then @tx.a5.landscape.w else @tx.a4.landscape.w #default currently A4 end textwidth=(tw.to_i/2) - 24 @@ -179,11 +179,11 @@ module SiSU_TeX_Pdf row_break='\\\\\\' if @dob.is==:table tw=case @dob.tmp[:paper_size] - when /a4/i; @tx.a4.portrait.w #European default, SiSU default - when /letter/i; @tx.letter.portrait.w #U.S. default - when /legal/i; @tx.legal.portrait.w #U.S. alternative - when /book|b5/i; @tx.b5.portrait.w #book default - larger - when /a5/i; @tx.a5.portrait.w + when /a4/i then @tx.a4.portrait.w #European default, SiSU default + when /letter/i then @tx.letter.portrait.w #U.S. default + when /legal/i then @tx.legal.portrait.w #U.S. alternative + when /book|b5/i then @tx.b5.portrait.w #book default - larger + when /a5/i then @tx.a5.portrait.w else @tx.a4.portrait.w #default currently A4 end textwidth=tw.to_i - 20 @@ -312,163 +312,163 @@ module SiSU_TeX_Pdf case @dob.indent when /0/ case @dob.hang - when /0/; indent,hang='0mm', '0mm' - when /1/; indent,hang='0mm','10mm' - when /2/; indent,hang='0mm','20mm' - when /3/; indent,hang='0mm','30mm' - when /4/; indent,hang='0mm','40mm' - when /5/; indent,hang='0mm','50mm' - when /6/; indent,hang='0mm','60mm' - when /7/; indent,hang='0mm','70mm' - when /8/; indent,hang='0mm','80mm' - when /9/; indent,hang='0mm','90mm' + when /0/ then indent,hang='0mm', '0mm' + when /1/ then indent,hang='0mm','10mm' + when /2/ then indent,hang='0mm','20mm' + when /3/ then indent,hang='0mm','30mm' + when /4/ then indent,hang='0mm','40mm' + when /5/ then indent,hang='0mm','50mm' + when /6/ then indent,hang='0mm','60mm' + when /7/ then indent,hang='0mm','70mm' + when /8/ then indent,hang='0mm','80mm' + when /9/ then indent,hang='0mm','90mm' end when /1/ case @dob.hang - when /0/; indent,hang='10mm','-10mm' - when /1/; indent,hang='10mm', '0mm' - when /2/; indent,hang='10mm', '10mm' - when /3/; indent,hang='10mm', '20mm' - when /4/; indent,hang='10mm', '30mm' - when /5/; indent,hang='10mm', '40mm' - when /6/; indent,hang='10mm', '50mm' - when /7/; indent,hang='10mm', '60mm' - when /8/; indent,hang='10mm', '70mm' - when /9/; indent,hang='10mm', '80mm' + when /0/ then indent,hang='10mm','-10mm' + when /1/ then indent,hang='10mm', '0mm' + when /2/ then indent,hang='10mm', '10mm' + when /3/ then indent,hang='10mm', '20mm' + when /4/ then indent,hang='10mm', '30mm' + when /5/ then indent,hang='10mm', '40mm' + when /6/ then indent,hang='10mm', '50mm' + when /7/ then indent,hang='10mm', '60mm' + when /8/ then indent,hang='10mm', '70mm' + when /9/ then indent,hang='10mm', '80mm' end when /2/ case @dob.hang - when /0/; indent,hang='20mm','-20mm' - when /1/; indent,hang='20mm','-10mm' - when /2/; indent,hang='20mm', '0mm' - when /3/; indent,hang='20mm', '10mm' - when /4/; indent,hang='20mm', '20mm' - when /5/; indent,hang='20mm', '30mm' - when /6/; indent,hang='20mm', '40mm' - when /7/; indent,hang='20mm', '50mm' - when /8/; indent,hang='20mm', '60mm' - when /9/; indent,hang='20mm', '70mm' + when /0/ then indent,hang='20mm','-20mm' + when /1/ then indent,hang='20mm','-10mm' + when /2/ then indent,hang='20mm', '0mm' + when /3/ then indent,hang='20mm', '10mm' + when /4/ then indent,hang='20mm', '20mm' + when /5/ then indent,hang='20mm', '30mm' + when /6/ then indent,hang='20mm', '40mm' + when /7/ then indent,hang='20mm', '50mm' + when /8/ then indent,hang='20mm', '60mm' + when /9/ then indent,hang='20mm', '70mm' end when /3/ case @dob.hang - when /0/; indent,hang='30mm','-30mm' - when /1/; indent,hang='30mm','-20mm' - when /2/; indent,hang='30mm','-10mm' - when /3/; indent,hang='30mm', '0mm' - when /4/; indent,hang='30mm', '10mm' - when /5/; indent,hang='30mm', '20mm' - when /6/; indent,hang='30mm', '30mm' - when /7/; indent,hang='30mm', '40mm' - when /8/; indent,hang='30mm', '50mm' - when /9/; indent,hang='30mm', '60mm' + when /0/ then indent,hang='30mm','-30mm' + when /1/ then indent,hang='30mm','-20mm' + when /2/ then indent,hang='30mm','-10mm' + when /3/ then indent,hang='30mm', '0mm' + when /4/ then indent,hang='30mm', '10mm' + when /5/ then indent,hang='30mm', '20mm' + when /6/ then indent,hang='30mm', '30mm' + when /7/ then indent,hang='30mm', '40mm' + when /8/ then indent,hang='30mm', '50mm' + when /9/ then indent,hang='30mm', '60mm' end when /4/ case @dob.hang - when /0/; indent,hang='40mm','-40mm' - when /1/; indent,hang='40mm','-30mm' - when /2/; indent,hang='40mm','-20mm' - when /3/; indent,hang='40mm','-10mm' - when /4/; indent,hang='40mm', '0mm' - when /5/; indent,hang='40mm', '10mm' - when /6/; indent,hang='40mm', '20mm' - when /7/; indent,hang='40mm', '30mm' - when /8/; indent,hang='40mm', '40mm' - when /9/; indent,hang='40mm', '50mm' + when /0/ then indent,hang='40mm','-40mm' + when /1/ then indent,hang='40mm','-30mm' + when /2/ then indent,hang='40mm','-20mm' + when /3/ then indent,hang='40mm','-10mm' + when /4/ then indent,hang='40mm', '0mm' + when /5/ then indent,hang='40mm', '10mm' + when /6/ then indent,hang='40mm', '20mm' + when /7/ then indent,hang='40mm', '30mm' + when /8/ then indent,hang='40mm', '40mm' + when /9/ then indent,hang='40mm', '50mm' end when /5/ case @dob.hang - when /0/; indent,hang='50mm','-50mm' - when /1/; indent,hang='50mm','-40mm' - when /2/; indent,hang='50mm','-30mm' - when /3/; indent,hang='50mm','-20mm' - when /4/; indent,hang='50mm','-10mm' - when /5/; indent,hang='50mm', '0mm' - when /6/; indent,hang='50mm', '10mm' - when /7/; indent,hang='50mm', '20mm' - when /8/; indent,hang='50mm', '30mm' - when /9/; indent,hang='50mm', '40mm' + when /0/ then indent,hang='50mm','-50mm' + when /1/ then indent,hang='50mm','-40mm' + when /2/ then indent,hang='50mm','-30mm' + when /3/ then indent,hang='50mm','-20mm' + when /4/ then indent,hang='50mm','-10mm' + when /5/ then indent,hang='50mm', '0mm' + when /6/ then indent,hang='50mm', '10mm' + when /7/ then indent,hang='50mm', '20mm' + when /8/ then indent,hang='50mm', '30mm' + when /9/ then indent,hang='50mm', '40mm' end when /6/ case @dob.hang - when /0/; indent,hang='60mm','-60mm' - when /1/; indent,hang='60mm','-50mm' - when /2/; indent,hang='60mm','-40mm' - when /3/; indent,hang='60mm','-30mm' - when /4/; indent,hang='60mm','-20mm' - when /5/; indent,hang='60mm','-10mm' - when /6/; indent,hang='60mm', '0mm' - when /7/; indent,hang='60mm', '10mm' - when /8/; indent,hang='60mm', '20mm' - when /9/; indent,hang='60mm', '30mm' + when /0/ then indent,hang='60mm','-60mm' + when /1/ then indent,hang='60mm','-50mm' + when /2/ then indent,hang='60mm','-40mm' + when /3/ then indent,hang='60mm','-30mm' + when /4/ then indent,hang='60mm','-20mm' + when /5/ then indent,hang='60mm','-10mm' + when /6/ then indent,hang='60mm', '0mm' + when /7/ then indent,hang='60mm', '10mm' + when /8/ then indent,hang='60mm', '20mm' + when /9/ then indent,hang='60mm', '30mm' end when /7/ case @dob.hang - when /0/; indent,hang='70mm','-70mm' - when /1/; indent,hang='70mm','-60mm' - when /2/; indent,hang='70mm','-50mm' - when /3/; indent,hang='70mm','-40mm' - when /4/; indent,hang='70mm','-30mm' - when /5/; indent,hang='70mm','-20mm' - when /6/; indent,hang='70mm','-10mm' - when /7/; indent,hang='70mm', '0mm' - when /8/; indent,hang='70mm', '10mm' - when /9/; indent,hang='70mm', '20mm' + when /0/ then indent,hang='70mm','-70mm' + when /1/ then indent,hang='70mm','-60mm' + when /2/ then indent,hang='70mm','-50mm' + when /3/ then indent,hang='70mm','-40mm' + when /4/ then indent,hang='70mm','-30mm' + when /5/ then indent,hang='70mm','-20mm' + when /6/ then indent,hang='70mm','-10mm' + when /7/ then indent,hang='70mm', '0mm' + when /8/ then indent,hang='70mm', '10mm' + when /9/ then indent,hang='70mm', '20mm' end when /8/ case @dob.hang - when /0/; indent,hang='80mm','-80mm' - when /1/; indent,hang='80mm','-70mm' - when /2/; indent,hang='80mm','-60mm' - when /3/; indent,hang='80mm','-50mm' - when /4/; indent,hang='80mm','-40mm' - when /5/; indent,hang='80mm','-30mm' - when /6/; indent,hang='80mm','-20mm' - when /7/; indent,hang='80mm','-10mm' - when /8/; indent,hang='80mm', '0mm' - when /9/; indent,hang='80mm', '10mm' + when /0/ then indent,hang='80mm','-80mm' + when /1/ then indent,hang='80mm','-70mm' + when /2/ then indent,hang='80mm','-60mm' + when /3/ then indent,hang='80mm','-50mm' + when /4/ then indent,hang='80mm','-40mm' + when /5/ then indent,hang='80mm','-30mm' + when /6/ then indent,hang='80mm','-20mm' + when /7/ then indent,hang='80mm','-10mm' + when /8/ then indent,hang='80mm', '0mm' + when /9/ then indent,hang='80mm', '10mm' end when /9/ case @dob.hang - when /0/; indent,hang='90mm','-90mm' - when /1/; indent,hang='90mm','-80mm' - when /2/; indent,hang='90mm','-70mm' - when /3/; indent,hang='90mm','-60mm' - when /4/; indent,hang='90mm','-50mm' - when /5/; indent,hang='90mm','-40mm' - when /6/; indent,hang='90mm','-30mm' - when /7/; indent,hang='90mm','-20mm' - when /8/; indent,hang='90mm','-10mm' - when /9/; indent,hang='90mm', '0mm' + when /0/ then indent,hang='90mm','-90mm' + when /1/ then indent,hang='90mm','-80mm' + when /2/ then indent,hang='90mm','-70mm' + when /3/ then indent,hang='90mm','-60mm' + when /4/ then indent,hang='90mm','-50mm' + when /5/ then indent,hang='90mm','-40mm' + when /6/ then indent,hang='90mm','-30mm' + when /7/ then indent,hang='90mm','-20mm' + when /8/ then indent,hang='90mm','-10mm' + when /9/ then indent,hang='90mm', '0mm' end end "\\begin{ParagraphHang}{#{indent}}{#{hang}}#{@dob.tmp} \\end{ParagraphHang}}" end def indent indent=case @dob.indent - when /1/; '0mm' - when /2/; '10mm' - when /3/; '20mm' - when /4/; '30mm' - when /5/; '40mm' - when /6/; '50mm' - when /7/; '60mm' - when /8/; '70mm' - when /9/; '80mm' + when /1/ then '0mm' + when /2/ then '10mm' + when /3/ then '20mm' + when /4/ then '30mm' + when /5/ then '40mm' + when /6/ then '50mm' + when /7/ then '60mm' + when /8/ then '70mm' + when /9/ then '80mm' end "\\begin{ParagraphIndent}{#{indent}}#{@dob.tmp} \\end{ParagraphIndent}}" end def bullet blt=if @dob.indent indent=case @dob.indent - when /1/; '0em' - when /2/; '1.0em' - when /3/; '2.0em' - when /4/; '3.0em' - when /5/; '4.0em' - when /6/; '5.0em' - when /7/; '6.0em' - when /8/; '7.0em' - when /9/; '8.0em' + when /1/ then '0em' + when /2/ then '1.0em' + when /3/ then '2.0em' + when /4/ then '3.0em' + when /5/ then '4.0em' + when /6/ then '5.0em' + when /7/ then '6.0em' + when /8/ then '7.0em' + when /9/ then '8.0em' else '-1.0em' end "\\begin{Bullet}{#{indent}}$\\txtbullet$\\hspace{\\enspace}#{@dob.tmp}\\end{Bullet}" @@ -817,9 +817,9 @@ module SiSU_TeX_Pdf @md.make.texpdf_font.cjk else case @md.opt.lng - when /zh/; @env.font.texpdf.cjk_zh - when /ja/; @env.font.texpdf.cjk_ja - when /ko/; @env.font.texpdf.cjk_ko + when /zh/ then @env.font.texpdf.cjk_zh + when /ja/ then @env.font.texpdf.cjk_ja + when /ko/ then @env.font.texpdf.cjk_ko else @env.font.texpdf.cjk end end @@ -1498,7 +1498,7 @@ module SiSU_TeX_Pdf v=SiSU_Env::InfoVersion.instance.get_version base_prog_txt=if @md.base_program case @md.base_program - when /kdissert/i; "\n\\\\ This document prepared using \\href{http://freehackers.org/~tnagy/kdissert/}{Kdissert \\ http://freehackers.org/~tnagy/kdissert/ } \\\\ Kdissert is Document Mapping software by Thomas Nagy" + when /kdissert/i then "\n\\\\ This document prepared using \\href{http://freehackers.org/~tnagy/kdissert/}{Kdissert \\ http://freehackers.org/~tnagy/kdissert/ } \\\\ Kdissert is Document Mapping software by Thomas Nagy" else '' end else '' diff --git a/lib/sisu/v5/txt_asciidoc.rb b/lib/sisu/v5/txt_asciidoc.rb index 8c2f3c97..4e0e3d48 100644 --- a/lib/sisu/v5/txt_asciidoc.rb +++ b/lib/sisu/v5/txt_asciidoc.rb @@ -127,9 +127,9 @@ module SiSU_Txt_AsciiDoc @brace_url=SiSU_Viz::Defaults.new.url_decoration @tab="\t" @@endnotes_=case md.opt.mod.inspect - when /--footnote/; false - when /--endnote/; true - else true + when /--footnote/ then false + when /--endnote/ then true + else true end @plaintext={ body: [], open: [], close: [], head: [], metadata: [], tail: [] } end diff --git a/lib/sisu/v5/txt_markdown.rb b/lib/sisu/v5/txt_markdown.rb index 24eee6f0..3a943876 100644 --- a/lib/sisu/v5/txt_markdown.rb +++ b/lib/sisu/v5/txt_markdown.rb @@ -127,9 +127,9 @@ module SiSU_Txt_Markdown @brace_url=SiSU_Viz::Defaults.new.url_decoration @tab="\t" @@endnotes_=case md.opt.mod.inspect - when /--footnote/; false - when /--endnote/; true - else true + when /--footnote/ then false + when /--endnote/ then true + else true end @plaintext={ body: [], open: [], close: [], head: [], metadata: [], tail: [] } end diff --git a/lib/sisu/v5/txt_plain.rb b/lib/sisu/v5/txt_plain.rb index fbe551f4..81fe7e3a 100644 --- a/lib/sisu/v5/txt_plain.rb +++ b/lib/sisu/v5/txt_plain.rb @@ -128,9 +128,9 @@ module SiSU_Txt_Plain @brace_url=SiSU_Viz::Defaults.new.url_decoration @tab="\t" @@endnotes_=case md.opt.mod.inspect - when /--footnote/; false - when /--endnote/; true - else true + when /--footnote/ then false + when /--endnote/ then true + else true end @plaintext={ body: [], open: [], close: [], head: [], metadata: [], tail: [] } end @@ -377,12 +377,12 @@ WOK times=wrapped.length times=@wrap_width if times > @wrap_width @plaintext[:body] << case lv - when 1; wrapped.upcase << break_line << decorate.heading_underscore.l1*times + p_num << break_line*2 - when 2; wrapped.upcase << break_line << decorate.heading_underscore.l2*times + p_num << break_line*2 - when 3; wrapped.upcase << break_line << decorate.heading_underscore.l3*times + p_num << break_line*2 - when 4; wrapped.upcase << break_line << decorate.heading_underscore.l4*times + p_num << break_line*2 - when 5; wrapped.upcase << break_line << decorate.heading_underscore.l5*times + p_num << break_line*2 - when 6; wrapped.upcase << break_line << decorate.heading_underscore.l6*times + p_num << break_line*2 + when 1 then wrapped.upcase << break_line << decorate.heading_underscore.l1*times + p_num << break_line*2 + when 2 then wrapped.upcase << break_line << decorate.heading_underscore.l2*times + p_num << break_line*2 + when 3 then wrapped.upcase << break_line << decorate.heading_underscore.l3*times + p_num << break_line*2 + when 4 then wrapped.upcase << break_line << decorate.heading_underscore.l4*times + p_num << break_line*2 + when 5 then wrapped.upcase << break_line << decorate.heading_underscore.l5*times + p_num << break_line*2 + when 6 then wrapped.upcase << break_line << decorate.heading_underscore.l6*times + p_num << break_line*2 end else @plaintext[:body] << wrapped + p_num << break_line # main text, contents, body KEEP diff --git a/lib/sisu/v5/txt_rst.rb b/lib/sisu/v5/txt_rst.rb index d62b3a3e..8cf382d3 100644 --- a/lib/sisu/v5/txt_rst.rb +++ b/lib/sisu/v5/txt_rst.rb @@ -127,9 +127,9 @@ module SiSU_Txt_rST @brace_url=SiSU_Viz::Defaults.new.url_decoration @tab="\t" @@endnotes_=case md.opt.mod.inspect - when /--footnote/; false - when /--endnote/; true - else true + when /--footnote/ then false + when /--endnote/ then true + else true end @plaintext={ body: [], open: [], close: [], head: [], metadata: [], tail: [] } end diff --git a/lib/sisu/v5/txt_shared.rb b/lib/sisu/v5/txt_shared.rb index ff259b84..0b6c1953 100644 --- a/lib/sisu/v5/txt_shared.rb +++ b/lib/sisu/v5/txt_shared.rb @@ -177,52 +177,52 @@ module SiSU_TextUtils end def start_is_match case @p - when /^#{Mx[:meta_o]}(title)#{Mx[:meta_c]}\s*(.+?)$/; header($1,@md.title.full,'meta','dc') #dc 1 - when /^#{Mx[:meta_o]}(creator|author)#{Mx[:meta_c]}\s*(.+?)$/; header('creator',$2,'meta','dc') #dc 2 - when /^#{Mx[:meta_o]}(subject)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 3 - when /^#{Mx[:meta_o]}(description)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 4 - when /^#{Mx[:meta_o]}(publisher)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 5 - when /^#{Mx[:meta_o]}(contributor)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 6 - when /^#{Mx[:meta_o]}(date)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 7 - when /^#{Mx[:meta_o]}(date\.created)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(date\.issued)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(date\.available)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(date\.valid)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(date\.modified)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(type)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 8 - when /^#{Mx[:meta_o]}(format)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 9 - when /^#{Mx[:meta_o]}(identifier)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 10 - when /^#{Mx[:meta_o]}(source)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 11 - when /^#{Mx[:meta_o]}(language)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 12 - when /^#{Mx[:meta_o]}(relation)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 13 - when /^#{Mx[:meta_o]}(coverage)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 14 - when /^#{Mx[:meta_o]}(rights)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 15 - when /^#{Mx[:meta_o]}(keywords)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(copyright)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(translator|translated_by)#{Mx[:meta_c]}\s*(.+?)$/; header('translator',$2) - when /^#{Mx[:meta_o]}(illustrator|illustrated_by)#{Mx[:meta_c]}\s*(.+?)$/; header('illustrator',$2) - when /^#{Mx[:meta_o]}(prepared_by)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(digitized_by)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(comments?)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(abstract)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(tags?)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(catalogue)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') - when /^#{Mx[:meta_o]}(class(?:ify)?_loc)#{Mx[:meta_c]}\s*(.+?)$/; header('classify_loc',$2,'meta','extra') - when /^#{Mx[:meta_o]}(class(?:ify)?_dewey)#{Mx[:meta_c]}\s*(.+?)$/; header('classify_dewey',$2,'meta','extra') - when /^#{Mx[:meta_o]}(class(?:ify)?_pg)#{Mx[:meta_c]}\s*(.+?)$/; header('classify_pg',$2,'meta','extra') - when /^#{Mx[:meta_o]}(class(?:ify)?_isbn)#{Mx[:meta_c]}\s*(.+?)$/; header('classify_isbn',$2,'meta','extra') - when /^#{Mx[:meta_o]}(toc|structure)#{Mx[:meta_c]}\s*(.+?)$/; header('structure',$2,'process','instruct') - when /^#{Mx[:meta_o]}(level|page|markup)#{Mx[:meta_c]}\s*(.+?)$/; header('markup',$2,'process','instruct') - when /^#{Mx[:meta_o]}(bold)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') - when /^#{Mx[:meta_o]}(italics|itali[sz]e)#{Mx[:meta_c]}\s*(.+?)$/; header('italicize',$2,'process','instruct') - when /^#{Mx[:meta_o]}(vocabulary|wordlist)#{Mx[:meta_c]}\s*(.+?)$/; header('vocabulary',$2,'process','instruct') - when /^#{Mx[:meta_o]}(css|stylesheet)#{Mx[:meta_c]}\s*(.+?)$/; header('css',$2,'process','instruct') - when /^#{Mx[:meta_o]}(links)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') - when /^#{Mx[:meta_o]}(prefix)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') #add a & b - when /^#{Mx[:meta_o]}(suffix)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') - when /^#{Mx[:meta_o]}(information)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') - when /^#{Mx[:meta_o]}(contact)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') - when /^#{Mx[:meta_o]}(rcs|cvs)#{Mx[:meta_c]}\s*(.+?)$/; header('version',$2,'process','instruct') + when /^#{Mx[:meta_o]}(title)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,@md.title.full,'meta','dc') #dc 1 + when /^#{Mx[:meta_o]}(creator|author)#{Mx[:meta_c]}\s*(.+?)$/ then header('creator',$2,'meta','dc') #dc 2 + when /^#{Mx[:meta_o]}(subject)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 3 + when /^#{Mx[:meta_o]}(description)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 4 + when /^#{Mx[:meta_o]}(publisher)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 5 + when /^#{Mx[:meta_o]}(contributor)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 6 + when /^#{Mx[:meta_o]}(date)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 7 + when /^#{Mx[:meta_o]}(date\.created)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(date\.issued)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(date\.available)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(date\.valid)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(date\.modified)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(type)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 8 + when /^#{Mx[:meta_o]}(format)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 9 + when /^#{Mx[:meta_o]}(identifier)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 10 + when /^#{Mx[:meta_o]}(source)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 11 + when /^#{Mx[:meta_o]}(language)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 12 + when /^#{Mx[:meta_o]}(relation)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 13 + when /^#{Mx[:meta_o]}(coverage)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 14 + when /^#{Mx[:meta_o]}(rights)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','dc') #dc 15 + when /^#{Mx[:meta_o]}(keywords)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(copyright)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(translator|translated_by)#{Mx[:meta_c]}\s*(.+?)$/ then header('translator',$2) + when /^#{Mx[:meta_o]}(illustrator|illustrated_by)#{Mx[:meta_c]}\s*(.+?)$/ then header('illustrator',$2) + when /^#{Mx[:meta_o]}(prepared_by)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(digitized_by)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(comments?)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(abstract)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(tags?)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(catalogue)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(class(?:ify)?_loc)#{Mx[:meta_c]}\s*(.+?)$/ then header('classify_loc',$2,'meta','extra') + when /^#{Mx[:meta_o]}(class(?:ify)?_dewey)#{Mx[:meta_c]}\s*(.+?)$/ then header('classify_dewey',$2,'meta','extra') + when /^#{Mx[:meta_o]}(class(?:ify)?_pg)#{Mx[:meta_c]}\s*(.+?)$/ then header('classify_pg',$2,'meta','extra') + when /^#{Mx[:meta_o]}(class(?:ify)?_isbn)#{Mx[:meta_c]}\s*(.+?)$/ then header('classify_isbn',$2,'meta','extra') + when /^#{Mx[:meta_o]}(toc|structure)#{Mx[:meta_c]}\s*(.+?)$/ then header('structure',$2,'process','instruct') + when /^#{Mx[:meta_o]}(level|page|markup)#{Mx[:meta_c]}\s*(.+?)$/ then header('markup',$2,'process','instruct') + when /^#{Mx[:meta_o]}(bold)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'process','instruct') + when /^#{Mx[:meta_o]}(italics|itali[sz]e)#{Mx[:meta_c]}\s*(.+?)$/ then header('italicize',$2,'process','instruct') + when /^#{Mx[:meta_o]}(vocabulary|wordlist)#{Mx[:meta_c]}\s*(.+?)$/ then header('vocabulary',$2,'process','instruct') + when /^#{Mx[:meta_o]}(css|stylesheet)#{Mx[:meta_c]}\s*(.+?)$/ then header('css',$2,'process','instruct') + when /^#{Mx[:meta_o]}(links)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'process','instruct') + when /^#{Mx[:meta_o]}(prefix)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'process','instruct') #add a & b + when /^#{Mx[:meta_o]}(suffix)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'process','instruct') + when /^#{Mx[:meta_o]}(information)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'process','instruct') + when /^#{Mx[:meta_o]}(contact)#{Mx[:meta_c]}\s*(.+?)$/ then header($1,$2,'process','instruct') + when /^#{Mx[:meta_o]}(rcs|cvs)#{Mx[:meta_c]}\s*(.+?)$/ then header('version',$2,'process','instruct') else nil end end diff --git a/lib/sisu/v5/txt_textile.rb b/lib/sisu/v5/txt_textile.rb index aaa6066a..ddba6b6c 100644 --- a/lib/sisu/v5/txt_textile.rb +++ b/lib/sisu/v5/txt_textile.rb @@ -127,9 +127,9 @@ module SiSU_Txt_Textile @brace_url=SiSU_Viz::Defaults.new.url_decoration @tab="\t" @@endnotes_=case md.opt.mod.inspect - when /--footnote/; false - when /--endnote/; true - else true + when /--footnote/ then false + when /--endnote/ then true + else true end @plaintext={ body: [], open: [], close: [], head: [], metadata: [], tail: [] } end @@ -346,12 +346,12 @@ WOK end def heading_decorated_inline(dob) heading_inline = case dob.lc - when 1; decorate.heading.inline.l1 - when 2; decorate.heading.inline.l2 - when 3; decorate.heading.inline.l3 - when 4; decorate.heading.inline.l4 - when 5; decorate.heading.inline.l5 - when 6; decorate.heading.inline.l6 + when 1 then decorate.heading.inline.l1 + when 2 then decorate.heading.inline.l2 + when 3 then decorate.heading.inline.l3 + when 4 then decorate.heading.inline.l4 + when 5 then decorate.heading.inline.l5 + when 6 then decorate.heading.inline.l6 end heading_inline + ' ' + dob.obj end diff --git a/lib/sisu/v5/utils.rb b/lib/sisu/v5/utils.rb index ecdbc395..97ca24be 100644 --- a/lib/sisu/v5/utils.rb +++ b/lib/sisu/v5/utils.rb @@ -69,25 +69,25 @@ module SiSU_Utils @color=color ? color : @color c={} c[:on]=case @color - when :red; ANSI_C[:red] - when :green; ANSI_C[:green] - when :yellow; ANSI_C[:yellow] - when :blue; ANSI_C[:blue] - when :fuchsia; ANSI_C[:fuchsia] - when :cyan; ANSI_C[:cyan] - when :inv_red; ANSI_C[:inv_red] - when :inv_green; ANSI_C[:inv_green] - when :inv_yellow; ANSI_C[:inv_yellow] - when :inv_blue; ANSI_C[:inv_blue] - when :inv_fuchsia; ANSI_C[:inv_fuchsia] - when :inv_cyan; ANSI_C[:inv_cyan] - when :b_red; ANSI_C[:b_red] - when :b_green; ANSI_C[:b_green] - when :b_yellow; ANSI_C[:b_yellow] - when :b_blue; ANSI_C[:b_blue] - when :b_fuchsia; ANSI_C[:b_fuchsia] - when :b_cyan; ANSI_C[:b_cyan] - else ANSI_C[:red] + when :red then ANSI_C[:red] + when :green then ANSI_C[:green] + when :yellow then ANSI_C[:yellow] + when :blue then ANSI_C[:blue] + when :fuchsia then ANSI_C[:fuchsia] + when :cyan then ANSI_C[:cyan] + when :inv_red then ANSI_C[:inv_red] + when :inv_green then ANSI_C[:inv_green] + when :inv_yellow then ANSI_C[:inv_yellow] + when :inv_blue then ANSI_C[:inv_blue] + when :inv_fuchsia then ANSI_C[:inv_fuchsia] + when :inv_cyan then ANSI_C[:inv_cyan] + when :b_red then ANSI_C[:b_red] + when :b_green then ANSI_C[:b_green] + when :b_yellow then ANSI_C[:b_yellow] + when :b_blue then ANSI_C[:b_blue] + when :b_fuchsia then ANSI_C[:b_fuchsia] + when :b_cyan then ANSI_C[:b_cyan] + else ANSI_C[:red] end c[:off]= ANSI_C[:off] #ansi_color + @line.to_s + ansi_color_off + ' ' + @file.gsub(/([^\/]+$)/,"#{ansi_color}\\1#{ansi_color_off}") diff --git a/lib/sisu/v5/wikispeak.rb b/lib/sisu/v5/wikispeak.rb index a50fb525..04626030 100644 --- a/lib/sisu/v5/wikispeak.rb +++ b/lib/sisu/v5/wikispeak.rb @@ -223,10 +223,10 @@ WOK para.gsub!(/<\S+?>#{Mx[:id_o]}#{@dp}:#{@dp}#{Mx[:id_c]}/,'') # endnote marker marked up if lv @@wiki[:body] << case lv - when 1; '='*2 << para.strip << @br*2 - when 2..3; '='*2 << para.strip << @br*2 - when 4; '='*4 << para.strip << @br*2 - when 5..6; '='*4 << para.strip << @br*2 + when 1 then '='*2 << para.strip << @br*2 + when 2..3 then '='*2 << para.strip << @br*2 + when 4 then '='*4 << para.strip << @br*2 + when 5..6 then '='*4 << para.strip << @br*2 end else @@wiki[:body] << para << @br*2 # main text, contents, body KEEP end diff --git a/lib/sisu/v5/xhtml.rb b/lib/sisu/v5/xhtml.rb index fa151540..932afd0b 100644 --- a/lib/sisu/v5/xhtml.rb +++ b/lib/sisu/v5/xhtml.rb @@ -317,12 +317,12 @@ WOK if dob.is==:heading xml_structure(dob) dob.obj=case dob.ln - when 1; x.heading_body1 - when 2; x.heading_body2 - when 3; x.heading_body3 - when 4; x.heading_body4 - when 5; x.heading_body5 - when 6; x.heading_body6 + when 1 then x.heading_body1 + when 2 then x.heading_body2 + when 3 then x.heading_body3 + when 4 then x.heading_body4 + when 5 then x.heading_body5 + when 6 then x.heading_body6 end else if dob.is ==:verse diff --git a/lib/sisu/v5/xhtml_epub2_concordance.rb b/lib/sisu/v5/xhtml_epub2_concordance.rb index e75b3366..6324a8cd 100644 --- a/lib/sisu/v5/xhtml_epub2_concordance.rb +++ b/lib/sisu/v5/xhtml_epub2_concordance.rb @@ -277,9 +277,9 @@ WOK @word_map[word] << location_seg("#{@seg}\##{toy}",toy) else @word_map[word] << case line - when @rxp_lv1; location_seg('T1',toy) - when @rxp_lv2; location_seg('T2',toy) - when @rxp_lv3; location_seg('T3',toy) + when @rxp_lv1 then location_seg('T1',toy) + when @rxp_lv2 then location_seg('T2',toy) + when @rxp_lv3 then location_seg('T3',toy) end end end diff --git a/lib/sisu/v5/xml_odf_odt_format.rb b/lib/sisu/v5/xml_odf_odt_format.rb index 96bd2891..2a092011 100644 --- a/lib/sisu/v5/xml_odf_odt_format.rb +++ b/lib/sisu/v5/xml_odf_odt_format.rb @@ -180,21 +180,21 @@ module SiSU_XML_ODF_ODT_Format ? 1 : 2 alpha=case @dob.cols - when 1; 'A' - when 2; 'B' - when 3; 'C' - when 4; 'D' - when 5; 'E' - when 6; 'F' - when 7; 'G' - when 8; 'H' - when 9; 'I' - when 10; 'J' - when 11; 'K' - when 12; 'L' - when 13; 'M' - when 14; 'N' - else 'D' + when 1 then 'A' + when 2 then 'B' + when 3 then 'C' + when 4 then 'D' + when 5 then 'E' + when 6 then 'F' + when 7 then 'G' + when 8 then 'H' + when 9 then 'I' + when 10 then 'J' + when 11 then 'K' + when 12 then 'L' + when 13 then 'M' + when 14 then 'N' + else 'D' end tag=SiSU_XML_ODF_ODT_Format::Tags.new.set_bookmark_tag(@dob) %{#{@p_num[:set_ref]}#{tag}#{break_line}} + diff --git a/lib/sisu/v5/xml_sax.rb b/lib/sisu/v5/xml_sax.rb index 88206a3e..1554056b 100644 --- a/lib/sisu/v5/xml_sax.rb +++ b/lib/sisu/v5/xml_sax.rb @@ -342,12 +342,12 @@ WOK if dob.is==:heading xml_structure(dob) dob.obj=case dob.ln - when 1; x.heading_body1 - when 2; x.heading_body2 - when 3; x.heading_body3 - when 4; x.heading_body4 - when 5; x.heading_body5 - when 6; x.heading_body6 + when 1 then x.heading_body1 + when 2 then x.heading_body2 + when 3 then x.heading_body3 + when 4 then x.heading_body4 + when 5 then x.heading_body5 + when 6 then x.heading_body6 end else if dob.is==:verse -- cgit v1.2.3