diff options
Diffstat (limited to 'lib')
42 files changed, 1158 insertions, 314 deletions
| diff --git a/lib/sisu/v5/ao_doc_str.rb b/lib/sisu/v5/ao_doc_str.rb index 931e51d3..11990abf 100644 --- a/lib/sisu/v5/ao_doc_str.rb +++ b/lib/sisu/v5/ao_doc_str.rb @@ -1223,7 +1223,7 @@ module SiSU_AO_DocumentStructureExtract      end      def structure_info        def lv -        %w[A~ B~ C~ D~ 1 2 3] +        %w[A~ B~ C~ D~ 1 2 3 4]        end        def possible_parents(child)          case child @@ -1234,6 +1234,7 @@ module SiSU_AO_DocumentStructureExtract          when /1/  then 'A~, B~, C~, D~'          when /2/  then '1'          when /3/  then '2' +        when /4/  then '3'          end        end        def possible_children(parent) @@ -1244,20 +1245,21 @@ module SiSU_AO_DocumentStructureExtract          when /D~/ then '1'          when /1/  then '2'          when /2/  then '3' -        when /3/  then 'none' +        when /3/  then '4' +        when /4/  then 'none'          end        end        self      end      def document_structure_check_info(node,node_parent,status=:ok) -      node_ln=/^([0-6])/.match(node)[1].to_i -      node_parent_ln=/^([0-6])/.match(node_parent)[1].to_i +      node_ln=/^([0-7])/.match(node)[1].to_i +      node_parent_ln=/^([0-7])/.match(node_parent)[1].to_i        if status==:error \        or @md.opt.act[:maintenance][:set]==:on          puts %{node: #{node},    parent node: #{node_parent}  #{status.upcase}}          if status==:error -          node_ln=/^([0-6])/.match(node)[1].to_i -          node_parent_ln=/^([0-6])/.match(node_parent)[1].to_i +          node_ln=/^([0-7])/.match(node)[1].to_i +          node_parent_ln=/^([0-7])/.match(node_parent)[1].to_i            STDERR.puts %{current level: #{structure_info.lv[node_ln]} (possible parent levels: #{structure_info.possible_parents(structure_info.lv[node_ln])})  parent level:  #{structure_info.lv[node_parent_ln]} (possible child levels: #{structure_info.possible_children(structure_info.lv[node_parent_ln])})  SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"} @@ -1297,12 +1299,12 @@ SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"        required_headers_present?        data=@data        @o_array=[] -      node=ocn=ocn_dv=ocn_sp=ocnh=ocnh0=ocnh1=ocnh2=ocnh3=ocnh4=ocnh5=ocnh6=ocno=ocnp=ocnt=ocnc=ocng=ocni=ocnu=0 # h heading, o other, t table, g group, i image +      node=ocn=ocn_dv=ocn_sp=ocnh=ocnh0=ocnh1=ocnh2=ocnh3=ocnh4=ocnh5=ocnh6=ocnh7=ocno=ocnp=ocnt=ocnc=ocng=ocni=ocnu=0 # h heading, o other, t table, g group, i image        regex_exclude_ocn_and_node = /#{Rx[:meta]}|^@\S+?:\s|^4~endnotes|^#{Mx[:lv_o]}4:endnotes#{Mx[:lv_c]}|^\^~ |<:e[:_]\d+?>|^<:\#|<:- |<[:!]!4|<hr width|#{Mx[:br_endnotes]}|\A\s*\Z/mi #ocn here #  added with Tune.code #ยก -      parent=node1=node2=node3=node4=node5=node6=nil +      parent=node1=node2=node3=node4=node5=node6=node7=nil        node0='0:0;0'        @collapsed_lv0=0 -      @lev_occurences={ a: 0, b: 0, c: 0, d: 0, l1: 0, l2: 0, l3: 0 } +      @lev_occurences={ a: 0, b: 0, c: 0, d: 0, l1: 0, l2: 0, l3: 0, l4: 0 }        data.each do |dob|          h={}          if (dob.obj !~ regex_exclude_ocn_and_node || dob.is==:code) \ @@ -1336,7 +1338,8 @@ SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"            or ln.to_s =~@md.lv3 \            or ln.to_s =~@md.lv4 \            or ln.to_s =~@md.lv5 \ -          or ln.to_s =~@md.lv6) +          or ln.to_s =~@md.lv6 \ +          or ln.to_s =~@md.lv7)              if not dob.obj =~/~#|-#/                ocnh+=1              end @@ -1523,7 +1526,7 @@ or this level should be level :B~ rather than #{dob.lv}}                  warning_incorrect_parent_level_or_level(dob.obj)                  puts "parent is level 4~ & this level #{dob.lv}  either parent should be level 5~ -or this level should be 5~ rather #{dob.lv}" #level 6 +or this level should be 5~ rather #{dob.lv}"                  document_structure_check_info(node6,node4,:error)                  @collapsed_lv6=@collapsed_lv4+1                  node4 @@ -1549,6 +1552,59 @@ or this level should be 5~ rather #{dob.lv}" #level 6                end                collapsed_level=@collapsed_lv6                node,ocn_sp=node6,"h#{ocnh}" +            elsif ln==7 \ +            or ln=~@md.lv7 +              @lev_occurences[:l4] += 1 +              if not dob.obj =~/~#|-#/ +                ocn_flag=true +                ocnh7+=1 +                node7="7:#{ocnh7};#{ocn}" +              else +                ocn_flag=false +                node7="7:0;0" +              end +              parent=if node6 +                document_structure_check_info(node7,node6) +                @collapsed_lv7=@collapsed_lv6+1 +                node5 +              elsif node5 +                warning_incorrect_parent_level_or_level(dob.obj) +                puts "parent is level 5~ & this level #{dob.lv} +either parent should be level 6~ +or this level should be 6~ rather #{dob.lv}" +                document_structure_check_info(node7,node5,:error) +                @collapsed_lv6=@collapsed_lv5+1 +                node5 +              elsif node4 +                warning_incorrect_parent_level_or_level(dob.obj) +                puts "parent is level 4~ & this level #{dob.lv} +either parent should be level 6~ +or this level should be 6~ rather #{dob.lv}" +                document_structure_check_info(node7,node4,:error) +                @collapsed_lv6=@collapsed_lv4+1 +                node4 +              elsif node3 +                warning_incorrect_parent_level_or_level(dob.obj) +                document_structure_check_info(node7,node3,:error) +                @collapsed_lv6=@collapsed_lv3+1 +                node3 +              elsif node2 +                warning_incorrect_parent_level_or_level(dob.obj) +                document_structure_check_info(node7,node2,:error) +                @collapsed_lv6=@collapsed_lv2+1 +                node2 +              elsif node1 +                warning_incorrect_parent_level_or_level(dob.obj) +                document_structure_check_info(node7,node1,:error) +                @collapsed_lv6=@collapsed_lv1+1 +                node1 +              else +                warning_incorrect_parent_level_or_level(dob.obj) +                document_structure_check_info(node7,node0,:error) +                node0 +              end +              collapsed_level=@collapsed_lv7 +              node,ocn_sp=node7,"h#{ocnh}"              end            else              unless @lev_occurences[:l1] > 0 diff --git a/lib/sisu/v5/constants.rb b/lib/sisu/v5/constants.rb index 55c3ff2a..e0f28a6d 100644 --- a/lib/sisu/v5/constants.rb +++ b/lib/sisu/v5/constants.rb @@ -267,8 +267,8 @@ else    }  end  Db={ -  name_prefix:               "SiSU#{SiSU_is[:version_dir]}b_", -  name_prefix_db:            "sisu_#{SiSU_is[:version_dir]}b_", +  name_prefix:               "SiSU#{SiSU_is[:version_dir]}c_", +  name_prefix_db:            "sisu_#{SiSU_is[:version_dir]}c_",    col_title:                  800,    col_title_part:             400,    col_title_edition:           10, diff --git a/lib/sisu/v5/css.rb b/lib/sisu/v5/css.rb index b99359aa..f1598550 100644 --- a/lib/sisu/v5/css.rb +++ b/lib/sisu/v5/css.rb @@ -236,7 +236,7 @@ WOK      margin-bottom: 0px;      text-indent: 0mm;    } -  p, h0, h1, h2, h3, h4, h5, h6 { +  p, h0, h1, h2, h3, h4, h5, h6, h7 {      display: block;      font-family: verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman;      font-size: 100%; @@ -447,7 +447,7 @@ WOK      padding-left: 0em;      text-indent: 0em;    } -  p, h0, h1, h2, h3, h4, h5, h6 { +  p, h0, h1, h2, h3, h4, h5, h6, h7 {      display: block;      font-family: verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman;      font-size: 100%; @@ -1307,18 +1307,18 @@ WOK      font-weight: bold;    } -  h0, h1, h2, h3, h4, h5, h6 { +  h0, h1, h2, h3, h4, h5, h6, h7 {      font-weight: bold;      line-height: 120%;      text-align: left;      margin-top: 20px;      margin-bottom: 10px;    } -  h4.norm, h5.norm, h6.norm { +  h4.norm, h5.norm, h6.norm, h7.norm {      margin-top: 10px;      margin-bottom: 0px;    } -  h1.center, h2.center, h3.center, h4.center, h5.center, h6.center { +  h1.center, h2.center, h3.center, h4.center, h5.center, h6.center, h7.center {      text-align: center;    }    h1 { font-size: 120%; } @@ -1327,6 +1327,7 @@ WOK    h4 { font-size: 105%; }    h5 { font-size: 100%; }    h6 { font-size: 100%; } +  h7 { font-size: 100%; }    h0 { font-size: 80%; }    h1.i {margin-left: 2em;} @@ -1418,6 +1419,8 @@ WOK    }    h6.banner {    } +  h7.banner { +  }    .toc {      font-weight: normal; @@ -1454,6 +1457,11 @@ WOK      font-size: 90%;      line-height: 110%;    } +  h7.toc { +    margin-left: 7em; +    font-size: 85%; +    line-height: 100%; +  }    .microtoc {      margin-top: 2px; @@ -1487,6 +1495,11 @@ WOK      font-weight: normal;      font-size: 90%;    } +  h7.microtoc { +    margin-left: 30mm; +    font-weight: normal; +    font-size: 85%; +  }    .subtoc {      margin-right: 34%; @@ -1504,6 +1517,12 @@ WOK      margin-top: 0px;      margin-bottom: 0px;    } +  h7.subtoc { +    margin-left: 4em; +    font-size: 70%; +    margin-top: 0px; +    margin-bottom: 0px; +  }    div.substance {      width: 100%; @@ -1629,15 +1648,19 @@ WOK      margin-left: 2em;      font-size: 85%;    } +  h7.minitoc { +    margin-left: 3em; +    font-size: 80%; +  }    h0.minitoc {      margin-left: 0em;      font-size: 90%;    } -  h1.c, h2.c, h3.c, h4.c, h5.c, h6.c, p.c { +  h1.c, h2.c, h3.c, h4.c, h5.c, h6.c, h7.c, p.c {      text-align: center    } -  h1.red, h2.red, h3.red, h4.red, h5.red, h6.red { +  h1.red, h2.red, h3.red, h4.red, h5.red, h6.red, h7.red {      text-align: center;      color: #ff0000;      margin-left: 5mm; @@ -1646,7 +1669,7 @@ WOK      margin-bottom: 20px;      margin-right: 15mm;    } -  h1.ruby, h2.ruby, h3.ruby, h4.ruby, h5.ruby, h6.ruby { +  h1.ruby, h2.ruby, h3.ruby, h4.ruby, h5.ruby, h6.ruby, h7.ruby {      text-align: center;      color: #990000;      margin-left: 5mm; @@ -1856,6 +1879,11 @@ WOK        font-weight: bold;        text-align: left;      } +    text[class|="h7"] { +      font-size: 110%; +      font-weight: bold; +      text-align: left; +    }      text[class|="indent0"] {        padding-left: 10%;      } @@ -2591,6 +2619,11 @@ WOK        font-weight: bold;        text-align: left;      } +    text[class|="h7"] { +      font-size: 110%; +      font-weight: bold; +      text-align: left; +    }      text[class|="indent0"] {        padding-left: 10%;      } @@ -3271,6 +3304,11 @@ WOK        font-weight: bold;        text-align: left;      } +    para.h7 { +      font-size: 110%; +      font-weight: bold; +      text-align: left; +    }      table {        margin-left: 5%;        display: block; @@ -3427,6 +3465,11 @@ WOK        font-weight: bold;        text-align: left;      } +    p.h7 { +      font-size: 150%; +      font-weight: bold; +      text-align: left; +    }      ocn {        display: block;        text-align: right; diff --git a/lib/sisu/v5/db_create.rb b/lib/sisu/v5/db_create.rb index 35b15ada..956a470a 100644 --- a/lib/sisu/v5/db_create.rb +++ b/lib/sisu/v5/db_create.rb @@ -264,6 +264,7 @@ module SiSU_DbCreate              lev4            SMALLINT,              lev5            SMALLINT,              lev6            SMALLINT, +            lev7            SMALLINT,              en_a            SMALLINT NULL,              en_z            SMALLINT NULL,              en_a_asterisk   SMALLINT NULL, @@ -506,9 +507,9 @@ module SiSU_DbCreate            %{COMMENT ON COLUMN doc_objects.metadata_tid              IS 'tie to title in metadata_and_text';},            %{COMMENT ON COLUMN doc_objects.lev_an -            IS 'doc level A-D 1-6';}, +            IS 'doc level A-D 1-4';},            %{COMMENT ON COLUMN doc_objects.lev -            IS 'doc level 0-6 \d\~';}, +            IS 'doc level 0-7 \d\~';},            %{COMMENT ON COLUMN doc_objects.seg              IS 'segment name from level number 4 (lv 1)';},            %{COMMENT ON COLUMN doc_objects.ocn @@ -547,6 +548,8 @@ module SiSU_DbCreate              IS 'document structure, level number 5';},            %{COMMENT ON COLUMN doc_objects.lev6              IS 'document structure, level number 6';}, +          %{COMMENT ON COLUMN doc_objects.lev7 +            IS 'document structure, level number 7';},            %{COMMENT ON COLUMN doc_objects.t_of              IS 'document structure, type of object (object is of)';},            %{COMMENT ON COLUMN doc_objects.t_is diff --git a/lib/sisu/v5/db_import.rb b/lib/sisu/v5/db_import.rb index 1f4dca51..5bb886ff 100644 --- a/lib/sisu/v5/db_import.rb +++ b/lib/sisu/v5/db_import.rb @@ -118,7 +118,7 @@ module SiSU_DbImport          puts "#{__FILE__}:#{__LINE__}" if @opt.act[:maintenance][:set]==:on        end        @id_n =0 if @col[:lid].nil? or @col[:lid].to_s.empty? -      @col[:lv0]=@col[:lv1]=@col[:lv2]=@col[:lv3]=@col[:lv4]=@col[:lv5]=@col[:lv6]=0 +      @col[:lv0]=@col[:lv1]=@col[:lv2]=@col[:lv3]=@col[:lv4]=@col[:lv5]=@col[:lv6]=@col[:lv7]=0        @db=SiSU_Env::InfoDb.new        @pdf_fn=SiSU_Env::FileOp.new(@md).base_filename        @@dl ||=SiSU_Env::InfoEnv.new.digest.length @@ -390,6 +390,7 @@ module SiSU_DbImport                when /1/ then @col[:lv1]+=1                when /2/ then @col[:lv2]+=1                when /3/ then @col[:lv3]+=1 +              when /4/ then @col[:lv4]+=1                end                @col[:lev]=@col[:plaintext]=@col[:body]=''              elsif data.is==:heading \ @@ -480,7 +481,8 @@ module SiSU_DbImport                @col[:lev]=@col[:plaintext]=@col[:body]=''              elsif data.is==:heading \              && data.ln==6 -              txt,@col[:ocn],@col[:lev_an],@col[:ocnd],@col[:ocns],@col[:t_of],@col[:t_is],@col[:node],@col[:parent],@col[:digest_clean],@col[:digest_all]=data.obj,data.ocn,data.lv,data.odv,data.osp,data.of,data.is,data.node,data.parent,'','' +              txt,       @col[:ocn],@col[:lev_an],@col[:ocnd],@col[:ocns],@col[:t_of],@col[:t_is],@col[:node],@col[:parent],@col[:digest_clean],@col[:digest_all]= +                data.obj,data.ocn,  data.lv,      data.odv,   data.osp,   data.of,    data.is,    data.node,  data.parent,  '',                 ''                @@seg_full=data.name if data.is==:heading && data.ln==6 && data.name #check data.name                @@seg ||='' #nil # watch                @col[:seg]=@@seg @@ -508,6 +510,37 @@ module SiSU_DbImport                t=SiSU_DbTuple::LoadDocuments.new(@conn,@col,@opt,@file_maint)                @tuple_array << t.tuple                @col[:lev]=@col[:plaintext]=@col[:body]='' +            elsif data.is==:heading \ +            && data.ln==7 +              txt,       @col[:ocn],@col[:lev_an],@col[:ocnd],@col[:ocns],@col[:t_of],@col[:t_is],@col[:node],@col[:parent],@col[:digest_clean],@col[:digest_all]= +                data.obj,data.ocn,  data.lv,      data.odv,   data.osp,   data.of,    data.is,    data.node,  data.parent,  '',                 '' +              @@seg_full=data.name if data.is==:heading && data.ln==7 && data.name #check data.name +              @@seg ||='' #nil # watch +              @col[:seg]=@@seg +              @col[:lv7]+=1 +              @col[:lid]+=1 +              @col[:lev]=7 +              @hname=if @col[:seg] \ +              and not @col[:seg].to_s.empty? +                @@hname=@col[:seg].to_s +              else @@hname +              end +              @env=SiSU_Env::InfoEnv.new(@md.fns) +              @base_url="#{@env.url.root}/#{@md.fnb}/#{@hname}.html" +              txt=endnotes(txt).extract_any +              body=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_plus +              @col[:body]=special_character_escape(body) +              plaintext=@col[:body].dup +              plaintext=strip_markup(plaintext) +              @col[:plaintext]=clean_searchable_text(plaintext) +              book_idx=book_idx_hash_to_str(data.idx) +              @col[:book_idx]=clean_searchable_text(book_idx) +              @en_a,@en_z=@en[0].first,@en[0].last if @en[0] +              @en_a_asterisk,@en_z_asterisk=@en_ast[0].first,@en_ast[0].last if @en_ast[0] +              @en_a_plus,@en_z_plus=@en_pls[0].first,@en_pls[0].last if @en_pls[0] +              t=SiSU_DbTuple::LoadDocuments.new(@conn,@col,@opt,@file_maint) +              @tuple_array << t.tuple +              @col[:lev]=@col[:plaintext]=@col[:body]=''                                                                                 #% :structure :layout :comment              elsif data.of==:structure \              || data.of==:layout \ diff --git a/lib/sisu/v5/db_load_tuple.rb b/lib/sisu/v5/db_load_tuple.rb index 98310bfd..36c8fddf 100644 --- a/lib/sisu/v5/db_load_tuple.rb +++ b/lib/sisu/v5/db_load_tuple.rb @@ -69,8 +69,8 @@ module SiSU_DbTuple      def initialize(conn,col,opt,file_maint)        @conn,@col,@opt,@file_maint=conn,col,opt,file_maint        @col[:lev]=@col[:lev].to_i -      unless @col[:lev].inspect=~/^[0-6]/ \ -      or @col[:lev]==0..6 +      unless @col[:lev].inspect=~/^[0-7]/ \ +      or @col[:lev]==0..7          @col[:lev]=9        end        @col[:ocn]=0 unless @col[:ocn].inspect=~/\d+/ @@ -78,11 +78,11 @@ module SiSU_DbTuple      end      def tuple                                                                    #% import line        sql_entry=if @col[:en_a] -        "INSERT INTO doc_objects (lid, metadata_tid, lev, lev_an, clean, body, book_idx, ocn, ocnd, ocns, seg, lev0, lev1, lev2, lev3, lev4, lev5, lev6, en_a, en_z, t_of, t_is, node, parent, digest_clean, digest_all) " + -        "VALUES (#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:lev_an]}', '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:book_idx]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv0]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}', '#{@col[:en_a]}', '#{@col[:en_z]}', '#{@col[:t_of]}', '#{@col[:t_is]}', '#{@col[:node]}', '#{@col[:parent]}', '#{@col[:digest_clean]}', '#{@col[:digest_all]}');" +        "INSERT INTO doc_objects (lid, metadata_tid, lev, lev_an, clean, body, book_idx, ocn, ocnd, ocns, seg, lev0, lev1, lev2, lev3, lev4, lev5, lev6, lev7, en_a, en_z, t_of, t_is, node, parent, digest_clean, digest_all) " + +        "VALUES (#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:lev_an]}', '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:book_idx]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv0]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}', '#{@col[:lv7]}', '#{@col[:en_a]}', '#{@col[:en_z]}', '#{@col[:t_of]}', '#{@col[:t_is]}', '#{@col[:node]}', '#{@col[:parent]}', '#{@col[:digest_clean]}', '#{@col[:digest_all]}');"        else -        "INSERT INTO doc_objects (lid, metadata_tid, lev, lev_an, clean, body, book_idx, ocn, ocnd, ocns, seg, lev0, lev1, lev2, lev3, lev4, lev5, lev6, t_of, t_is, node, parent, digest_clean, digest_all) " + -        "VALUES (#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:lev_an]}', '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:book_idx]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv0]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}', '#{@col[:t_of]}', '#{@col[:t_is]}', '#{@col[:node]}', '#{@col[:parent]}', '#{@col[:digest_clean]}', '#{@col[:digest_all]}');" +        "INSERT INTO doc_objects (lid, metadata_tid, lev, lev_an, clean, body, book_idx, ocn, ocnd, ocns, seg, lev0, lev1, lev2, lev3, lev4, lev5, lev6, lev7, t_of, t_is, node, parent, digest_clean, digest_all) " + +        "VALUES (#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:lev_an]}', '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:book_idx]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv0]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}', '#{@col[:lv7]}', '#{@col[:t_of]}', '#{@col[:t_is]}', '#{@col[:node]}', '#{@col[:parent]}', '#{@col[:digest_clean]}', '#{@col[:digest_all]}');"        end        if @opt.act[:verbose_plus][:set]==:on          if @opt.act[:maintenance][:set]==:on @@ -97,7 +97,7 @@ module SiSU_DbTuple          end        end        if @opt.act[:verbose][:set]==:on -        if @col[:lev].inspect =~/[0-356]/ +        if @col[:lev].inspect =~/[0-35-7]/            lev=case @col[:lev].inspect            when /0/ then ':A'            when /1/ then ':B' @@ -105,10 +105,11 @@ module SiSU_DbTuple            when /3/ then ':D'            when /5/ then ' 2'            when /6/ then ' 3' +          when /7/ then ' 4'            end -          puts %{#{lev}>\t#{@col[:lv0]}\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]}} +          puts %{#{lev}>\t#{@col[:lv0]}\t#{@col[:lv1]}\t#{@col[:lv2]}\t#{@col[:lv3]}\t#{@col[:lv4]}\t#{@col[:lv5]}\t#{@col[:lv6]}\t#{@col[:lv7]}\t#{@col[:ocn]}\t#{@col[:node]}\t#{@col[:ocns]}}          elsif @col[:lev].inspect =~/[4]/ -          puts %{ #{@cX.green}1>#{@cX.off}\t#{@col[:lv0]}\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]}\t#{@col[:seg]}} +          puts %{ #{@cX.green}1>#{@cX.off}\t#{@col[:lv0]}\t#{@col[:lv1]}\t#{@col[:lv2]}\t#{@col[:lv3]}\t#{@col[:lv4]}\t#{@col[:lv5]}\t#{@col[:lv6]}\t#{@col[:lv7]}\t#{@col[:ocn]}\t#{@col[:node]}\t#{@col[:ocns]}\t#{@col[:seg]}}          end        end        sql_entry diff --git a/lib/sisu/v5/html_format.rb b/lib/sisu/v5/html_format.rb index 058a8f34..7731464a 100644 --- a/lib/sisu/v5/html_format.rb +++ b/lib/sisu/v5/html_format.rb @@ -1065,6 +1065,9 @@ WOK      def heading_body6        heading_normal('h6','norm')      end +    def heading_body7 +      heading_normal('h7','norm') +    end      def title_heading(tag,attrib)        cl=(@make.build.html_minitoc?) \        ? 'content' @@ -1228,6 +1231,8 @@ WOK      end      def navigation_toc_lev6      end +    def navigation_toc_lev7 +    end      def endnote_seg_body(fn='')  #FIX                                                #url construction keep within single line... BUG WATCH 200408        fn='doc' if fn.to_s.empty? #you may wish to reconsider, sends to 'doc' where no segment info        %{ @@ -1265,6 +1270,9 @@ WOK      def subtoc_lev6        subtoc_lev('h6','subtoc') if @txt      end +    def subtoc_lev7 +      subtoc_lev('h7','subtoc') if @txt +    end      def heading_sub(tag,attrib)        @txt=@txt.gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ')        %{ @@ -1357,6 +1365,9 @@ WOK      def lev6        lev('h6','toc')      end +    def lev7 +      lev('h7','toc') +    end      def strip_endnotes(txt)        txt=txt.gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ')        txt @@ -1389,6 +1400,10 @@ WOK        @txt=strip_endnotes(@txt)        lev('h6','minitoc')      end +    def mini_lev7 +      @txt=strip_endnotes(@txt) +      lev('h7','minitoc') +    end      def mini_lev0 #docinfo        lev('h1','minitoc')      end diff --git a/lib/sisu/v5/html_scroll.rb b/lib/sisu/v5/html_scroll.rb index 4dbc2800..c11a532a 100644 --- a/lib/sisu/v5/html_scroll.rb +++ b/lib/sisu/v5/html_scroll.rb @@ -88,11 +88,13 @@ module SiSU_HTML_Scroll        @rcdc=false        @scr={ body: [], metadata: [], owner_details: [] }        data.each do |dob| -        dob.obj=dob.obj.gsub(/#{@md.file.output_path.html_seg.rel_image}/m,@md.file.output_path.html_scroll.rel_image) +        dob.obj=dob.obj.gsub(/#{@md.file.output_path.html_seg.rel_image}/m, +          @md.file.output_path.html_scroll.rel_image)          if defined? dob.name and dob.name =~/^meta/ \          and dob.obj =~/Document Information/ -          dob.obj=dob.obj.gsub(/(Document Information(?: \(metadata\))?)/, -            '\1<a name="docinfo"></a>') +          dob.obj=dob.obj. +            gsub(/(Document Information(?: \(metadata\))?)/, +              '\1<a name="docinfo"></a>')          end          if dob.obj =~/^Metadata$/ \          and dob.lv =='B' @@ -108,7 +110,8 @@ module SiSU_HTML_Scroll            gsub(/href="#{Xx[:segment]}/m,'href="')          if dob.obj !~/(^#{Rx[:meta]}|#{Mx[:br_eof]})/            unless dob.is ==:code -            dob.obj=dob.obj.gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ') +            dob.obj=dob.obj. +              gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ')            end            if defined? dob.ocn              @p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,dob.ocn) @@ -129,6 +132,8 @@ module SiSU_HTML_Scroll                sto.heading_body5              elsif dob.ln==6                sto.heading_body6 +            elsif dob.ln==7 +              sto.heading_body7              end            elsif dob.is==:break \            and dob.from==:markup @@ -162,7 +167,8 @@ module SiSU_HTML_Scroll              elsif dob.ln==4 \              and dob.obj=='Index'                sto.heading_body4 -              book_idx=SiSU_Particulars::CombinedSingleton.instance.get_idx_html(@md.opt).html_idx +              book_idx=SiSU_Particulars::CombinedSingleton. +                instance.get_idx_html(@md.opt).html_idx                book_idx.each do |y| #takes book index prepared for segments & strips segment identifying info                  y.gsub!(/<a href="\S+?\.html#(\d+)">(\1(?:-\d+)?)<\/a>/,                    '<a href="#\1">\2</a>') @@ -176,6 +182,10 @@ module SiSU_HTML_Scroll                unless dob.obj.empty?                  sto.heading_body6                end +            elsif dob.ln==7 +              unless dob.obj.empty? +                sto.heading_body7 +              end              end            elsif dob.is==:para              if dob.indent \ @@ -222,7 +232,9 @@ module SiSU_HTML_Scroll      def tails        scr_tail=[]        format_head_scroll=SiSU_HTML_Format::HeadToc.new(@md) -      scr_tail << format_head_scroll.scroll_tail << format_head_scroll.html_close +      scr_tail \ +      << format_head_scroll.scroll_tail \ +      << format_head_scroll.html_close        scr_tail      end    end diff --git a/lib/sisu/v5/html_segments.rb b/lib/sisu/v5/html_segments.rb index f58bae6a..9b0cc1c7 100644 --- a/lib/sisu/v5/html_segments.rb +++ b/lib/sisu/v5/html_segments.rb @@ -67,7 +67,8 @@ module SiSU_HTML_Seg    require_relative 'shared_metadata'                    # shared_metadata.rb    class Output      def initialize(md,outputfile,seg,minitoc,type='') -      @md,@output_seg_file,@seg,@minitoc,@type=md,outputfile,seg,minitoc,type +      @md, @output_seg_file,@seg,@minitoc,@type= +        md,outputfile,      seg,minitoc,  type        @title_banner_=SiSU_Env::CreateSite.new(@md.opt).html_seg_title_banner?        @file=SiSU_Env::FileOp.new(@md)        @make=SiSU_Env::ProcessingSettings.new(@md) @@ -79,59 +80,97 @@ module SiSU_HTML_Seg        if @seg[:title] =~/\S/          filename_seg=[]          if @make.build.html_top_band? -          filename_seg << @seg[:title] << @seg[:tocband_banner] +          filename_seg \ +          << @seg[:title] \ +          << @seg[:tocband_banner]          else -          filename_seg << @seg[:title] +          filename_seg \ +          << @seg[:title]          end          if @type=='endnotes'            @seg[:headings]=[]            format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md)            if @title_banner_ -            @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) +            @seg[:headings] \ +            << format_head_seg. +              title_banner(@md.title.main,@md.title.sub,@author)            end            txt_obj={ txt: 'Endnotes', ocn_display: '' }            format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) -          @seg[:headings] << format_seg.title_heading1 -          filename_seg << @seg[:heading_endnotes] << @minitoc << @seg[:headings] << %{\n<div class="#{@cl}">\n} << @seg[:endnote_all] << '</div>' # << '</div>' +          @seg[:headings] \ +          << format_seg.title_heading1 +          filename_seg \ +          << @seg[:heading_endnotes] \ +          << @minitoc << @seg[:headings] \ +          << %{\n<div class="#{@cl}">\n} \ +          << @seg[:endnote_all] \ +          << '</div>' # << '</div>'          elsif @type=='idx'            @seg[:headings]=[]            format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md)            if @title_banner_ -            @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) +            @seg[:headings] \ +            << format_head_seg. +              title_banner(@md.title.main,@md.title.sub,@author)            end            txt_obj={ txt: 'Index', ocn_display: '' }            format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj)            @seg[:headings] << format_seg.title_heading1 -          filename_seg << @seg[:heading_idx] << @minitoc << @seg[:headings] << %{\n<div class="#{@cl}">\n} << @seg[:idx] << '</div>' # << '</div>' +          filename_seg \ +          << @seg[:heading_idx] \ +          << @minitoc << @seg[:headings] \ +          << %{\n<div class="#{@cl}">\n} \ +          << @seg[:idx] \ +          << '</div>' # << '</div>'          elsif @type=='metadata'            metadata=SiSU_Metadata::Summary.new(@md).xhtml_display.metadata            @seg[:headings]=[]            format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md)            if @title_banner_ -            @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) +            @seg[:headings] \ +            << format_head_seg. +              title_banner(@md.title.main,@md.title.sub,@author)            end            txt_obj={ txt: 'Metadata', ocn_display: '' }            format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj)            @seg[:headings] << format_seg.title_heading1 -          filename_seg << @seg[:heading_idx] << @minitoc << @seg[:headings] << %{\n<div class="#{@cl}">\n} << metadata << '</div>' # << '</div>' +          filename_seg \ +          << @seg[:heading_idx] \ +          << @minitoc \ +          << @seg[:headings] \ +          << %{\n<div class="#{@cl}">\n} \ +          << metadata \ +          << '</div>' # << '</div>'          else            if @make.build.html_top_band? -            filename_seg << @minitoc << @seg[:headings] << @seg[:main] << "\n</div>\n" +            filename_seg \ +            << @minitoc \ +            << @seg[:headings] \ +            << @seg[:main] \ +            << "\n</div>\n"            else -            filename_seg << @minitoc << @seg[:main] << "\n</div>\n" +            filename_seg \ +            << @minitoc \ +            << @seg[:main] \ +            << "\n</div>\n"            end          end          filename_seg <<=if @make.build.html_top_band? -          @seg[:tail] << @seg[:tocband_bannerless] << @seg[:credits] +          @seg[:tail] \ +          << @seg[:tocband_bannerless] \ +          << @seg[:credits]          else -          @seg[:tail] << @seg[:credits] +          @seg[:tail] \ +          << @seg[:credits]          end          filename_seg=filename_seg.flatten.compact #watch          filename_seg.each do |str|            unless str =~/\A\s*\Z/              str=str.strip. -              gsub(Xx[:html_relative2],@file.path_rel_links.html_seg_2). -              gsub(Xx[:html_relative1],@file.path_rel_links.html_seg_1) +              gsub(Xx[:html_relative2], +                @file.path_rel_links.html_seg_2). +              gsub(Xx[:html_relative1], +                @file.path_rel_links.html_seg_1)              @output_seg_file << str            end          end @@ -146,7 +185,17 @@ module SiSU_HTML_Seg      @@loop_count=@@seg_total=@@tracker=0      @@is4=@@is3=@@is2=@@is1=@@is0=0      @@heading0=@@heading1=@@heading2=@@heading3=@@heading4=0 -    @@seg[:tocband_banner],@@seg[:tocband_bannerless],@@seg[:title],@@seg[:headings],@@seg[:main],@@seg[:idx],@@seg[:tail],@@seg[:credits],@@seg_subtoc_array,@@seg_endnotes_array,@@seg[:endnote_all]=Array.new(11){[]} +    @@seg[:tocband_banner], +      @@seg[:tocband_bannerless], +      @@seg[:title],@@seg[:headings], +      @@seg[:main], +      @@seg[:idx], +      @@seg[:tail], +      @@seg[:credits], +      @@seg_subtoc_array, +      @@seg_endnotes_array, +      @@seg[:endnote_all]= +      Array.new(11){[]}      @@seg[:heading_endnotes]=''      @@tablehead,@@number_of_cols=0,0      @@dp,@@segtocband=nil,nil @@ -192,7 +241,8 @@ module SiSU_HTML_Seg        idx_html=nil        if @md.book_idx          #my_make_source_file=SiSU_Env::CreateFile.new(@md.fns) -        idx_html=SiSU_Particulars::CombinedSingleton.instance.get_idx_html(@md.opt).html_idx +        idx_html=SiSU_Particulars::CombinedSingleton. +          instance.get_idx_html(@md.opt).html_idx          idx_html.each {|x| @@seg[:idx] << x }          @@seg[:heading_idx]=''        end @@ -215,7 +265,8 @@ module SiSU_HTML_Seg            @@seg_name.length          ).segmented        end -      map_nametags=SiSU_Particulars::CombinedSingleton.instance.get_map_nametags(@md).nametags_map #p map_nametags +      map_nametags=SiSU_Particulars::CombinedSingleton. +        instance.get_map_nametags(@md).nametags_map #p map_nametags        data.each do |dob|          if defined? dob.obj \          and dob.obj =~/href="#{Xx[:segment]}#+\S+?"/ @@ -227,10 +278,12 @@ module SiSU_HTML_Seg                lng=(inf.output_dir_structure.by_language_code?) \                ? ''                : '.' + @md.opt.lng -              dob.obj.sub!(/href="#{Xx[:segment]}#+(\S+?)"/,%{href="#{map_nametags[m][:segname]}#{lng}#{Sfx[:html]}#\\1"}) +              dob.obj.sub!(/href="#{Xx[:segment]}#+(\S+?)"/, +                %{href="#{map_nametags[m][:segname]}#{lng}#{Sfx[:html]}#\\1"})              else                p "NOT FOUND name_tags: #{m}" -              dob.obj.sub!(/href="#{Xx[:segment]}#+(\S+?)"/,%{href="#\\1"}) # not satisfactory +              dob.obj.sub!(/href="#{Xx[:segment]}#+(\S+?)"/, +                %{href="#\\1"}) # not satisfactory              end            end          end @@ -281,7 +334,8 @@ module SiSU_HTML_Seg                if tracking != 0                  @file=SiSU_Env::FileOp.new(@md)                  unless FileTest.directory?(@file.output_path.html_seg.dir) -                  FileUtils::mkdir_p(@file.output_path.html_seg.dir) if File.writable?("#{@file.output_path.base.dir}/.") +                  FileUtils::mkdir_p(@file.output_path.html_seg.dir) \ +                    if File.writable?("#{@file.output_path.base.dir}/.")                  end                  SiSU_HTML_Seg::Seg.new(@md).tail                  fnh={ @@ -357,7 +411,7 @@ module SiSU_HTML_Seg        && (@make.build.html_navigation_bar?)          x=if (dob.is==:heading \          || dob.is==:heading_insert) \ -        && (dob.ln.to_s =~/^[0-6]/) +        && (dob.ln.to_s =~/^[0-7]/)            x=if @@tracker < @@seg_total-1              format_head_seg.dot_control_pre_next            else @@ -387,10 +441,14 @@ module SiSU_HTML_Seg        @p_num ||= ''        if @@is0==1          @author=%{<b>#{@md.author}</b>\n} if @md.author.to_s =~/\S/ -        @@seg[:tocband_banner] << format_head_seg.navigation_band(@@segtocband,@@seg[:dot_nav]) -        @@seg[:tocband_bannerless] << '<br />' << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav]) +        @@seg[:tocband_banner] \ +        << format_head_seg.navigation_band(@@segtocband,@@seg[:dot_nav]) +        @@seg[:tocband_bannerless] \ +        << '<br />' \ +        << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav])          if @title_banner_ -          @@seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author).gsub(clean,'') +          @@seg[:headings] \ +          << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author).gsub(clean,'')          end          ocn=(@@heading0[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#{@dp}:#{@dp}#{Mx[:id_c]}$/]) \          ? $1 @@ -398,8 +456,10 @@ module SiSU_HTML_Seg          @p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)          txt_obj={ txt: @@heading0, ocn_display: @p_num.ocn_display }          format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) -        @@seg[:headings] << format_seg.title_heading0.gsub(clean,'') -        @@heading0=@@heading0.gsub(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') +        @@seg[:headings] \ +        << format_seg.title_heading0.gsub(clean,'') +        @@heading0=@@heading0. +          gsub(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'')        end        if @@is1==1          heading1=@@heading1 @@ -409,8 +469,10 @@ module SiSU_HTML_Seg          @p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)          txt_obj={ txt: heading1, ocn_display: @p_num.ocn_display }          format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) -        @@seg[:headings] << format_seg.title_heading1.gsub(clean,'') -        @@heading1=@@heading1.gsub(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') +        @@seg[:headings] \ +        << format_seg.title_heading1.gsub(clean,'') +        @@heading1=@@heading1. +          gsub(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'')        end        if @@is2==1          heading2=@@heading2 @@ -420,8 +482,10 @@ module SiSU_HTML_Seg          @p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)          txt_obj={ txt: heading2, ocn_display: @p_num.ocn_display }          format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) -        @@seg[:headings] << format_seg.title_heading2.gsub(clean,'') -        @@heading2=@@heading2.gsub(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') +        @@seg[:headings] \ +        << format_seg.title_heading2.gsub(clean,'') +        @@heading2=@@heading2. +          gsub(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'')        end        if @@is3==1          heading3=@@heading3 @@ -431,8 +495,10 @@ module SiSU_HTML_Seg          @p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)          txt_obj={ txt: heading3, ocn_display: @p_num.ocn_display }          format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) -        @@seg[:headings] << format_seg.title_heading3.gsub(clean,'') -        @@heading3=@@heading3.gsub(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') +        @@seg[:headings] \ +        << format_seg.title_heading3.gsub(clean,'') +        @@heading3=@@heading3. +          gsub(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'')        end        if @@is4==1          heading4=@@heading4 @@ -442,7 +508,8 @@ module SiSU_HTML_Seg          @p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)          txt_obj={ txt: heading4, ocn_display: @p_num.ocn_display }          format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) -        @@seg[:headings] << format_seg.title_heading4.gsub(clean,'') +        @@seg[:headings] \ +        << format_seg.title_heading4.gsub(clean,'')        end        @@tracker=@@tracker+1      end @@ -467,6 +534,8 @@ module SiSU_HTML_Seg                sto.seg_heading5              elsif dob.ln==6                sto.seg_heading6 +            elsif dob.ln==7 +              sto.seg_heading6              end            elsif dob.is==:para              if dob.indent \ @@ -589,7 +658,7 @@ module SiSU_HTML_Seg            end          end          if dob.is==:heading \ -        && (dob.ln.to_s =~/^[56]/) +        && (dob.ln.to_s =~/^[5-7]/)            case dob.ln            when 5              txt_obj={ txt: dob.obj.strip, ocn: dob.ocn } @@ -599,6 +668,10 @@ module SiSU_HTML_Seg              txt_obj={ txt: dob.obj.strip, ocn: dob.ocn }              format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj)              subtoc=format_seg.subtoc_lev6 #keep and make available, this is the subtoc +          when 7 +            txt_obj={ txt: dob.obj.strip, ocn: dob.ocn } +            format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) +            subtoc=format_seg.subtoc_lev7 #keep and make available, this is the subtoc            end            @@seg_subtoc_array << subtoc          end diff --git a/lib/sisu/v5/texpdf.rb b/lib/sisu/v5/texpdf.rb index 3be8ceb7..fe7ec47e 100644 --- a/lib/sisu/v5/texpdf.rb +++ b/lib/sisu/v5/texpdf.rb @@ -648,6 +648,8 @@ module SiSU_TeX                tst.heading_level_2              when 6                tst.heading_level_3 +            when 7 +              tst.heading_level_4              else dob              end            when :heading_insert diff --git a/lib/sisu/v5/texpdf_format.rb b/lib/sisu/v5/texpdf_format.rb index e9ff0fff..9957ab48 100644 --- a/lib/sisu/v5/texpdf_format.rb +++ b/lib/sisu/v5/texpdf_format.rb @@ -323,6 +323,9 @@ module SiSU_TeX_Pdf      def heading_level_3        heading_sublevels(@dob)      end +    def heading_level_4 +      heading_sublevels(@dob) +    end      def hang        case @dob.indent        when /0/ diff --git a/lib/sisu/v5/txt_plain.rb b/lib/sisu/v5/txt_plain.rb index 479eddde..608d3d09 100644 --- a/lib/sisu/v5/txt_plain.rb +++ b/lib/sisu/v5/txt_plain.rb @@ -254,6 +254,9 @@ WOK            def l6              '.'            end +          def l7 +            '.' +          end            self          end          def bold @@ -402,6 +405,9 @@ WOK              end            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 +          when 7 +            wrapped.upcase << break_line << decorate.heading_underscore.l7*times + p_num << break_line*2 +          #when 7 then wrapped.upcase << break_line << decorate.heading_underscore.l7*times + p_num << break_line*2            end          else            @plaintext[:body] << wrapped + p_num << break_line # main text, contents, body KEEP @@ -419,7 +425,9 @@ WOK          if make.build.plaintext_ocn?            if defined? dob.ocn \            and dob.ocn.is_a?(Fixnum) -            (defined? dob.ocn) ? "\n#{Dx[:ocn_o]}#{dob.ocn}#{Dx[:ocn_c]}" : '' +            (defined? dob.ocn) \ +            ? "\n#{Dx[:ocn_o]}#{dob.ocn}#{Dx[:ocn_c]}" \ +            : ''            else ''            end          else '' @@ -428,8 +436,8 @@ WOK        def markup(data)                                                       # Used for major markup instructions          SiSU_Env::InfoEnv.new(@md.fns)          @data_mod,@endnotes,@level,@cont,@copen,@plaintext_contents_close=Array.new(6){[]} -        (0..6).each { |x| @cont[x]=@level[x]=false } -        (4..6).each { |x| @plaintext_contents_close[x]='' } +        (0..7).each { |x| @cont[x]=@level[x]=false } +        (4..7).each { |x| @plaintext_contents_close[x]='' }          plaintext_tail #($1,$2)          plaintext_metadata          table_message='[table omitted, see other document formats]' diff --git a/lib/sisu/v5/xhtml.rb b/lib/sisu/v5/xhtml.rb index 9a9d74a2..14c6bfe9 100644 --- a/lib/sisu/v5/xhtml.rb +++ b/lib/sisu/v5/xhtml.rb @@ -310,8 +310,8 @@ WOK          @rcdc=false          @level,@cont,@copen,@xml_contents_close=[],[],[],[]          xml_head -        (0..6).each { |x| @cont[x]=@level[x]=false } -        (4..6).each { |x| @xml_contents_close[x]='' } +        (0..7).each { |x| @cont[x]=@level[x]=false } +        (4..7).each { |x| @xml_contents_close[x]='' }          data.each do |dob|            dob=@trans.char_enc.utf8(dob) if @sys.locale =~/utf-?8/i #% utf8            dob=@trans.markup(dob) @@ -337,6 +337,7 @@ WOK                  when 4 then x.heading_body4                  when 5 then x.heading_body5                  when 6 then x.heading_body6 +                when 7 then x.heading_body7                  end                else                  if dob.is ==:verse diff --git a/lib/sisu/v5/xhtml_epub2.rb b/lib/sisu/v5/xhtml_epub2.rb index 25d1b955..ae83214e 100644 --- a/lib/sisu/v5/xhtml_epub2.rb +++ b/lib/sisu/v5/xhtml_epub2.rb @@ -268,6 +268,7 @@ module SiSU_XHTML_EPUB2                lv_name='section_a' + @s_a_no.to_s                @nav_no+=1                @nav_no2=@nav_no +              @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[7]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4] @@ -275,7 +276,8 @@ module SiSU_XHTML_EPUB2                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[2]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[1]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[0] -              @ncxo[0],@ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,false,false,false,false +              @ncxo[0],@ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6],@ncxo[7]= +                true,  false,   false,   false,   false,   false,   false,   false                @epub.sections(dob_toc,lv_name)                if @level_a_first_occurrence \                && @make.build.toc? @@ -293,13 +295,15 @@ module SiSU_XHTML_EPUB2                lv_name='section_b' + @s_b_no.to_s                @nav_no+=1                @nav_no2=@nav_no +              @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[7]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[2]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[1] -              @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,false,false,false +              @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6],@ncxo[7]= +                true,  false,   false,   false,   false,   false,   false                @epub.sections(dob_toc,lv_name)                @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name) if dob_toc                md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name) @@ -311,12 +315,14 @@ module SiSU_XHTML_EPUB2                lv_name='section_c' + @s_c_no.to_s                @nav_no+=1                @nav_no2=@nav_no +              @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[7]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[2] -              @ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,false,false +              @ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6],@ncxo[7]= +                true,  false,   false,   false,   false,   false                @epub.sections(dob_toc,lv_name)                @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name) if dob_toc                md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name) @@ -328,11 +334,13 @@ module SiSU_XHTML_EPUB2                lv_name='section_d' + @s_d_no.to_s                @nav_no+=1                @nav_no3=@nav_no +              @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[7]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3] -              @ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,false +              @ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6],@ncxo[7]= +                true,  false,   false,   false,   false                @epub.sections(dob_toc,lv_name)                @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name) if dob_toc                md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name) @@ -344,10 +352,12 @@ module SiSU_XHTML_EPUB2                lv_name=dob_toc.name                @nav_no+=1                @dob_name=dob.name +              @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[7]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4] -              @ncxo[4],@ncxo[5],@ncxo[6]=true,false,false +              @ncxo[4],@ncxo[5],@ncxo[6],@ncxo[7]= +                true,  false,   false,   false                @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name) if dob_toc                md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name)                md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name) @@ -358,9 +368,11 @@ module SiSU_XHTML_EPUB2                hashtag='#o' + dob_toc.ocn.to_s                lv_name=@dob_name                @nav_no+=1 +              @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[7]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5] -              @ncxo[5],@ncxo[6]=true,false +              @ncxo[5],@ncxo[6],@ncxo[7]= +                true,  false, false                @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name,hashtag) if dob_toc                md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name,hashtag)                md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name,hashtag) @@ -371,13 +383,27 @@ module SiSU_XHTML_EPUB2                hashtag='#o' + dob_toc.ocn.to_s                lv_name=@dob_name                @nav_no+=1 +              @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[7]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6] -              @ncxo[6]=true +              @ncxo[6],@ncxo[7]= +                true,  false                @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name,hashtag) if dob_toc                md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name,hashtag)                md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name,hashtag)                md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,lv_name,hashtag)                SiSU_XHTML_EPUB2::Source::Toc.new(@md,dob_toc).level_6 +            when 7 +              @ncx_cls=[] +              hashtag='#o' + dob_toc.ocn.to_s +              lv_name=@dob_name +              @nav_no+=1 +              @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[7] +              @ncxo[7]=true +              @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name,hashtag) if dob_toc +              md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name,hashtag) +              md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name,hashtag) +              md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,lv_name,hashtag) +              SiSU_XHTML_EPUB2::Source::Toc.new(@md,dob_toc).level_7              else nil              end              toc.each do |k,d| @@ -594,6 +620,27 @@ module SiSU_XHTML_EPUB2          end          toc        end +      def level_7 +        dob=@data +        linkname=dob.obj.gsub(/#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]}/,'').strip +        ocn=dob.ocn +        toc={} +        if ocn \ +        and ocn !~/#/ +          p_num=SiSU_XHTML_EPUB2_Format::ParagraphNumber.new(@md,ocn) +          lnk_n_txt=%{  <a href="#{@@seg_url}#{Sfx[:epub_xhtml]}#o#{ocn}"> +  #{linkname} +</a>} +          txt_obj={ txt: lnk_n_txt } +          format_toc=SiSU_XHTML_EPUB2_Format::FormatToc.new(@md,txt_obj) +          toc[:seg]=format_toc.lev7 +          title=%{#{p_num.goto}#{linkname}</a>} +          txt_obj={ txt: title } +          format_toc=SiSU_XHTML_EPUB2_Format::FormatToc.new(@md,txt_obj) +          toc[:scr]=format_toc.lev7 +        end +        toc +      end      end      class ScrollHeadAndSegToc < Toc        def initialize(md='',toc='',links_guide_toc='') diff --git a/lib/sisu/v5/xhtml_epub2_format.rb b/lib/sisu/v5/xhtml_epub2_format.rb index 6522378b..5f1f315f 100644 --- a/lib/sisu/v5/xhtml_epub2_format.rb +++ b/lib/sisu/v5/xhtml_epub2_format.rb @@ -162,7 +162,7 @@ module SiSU_XHTML_EPUB2_Format      padding-left: 0em;      text-indent: 0mm;    } -  p, h0, h1, h2, h3, h4, h5, h6 { +  p, h0, h1, h2, h3, h4, h5, h6, h7 {      display: block;      font-family: verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman;      font-size: 100%; @@ -992,18 +992,18 @@ module SiSU_XHTML_EPUB2_Format      font-weight: bold;    } -  h0, h1, h2, h3, h4, h5, h6 { +  h0, h1, h2, h3, h4, h5, h6, h7 {      font-weight: bold;      line-height: 120%;      text-align: left;      margin-top: 20px;      margin-bottom: 10px;    } -  h4.norm, h5.norm, h6.norm { +  h4.norm, h5.norm, h6.norm, h7.norm {      margin-top: 10px;      margin-bottom: 0px;    } -  h1.center, h2.center, h3.center, h4.center, h5.center, h6.center { +  h1.center, h2.center, h3.center, h4.center, h5.center, h6.center, h7.center {      text-align: center;    }    h1 { font-size: 120%; } @@ -1012,6 +1012,7 @@ module SiSU_XHTML_EPUB2_Format    h4 { font-size: 105%; }    h5 { font-size: 100%; }    h6 { font-size: 100%; } +  h7 { font-size: 100%; }    h0 { font-size: 80%; }    h1.i {margin-left: 2em;} @@ -1059,6 +1060,11 @@ module SiSU_XHTML_EPUB2_Format      font-size: 90%;      line-height: 110%;    } +  h7.toc { +    margin-left: 7em; +    font-size: 90%; +    line-height: 105%; +  }    .microtoc {      margin-top: 2px; @@ -1092,6 +1098,11 @@ module SiSU_XHTML_EPUB2_Format      font-weight: normal;      font-size: 90%;    } +  h7.microtoc { +    margin-left: 30mm; +    font-weight: normal; +    font-size: 85%; +  }    .subtoc {      margin-right: 34%; @@ -1109,6 +1120,12 @@ module SiSU_XHTML_EPUB2_Format      margin-top: 0px;      margin-bottom: 0px;    } +  h7.subtoc { +    margin-left: 4em; +    font-size: 70%; +    margin-top: 0px; +    margin-bottom: 0px; +  }    div.substance {      width: 100%; @@ -1196,10 +1213,10 @@ module SiSU_XHTML_EPUB2_Format      background-color: #f9f9aa;    } -  h1.c, h2.c, h3.c, h4.c, h5.c, h6.c, p.c { +  h1.c, h2.c, h3.c, h4.c, h5.c, h6.c, h7.c, p.c {      text-align: center    } -  h1.red, h2.red, h3.red, h4.red, h5.red, h6.red { +  h1.red, h2.red, h3.red, h4.red, h5.red, h6.red, h7.red {      text-align: center;      color: #ff0000;      margin-left: 5mm; @@ -1208,7 +1225,7 @@ module SiSU_XHTML_EPUB2_Format      margin-bottom: 20px;      margin-right: 15mm;    } -  h1.ruby, h2.ruby, h3.ruby, h4.ruby, h5.ruby, h6.ruby { +  h1.ruby, h2.ruby, h3.ruby, h4.ruby, h5.ruby, h6.ruby, h7.ruby {      text-align: center;      color: #990000;      margin-left: 5mm; @@ -2043,6 +2060,9 @@ output_epub_cont_seg.close      def seg_heading6        seg_heading_sub('p','bold',@txt)      end +    def seg_heading7 +      seg_heading_sub('p','bold',@txt) +    end      def dl #check :trailer        "<dl><b>#{@txt}</b> #{@trailer}</dl>"      end @@ -2149,6 +2169,9 @@ output_epub_cont_seg.close      def subtoc_lev6        subtoc_lev('h6','subtoc') if @txt      end +    def subtoc_lev7 +      subtoc_lev('h7','subtoc') if @txt +    end      def heading_sub(tag,attrib,txt)        txt=txt.gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ')        %{ @@ -2177,6 +2200,9 @@ output_epub_cont_seg.close      def heading6        heading_sub('p','bold',@txt)      end +    def heading7 +      heading_sub('h7','bold',@txt) +    end      def navigation_heading4        %{<table summary="navigation segment heading 4" width=100% bgcolor="#08163f" border="0">  <tr><td align="center"> @@ -2195,6 +2221,11 @@ output_epub_cont_seg.close    #{@txt}  </p>}      end +    def navigation_heading7 +      %{<p class="bold"> +  #{@txt} +</p>} +    end      def navigation_center        %{<p class="centerbold">#{@txt}</p>}      end @@ -2238,6 +2269,9 @@ output_epub_cont_seg.close      def lev6        lev('h6','toc')      end +    def lev7 +      lev('h7','toc') +    end      def lev0 #docinfo        lev('h0','toc')      end diff --git a/lib/sisu/v5/xhtml_epub2_segments.rb b/lib/sisu/v5/xhtml_epub2_segments.rb index 9492a736..98673c8f 100644 --- a/lib/sisu/v5/xhtml_epub2_segments.rb +++ b/lib/sisu/v5/xhtml_epub2_segments.rb @@ -372,6 +372,8 @@ WOK              sto.seg_heading5            elsif dob.ln==6              sto.seg_heading6 +          elsif dob.ln==7 +            sto.seg_heading7            end          elsif dob.is==:para            if dob.indent \ @@ -486,7 +488,7 @@ WOK            end          end          if dob.is==:heading \ -        and dob.ln.to_s =~/^[56]/ +        and dob.ln.to_s =~/^[5-7]/            case dob.ln            when 5              format_seg=SiSU_XHTML_EPUB2_Format::FormatSeg.new(@md,dob) @@ -494,6 +496,9 @@ WOK            when 6              format_seg=SiSU_XHTML_EPUB2_Format::FormatSeg.new(@md,dob)              subtoc=format_seg.subtoc_lev6 #keep and make available, this is the subtoc +          when 7 +            format_seg=SiSU_XHTML_EPUB2_Format::FormatSeg.new(@md,dob) +            subtoc=format_seg.subtoc_lev7 #keep and make available, this is the subtoc            end            @@seg_subtoc_array << subtoc          end diff --git a/lib/sisu/v5/xml_dom.rb b/lib/sisu/v5/xml_dom.rb index 38c60edf..fb7d3cb9 100644 --- a/lib/sisu/v5/xml_dom.rb +++ b/lib/sisu/v5/xml_dom.rb @@ -226,12 +226,15 @@ WOK  WOK          if lv==4            @copen[1]=true -          @copen[2]=@copen[3]=false +          @copen[2]=@copen[3]=@copen[4]=false          elsif lv==5            @copen[2]=true -          @copen[3]=false +          @copen[3]=@copen[4]=false          elsif lv==6            @copen[3]=true +          @copen[4]=false +        elsif lv==7 +          @copen[4]=true          end        end        def xml_structure(dob,type='norm') @@ -259,21 +262,24 @@ WOK              @cont[2]=false if @cont[2]              @cont[3]=false if @cont[3]              ####### attempt to close contents -            if @copen[3] # 6~ +            if @copen[4] # 4~ +              [4,3,2,1].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" } +              @copen[1]=@copen[2]=@copen[3]=@copen[4]=false +            elsif @copen[3] # 3~                [3,2,1].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" }                @copen[1]=@copen[2]=@copen[3]=false -            elsif @copen[2] # 5~ +            elsif @copen[2] # 2~                [2,1].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" }                @copen[1]=@copen[2]=@copen[3]=false -            elsif @copen[1] # 4~ +            elsif @copen[1] # 1~                [1].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" }                @copen[1]=@copen[2]=@copen[3]=false              end              @@xml[:body] << "#{Ax[:tab]*y}</heading#{x}>" if @level[x]              @level[x]=false            end -        when 4..6 -          6.downto(lv) do |x| +        when 4..7 +          7.downto(lv) do |x|              if @level[x]==true                @xml_contents_close[x]=''              end @@ -284,42 +290,61 @@ WOK            case lv            when 4              @@xml[:body] << "#{Ax[:tab]*5}</content>" if @cont[1] -            if @copen[3]==true # 6~ +            if @copen[4]==true # 4~ +              [4,3,2,1].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" } +            elsif @copen[3]==true # 3~                [3,2,1].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" } -            elsif @copen[2]==true # 5~ +            elsif @copen[2]==true # 2~                [2,1].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" } -            elsif @copen[1]==true # 4~ +            elsif @copen[1]==true # 1~                [1].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" }              end              @cont[1]=true            when 5 -            if @cont[2] \ +            if @cont[3] \ +            or @cont[2] \              or @cont[1]                @@xml[:body] << "#{Ax[:tab]*5}</content>"              end -            if @copen[3]==true  #6~ +            if @copen[4]==true  #4~ +              [4,3,2].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" } +            elsif @copen[3]==true  #3~                [3,2].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" } -            elsif @copen[2]==true #5~ +            elsif @copen[2]==true #2~                [2].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" }              end              @cont[2]=true            when 6 -            if @cont[3] \ +            if @cont[4] \ +            or @cont[3] \              or @cont[2] \              or @cont[1]                @@xml[:body] << "#{Ax[:tab]*5}</content>"              end -            if @copen[3] #6{ +            if @copen[4] #4~ +              [4,3].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" } +            elsif @copen[3] #3~                [3].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" }              end              @cont[3]=true +          when 7 +            if @cont[4] \ +            or @cont[3] \ +            or @cont[2] \ +            or @cont[1] +              @@xml[:body] << "#{Ax[:tab]*5}</content>" +            end +            if @copen[4] #4~ +              [4].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" } +            end +            @cont[4]=true            end          end          xml_el ||=''          xml_element(dob,xml_el,xml_content,type)          if lv            @level[lv]=true -          ((lv+1)..6).each { |x| @level[x]=false } +          ((lv+1)..7).each { |x| @level[x]=false }          end        end        def add_to_body(dob,type='norm') @@ -367,8 +392,8 @@ WOK          @level,@cont,@copen,@xml_contents_close=[],[],[],[]          @rcdc=false          type='norm' -        (0..6).each { |x| @cont[x]=@level[x]=false } -        (4..6).each { |x| @xml_contents_close[x]='' } +        (0..7).each { |x| @cont[x]=@level[x]=false } +        (4..7).each { |x| @xml_contents_close[x]='' }          xml_head          data.each do |dob|            @trans.char_enc.utf8(dob) if @sys.locale =~/utf-?8/i #% utf8 @@ -420,6 +445,10 @@ WOK                      type="heading_content_#{dob.lv}"                      xml_structure(dob,type)                      dob.obj=x.heading_body6 +                  elsif dob.ln==7 +                    type="heading_content_#{dob.lv}" +                    xml_structure(dob,type) +                    dob.obj=x.heading_body7                    end                  else                    dob.ocn @@ -486,7 +515,7 @@ WOK            end          end          @content_flag=true -        6.downto(4) do |x| +        7.downto(4) do |x|            y=x - 1; v=x - 3            if @level[x]==true #2004w36 bug fix? watch/test previous logic broke on free.for.all @coontent_flag introduced              if @content_flag==true diff --git a/lib/sisu/v5/xml_format.rb b/lib/sisu/v5/xml_format.rb index 871ec487..fb2cff88 100644 --- a/lib/sisu/v5/xml_format.rb +++ b/lib/sisu/v5/xml_format.rb @@ -1115,6 +1115,9 @@ WOK      def heading_body6        heading_normal('h6','norm')      end +    def heading_body7 +      heading_normal('h7','norm') +    end      def title_header(tag,attrib)        %{  <div class="content"> @@ -1291,6 +1294,9 @@ WOK      def subtoc_lev6        subtoc_lev('h6','subtoc') if @txt      end +    def subtoc_lev7 +      subtoc_lev('h7','subtoc') if @txt +    end      #% para sisu      def header_sub(tag,attrib)        @txt=@txt.gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ') @@ -1303,12 +1309,6 @@ WOK  </div>  }      end -    def header5 -      header_sub('p','bold') -    end -    def header6 -      header_sub('p','bold') -    end      def header4        %{  <div class="substance"> @@ -1320,6 +1320,15 @@ WOK  </div>  }      end +    def header5 +      header_sub('p','bold') +    end +    def header6 +      header_sub('p','bold') +    end +    def header7 +      header_sub('p','bold') +    end      def navigation_header4        %{<table summary="navigation segment header 4" width=100% bgcolor="#08163f" border="0">  <tr><td align="center"> @@ -1338,6 +1347,11 @@ WOK    #{@txt}  </p>}      end +    def navigation_header7 +      %{<p class="bold"> +  #{@txt} +</p>} +    end      def navigation_center        "<center>#{@txt}</center>"      end @@ -1381,6 +1395,10 @@ WOK      def lev6        lev('h6','toc')      end +    def lev7 +      lev('h7','toc') +      #lev('b','toc') +    end      def lev0 #docinfo        lev('h0','toc')      end @@ -1402,6 +1420,9 @@ WOK      def mini_lev6        lev('h6','minitoc')      end +    def mini_lev7 +      lev('h7','minitoc') +    end      def mini_lev0 #docinfo        lev('h0','minitoc')      end diff --git a/lib/sisu/v5/xml_odf_odt.rb b/lib/sisu/v5/xml_odf_odt.rb index 1fd32244..9598e189 100644 --- a/lib/sisu/v5/xml_odf_odt.rb +++ b/lib/sisu/v5/xml_odf_odt.rb @@ -111,7 +111,9 @@ module SiSU_XML_ODF_ODT              SiSU_Screen::Ansi.new(                @opt.act[:color_state][:set],                @opt.fns, -              "file://#{@md.file.output_path.odt.dir}/#{@md.file.base_filename.odt}" +              'file://' \ +              + @md.file.output_path.odt.dir + '/' \ +              + @md.file.base_filename.odt              ).flow            end          end @@ -173,16 +175,19 @@ module SiSU_XML_ODF_ODT                if x =~/\S+/ then @n << x                end              end -          else              @n << n +          else                  @n << n            end          end        end        def odf_book_idx        if @md.book_idx -        idx_arr,idx_raw=[],SiSU_Particulars::CombinedSingleton.instance.get_idx_raw(@md.opt).raw_idx +        idx_arr=[] +        idx_raw=SiSU_Particulars::CombinedSingleton. +          instance.get_idx_raw(@md.opt).raw_idx          idx_raw.each do |x|            x=if x.is_a?(String) -            SiSU_XML_ODF_ODT_Format::FormatBookIndex.new(x).book_idx_bookmark +            SiSU_XML_ODF_ODT_Format::FormatBookIndex.new(x). +              book_idx_bookmark            else nil            end            idx_arr << x.strip if x.is_a?(String) @@ -191,7 +196,8 @@ module SiSU_XML_ODF_ODT        end        end        def odf_metadata -        @@odf[:metadata]=SiSU_Metadata::Summary.new(@md).odf.metadata +        @@odf[:metadata]=SiSU_Metadata::Summary.new(@md). +          odf.metadata        end        def odf_tail          manifest="#{@md.file.output_path.manifest.url}/#{@md.file.base_filename.manifest}" @@ -224,19 +230,22 @@ module SiSU_XML_ODF_ODT          @@docstart=false          if dob.use_ != :dummy            dob.tmp=dob.obj -          dob.obj=%{#{breakpage}<text:h text:style-name="H_#{dob.ln}" text:outline-level="#{dob.ln}">#{p_num[:set_ref]}#{set_bookmark_tag(dob)}#{dob.obj}#{p_num[:display]}</text:h>} +          dob.obj=%{#{breakpage}<text:h text:style-name="H_#{dob.ln}" text:outline-level="#{dob.ln}">} \ +          + %{#{p_num[:set_ref]}#{set_bookmark_tag(dob)}#{dob.obj}#{p_num[:display]}</text:h>}          else dob.tmp,dob.obj='',''          end          dob        end        def toc(dob,p_num) -        hardspace=(dob.lv =~/[A-C]/i) \ +        hardspace=(dob.lv =~/[A-D]/i) \          ? '<text:p text:style-name="Standard"/>'          : ''          toc_heading=dob.ocn \ -        ? %{<text:bookmark-ref text:reference-format="text" text:ref-name="#{dob.ocn}">#{dob.tmp}</text:bookmark-ref>} +        ? (%{<text:bookmark-ref text:reference-format="text" text:ref-name="#{dob.ocn}">} \ +          + %{#{dob.tmp}</text:bookmark-ref>})          : dob.tmp -        dob.obj=%{<text:h text:style-name="H_#{dob.ln}" text:outline-level="#{dob.ln}">#{toc_heading}</text:h>#{hardspace}} +        dob.obj=%{<text:h text:style-name="H_#{dob.ln}" text:outline-level="#{dob.ln}">} \ +        + %{#{toc_heading}</text:h>#{hardspace}}          dob        end        def image_src(i) @@ -253,7 +262,9 @@ module SiSU_XML_ODF_ODT                @md.opt.act[:color_state][:set],                "ERROR - image:",                %{"#{i}" missing}, -              "search locations: #{@env.path.image_source_include_local},#{@env.path.image_source_include_remote} and #{@env.path.image_source_include}" +              "search locations: #{@env.path.image_source_include_local}," \ +              + "#{@env.path.image_source_include_remote} and" \ +              + "#{@env.path.image_source_include}"              ).error2 unless @md.opt.act[:quiet][:set]==:on              nil            end @@ -271,7 +282,9 @@ module SiSU_XML_ODF_ODT              @md.opt.act[:color_state][:set],              "ERROR - image:",                %{"#{i}" missing}, -              "search locations: #{@env.path.image_source_include_local},#{@env.path.image_source_include_remote} and #{@env.path.image_source_include}" +              "search locations: #{@env.path.image_source_include_local}," \ +              + "#{@env.path.image_source_include_remote} and" \ +              + "#{@env.path.image_source_include}"            ).error2 unless @md.opt.act[:quiet][:set]==:on            nil          end @@ -280,8 +293,10 @@ module SiSU_XML_ODF_ODT          # copy image to od image directory (unless exists)          # divide pixel dimension by 37.79485 and retain 3 decimal places          m=img[1] -        i=/^(\S+?\.(?:png|jpg|gif))/.match(m).captures.join if m =~/^(\S+?\.(?:png|jpg|gif))/ -        c=/^\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"/.match(m).captures.join if m =~/^\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"/ +        i=/^(\S+?\.(?:png|jpg|gif))/.match(m).captures.join \ +          if m =~/^(\S+?\.(?:png|jpg|gif))/ +        c=/^\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"/.match(m).captures.join \ +          if m =~/^\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"/          w,h=/\s(\d+)x(\d+)/.match(m).captures if m =~/\s\d+x\d+/          w=(w.to_i/37.79485).to_s          h=(h.to_i/37.79485).to_s @@ -290,7 +305,10 @@ module SiSU_XML_ODF_ODT          image_source=image_src(i)          if image_source            if FileTest.file?("#{image_source}/#{i}") -            FileUtils::cp("#{image_source}/#{i}","#{@env.processing_path.odt}/Pictures/#{i}") +            FileUtils::cp( +              "#{image_source}/#{i}", +              "#{@env.processing_path.odt}/Pictures/#{i}" +            )            else STDERR.puts %{\t*WARN* did not find image - "#{image_source}/#{i}" [#{__FILE__}:#{__LINE__}]}            end          end @@ -325,7 +343,8 @@ module SiSU_XML_ODF_ODT        def text_link_odf(txt,url,trail)          txt=txt.gsub(/(\\\+)/,'+') #this is convoluted, and risky :-(          url=url.gsub(/(\\\+)/,'+') #this is convoluted, and risky :-( -        map_nametags=SiSU_Particulars::CombinedSingleton.instance.get_map_nametags(@md).nametags_map +        map_nametags=SiSU_Particulars::CombinedSingleton. +          instance.get_map_nametags(@md).nametags_map          t=case url          when /^https?:/            %{<text:a xl:type="simple" xl:href="#{url}">#{txt.strip}</text:a>#{trail}} @@ -342,7 +361,8 @@ module SiSU_XML_ODF_ODT            end            t=map_nametags[url] \            && map_nametags[url][:segname] \ -          ? %{<text:a xl:type="simple" xl:href="#{@env.url.root}/#{@md.fnb}/#{map_nametags[url][:segname]}#{Sfx[:html]}##{url}">#{txt.strip}</text:a>#{trail}} +          ? (%{<text:a xl:type="simple" xl:href="#{@env.url.root}/#{@md.fnb}/#{map_nametags[url][:segname]}#{Sfx[:html]}##{url}">} \ +            + %{#{txt.strip}</text:a>#{trail}})            : %{#{txt.strip}#{trail}}          end          t @@ -359,7 +379,8 @@ module SiSU_XML_ODF_ODT              txt=txt.gsub(/([)(\]\[])/,"\\\\\\1").                gsub(/([+?*])/,"\\\\\\1") # problems with +              url=url.gsub(/([+?])/,"\\\\\\1") # problems with + -            dob.obj=dob.obj.gsub(/#{Mx[:lnk_o]}[ ]*#{txt}#{Mx[:lnk_c]}#{Mx[:url_o]}#{url}#{Mx[:url_c]}/m,text_link_odf(txt,url,trail)). #make sure trailing ']' are not caught in url +            dob.obj=dob.obj.gsub(/#{Mx[:lnk_o]}[ ]*#{txt}#{Mx[:lnk_c]}#{Mx[:url_o]}#{url}#{Mx[:url_c]}/m, +                text_link_odf(txt,url,trail)). #make sure trailing ']' are not caught in url                gsub(/\\([)(\]\[?])/,'\1') #clumsy fix            end            m=nil @@ -374,7 +395,8 @@ module SiSU_XML_ODF_ODT              txt=txt.gsub(/([)(\]\[])/,"\\\\\\1").                gsub(/([+?*])/,"\\\\\\1") # problems with +              url=url.gsub(/([+?])/,"\\\\\\1") # problems with + -            dob.obj=dob.obj.gsub(/#{Mx[:lnk_o]}[ ]*#{txt}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{url}#{Mx[:rel_c]}/m,text_link_odf_bookmark(txt,url,trail)). #make sure trailing ']' are not caught in url +            dob.obj=dob.obj.gsub(/#{Mx[:lnk_o]}[ ]*#{txt}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{url}#{Mx[:rel_c]}/m, +                text_link_odf_bookmark(txt,url,trail)). #make sure trailing ']' are not caught in url                gsub(/\\([)(\]\[?])/,'\1') #clumsy fix            end            m=nil @@ -387,7 +409,8 @@ module SiSU_XML_ODF_ODT            m.each do |i|              txt,url,trail=i[1],i[2]              txt=txt.gsub(/([)(\]\[])/,"\\\\\\1") -            dob.obj=dob.obj.gsub(/#{Mx[:lnk_o]}[ ]*#{txt}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{url}#{Mx[:rel_c]}/m,text_link_odf(txt,url,trail)). #make sure trailing ']' are not caught in url +            dob.obj=dob.obj.gsub(/#{Mx[:lnk_o]}[ ]*#{txt}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{url}#{Mx[:rel_c]}/m, +                text_link_odf(txt,url,trail)). #make sure trailing ']' are not caught in url                gsub(/\\([)(\]\[?])/,'\1') #clumsy fix            end            m=nil @@ -431,11 +454,13 @@ module SiSU_XML_ODF_ODT            @astx||=10000            @astxs||=20000            if str =~/#{Mx[:en_a_o]}\d+\s+/ -            str=str.gsub(/#{Mx[:en_a_o]}(\d+)\s+(.+?)#{Mx[:en_a_c]}/,'<text:note text:id="ftn\1" text:note-class="footnote"><text:note-citation>\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>') +            str=str.gsub(/#{Mx[:en_a_o]}(\d+)\s+(.+?)#{Mx[:en_a_c]}/, +              '<text:note text:id="ftn\1" text:note-class="footnote"><text:note-citation>\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>')            end            if str =~/#{Mx[:en_a_o]}([*]+)\s+/              a=$1.gsub(/([*])/,"\\\\\\1") -              str=str.gsub(/#{Mx[:en_a_o]}([*]+)\s+(.+?)#{Mx[:en_a_c]}/,%{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>}) +              str=str.gsub(/#{Mx[:en_a_o]}([*]+)\s+(.+?)#{Mx[:en_a_c]}/, +                %{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>})                @astxs+=1            end            if str=~/#{Mx[:en_a_o]}[*+]+\s/ @@ -444,7 +469,8 @@ module SiSU_XML_ODF_ODT                a=x[0].gsub(/([*+])/,"\\\\\\1")                str=group_clean(str)                str=footnote_urls(str) -              str=str.gsub(/#{Mx[:en_a_o]}(#{a})\s+(.+?)#{Mx[:en_a_c]}/,%{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>}) +              str=str.gsub(/#{Mx[:en_a_o]}(#{a})\s+(.+?)#{Mx[:en_a_c]}/, +                %{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>})                @astx+=1              end            end @@ -454,7 +480,8 @@ module SiSU_XML_ODF_ODT                a=x[0].gsub(/([*+])/,"\\\\\\1")                str=group_clean(str)                str=footnote_urls(str) -              str=str.gsub(/#{Mx[:en_b_o]}(#{a})\s+(.+?)#{Mx[:en_b_c]}/,%{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>}) +              str=str.gsub(/#{Mx[:en_b_o]}(#{a})\s+(.+?)#{Mx[:en_b_c]}/, +                %{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>})                @astx+=1              end            end @@ -495,7 +522,8 @@ module SiSU_XML_ODF_ODT          dob.obj.split(/#{Mx[:br_line]}|#{Mx[:br_nl]}/).each_with_index do |parablock,i|            set_ref=(i==0) ? "#{p_num[:set_ref]}#{set_bookmark_tag(dob)}" : ''            parablock=group_clean(parablock) -          parablock=parablock.gsub(/<text:a xl:type="simple" xl:href="(.+?)">/m,'<text:a xl:type="simple" xl:href="\1">'). +          parablock=parablock.gsub(/<text:a xl:type="simple" xl:href="(.+?)">/m, +              '<text:a xl:type="simple" xl:href="\1">').              gsub(/<(\/text:a)>/,'<\1>').              gsub(/<(text:note text:id=.+?)>/,'<\1>').              gsub(/<(text:p text:style-name="Footnote")>/,'<\1>'). @@ -519,13 +547,15 @@ module SiSU_XML_ODF_ODT          dob.obj.split(/#{Mx[:br_line]}|#{Mx[:br_nl]}/).each_with_index do |parablock,i|            set_ref=(i==0) ? "#{p_num[:set_ref]}#{set_bookmark_tag(dob)}" : ''            parablock=group_clean(parablock) -          parablock=parablock.gsub(/<text:a xl:type="simple" xl:href="(.+?)">/m,'<text:a xl:type="simple" xl:href="\1">'). +          parablock=parablock.gsub(/<text:a xl:type="simple" xl:href="(.+?)">/m, +              '<text:a xl:type="simple" xl:href="\1">').              gsub(/<(\/text:a)>/,'<\1>').              gsub(/<(text:note text:id=.+?)>/,'<\1>').              gsub(/<(text:p text:style-name="Footnote")>/,'<\1>').              gsub(/<(\/?text:(?:note-citation|note-body|note|p))>/,'<\1>')            parablock=footnote(parablock) -          parray << %{<text:p text:style-name="P_group">#{set_ref}#{parablock}</text:p>} if parablock =~/\S+/ +          parray << %{<text:p text:style-name="P_group">#{set_ref}#{parablock}</text:p>} \ +            if parablock =~/\S+/          end          dob.obj=parray.join \          + %{<text:p text:style-name="P_group">#{p_num[:display]}</text:p>} \ @@ -593,7 +623,7 @@ module SiSU_XML_ODF_ODT          if dob.is==:heading            @@odf[:body] << heading(dob,p_num).obj << break_line*2            if SiSU_Env::ProcessingSettings.new(md).build.toc? -            if dob.lv =~/[A-C1]/i +            if dob.lv =~/[A-D1]/i                @@odf[:toc] << toc(dob,p_num).obj              end            end @@ -623,8 +653,8 @@ module SiSU_XML_ODF_ODT          dir.path.odt_bld          @data_mod,@endnotes,@level,@cont,@copen,@odf_contents_close=Array.new(6){[]}          @rcdc=false -        (0..6).each { |x| @cont[x]=@level[x]=false } -        (4..6).each { |x| @odf_contents_close[x]='' } +        (0..7).each { |x| @cont[x]=@level[x]=false } +        (4..7).each { |x| @odf_contents_close[x]='' }          odf_tail #($1,$2)          bullet=image_src('bullet_09.png')          if bullet @@ -668,7 +698,8 @@ module SiSU_XML_ODF_ODT            dob.obj=dob.obj.gsub(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'<del>\1</del>').              gsub(/#{Mx[:fa_insert_o]}(.+?)#{Mx[:fa_insert_c]}/,'<ins>\1</ins>').              gsub(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,'<cite>\1</cite>'). -            gsub(/#{Mx[:tag_o]}\S+?#{Mx[:tag_c]}/,'<text:bookmark-start text:name="\1"/><text:bookmark-end text:name="\1"/>'). #check +            gsub(/#{Mx[:tag_o]}\S+?#{Mx[:tag_c]}/, +              '<text:bookmark-start text:name="\1"/><text:bookmark-end text:name="\1"/>'). #check              gsub(/#{Mx[:mk_o]}#([a-zA-Z]+)#{Mx[:mk_c]}/,'&\1;').              gsub(/#{Mx[:mk_o]}(#[0-9]+)#{Mx[:mk_c]}/,'&\1;').              gsub(/#{Mx[:mk_o]}[~-]##{Mx[:mk_c]}/,'') @@ -706,7 +737,8 @@ module SiSU_XML_ODF_ODT            wordlist=dob.obj.scan(/\S+/)            dob.obj=tidywords(wordlist).join(' ').strip            @rcdc=true if @rcdc==false \ -          and (dob.obj =~/~metadata/ or dob =~/#{Mx[:lv_o]}1:meta#{Mx[:lv_x]}\s*Document Information/) #fix Mx[:lv_o] +          and (dob.obj =~/~metadata/ \ +          or dob =~/#{Mx[:lv_o]}1:meta#{Mx[:lv_x]}\s*Document Information/) #fix Mx[:lv_o]            if dob.is !~/(^#{Rx[:meta]}|#{Mx[:br_eof]}|#{Mx[:br_endnotes]})/ #check              if defined? dob.ocn and dob.ocn =~/\d+/                @p_num=SiSU_XML_ODF_ODT_Format::ParagraphNumber.new(@make,dob.ocn) @@ -835,7 +867,8 @@ WOK          end          od.close          opendoc=@md.file.base_filename.odt #watch where output by language -        FileUtils::mkdir_p(@md.file.output_path.odt.dir) unless FileTest.directory?(@md.file.output_path.odt.dir) +        FileUtils::mkdir_p(@md.file.output_path.odt.dir) \ +          unless FileTest.directory?(@md.file.output_path.odt.dir)          if FileTest.directory?(@env.processing_path.odt) \          and SiSU_Env::SystemCall.new.zip            pwd=Dir.pwd diff --git a/lib/sisu/v5/xml_odf_odt_format.rb b/lib/sisu/v5/xml_odf_odt_format.rb index bfbd075c..90ca1cba 100644 --- a/lib/sisu/v5/xml_odf_odt_format.rb +++ b/lib/sisu/v5/xml_odf_odt_format.rb @@ -166,6 +166,8 @@ module SiSU_XML_ODF_ODT_Format      end      def heading_body6      end +    def heading_body7 +    end    end    class Table      @@tablehead,@@table_counter=0,0 #reinitialise on new file diff --git a/lib/sisu/v5/xml_sax.rb b/lib/sisu/v5/xml_sax.rb index 273d24cc..69dc39a3 100644 --- a/lib/sisu/v5/xml_sax.rb +++ b/lib/sisu/v5/xml_sax.rb @@ -333,8 +333,8 @@ WOK          @endnotes,@level,@cont,@copen,@xml_contents_close=[],[],[],[],[]          @rcdc=false          xml_head -        (0..6).each { |x| @cont[x]=@level[x]=false } -        (4..6).each { |x| @xml_contents_close[x]='' } +        (0..7).each { |x| @cont[x]=@level[x]=false } +        (4..7).each { |x| @xml_contents_close[x]='' }          data.each do |dob|            @trans.char_enc.utf8(dob) if @sys.locale =~/utf-?8/i #% utf8            dob=@trans.markup(dob) @@ -361,6 +361,7 @@ WOK                    when 4 then x.heading_body4                    when 5 then x.heading_body5                    when 6 then x.heading_body6 +                  when 7 then x.heading_body7                    end                  else                    if dob.is==:verse @@ -415,7 +416,7 @@ WOK              dob.obj=dob.obj.gsub(/#{Mx[:pa_o]}:\S+#{Mx[:pa_c]}/,'') if dob.obj            end          end -        6.downto(4) do |x| +        7.downto(4) do |x|            y=x - 1; v=x - 3            @@xml[:body] << "#{Ax[:tab]*5}</content>\n#{Ax[:tab]*y}</contents#{v}>" if @level[x]==true          end @@ -423,7 +424,7 @@ WOK            y=x - 1            @@xml[:body] << "#{Ax[:tab]*y}</heading#{x}>" if @level[x]==true          end -        #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{Ax[:tab]*y}</level #{x}>" if @level[x]==true } +        #7.downto(1) { |x| y=x - 1; @@xml[:body] << "#{Ax[:tab]*y}</level #{x}>" if @level[x]==true }        end        def pre          rdf=SiSU_XML_Tags::RDF.new(@md) diff --git a/lib/sisu/v6/ao_doc_str.rb b/lib/sisu/v6/ao_doc_str.rb index 2a96abb7..67670a55 100644 --- a/lib/sisu/v6/ao_doc_str.rb +++ b/lib/sisu/v6/ao_doc_str.rb @@ -1223,7 +1223,7 @@ module SiSU_AO_DocumentStructureExtract      end      def structure_info        def lv -        %w[A~ B~ C~ D~ 1 2 3] +        %w[A~ B~ C~ D~ 1 2 3 4]        end        def possible_parents(child)          case child @@ -1234,6 +1234,7 @@ module SiSU_AO_DocumentStructureExtract          when /1/  then 'A~, B~, C~, D~'          when /2/  then '1'          when /3/  then '2' +        when /4/  then '3'          end        end        def possible_children(parent) @@ -1244,20 +1245,21 @@ module SiSU_AO_DocumentStructureExtract          when /D~/ then '1'          when /1/  then '2'          when /2/  then '3' -        when /3/  then 'none' +        when /3/  then '4' +        when /4/  then 'none'          end        end        self      end      def document_structure_check_info(node,node_parent,status=:ok) -      node_ln=/^([0-6])/.match(node)[1].to_i -      node_parent_ln=/^([0-6])/.match(node_parent)[1].to_i +      node_ln=/^([0-7])/.match(node)[1].to_i +      node_parent_ln=/^([0-7])/.match(node_parent)[1].to_i        if status==:error \        or @md.opt.act[:maintenance][:set]==:on          puts %{node: #{node},    parent node: #{node_parent}  #{status.upcase}}          if status==:error -          node_ln=/^([0-6])/.match(node)[1].to_i -          node_parent_ln=/^([0-6])/.match(node_parent)[1].to_i +          node_ln=/^([0-7])/.match(node)[1].to_i +          node_parent_ln=/^([0-7])/.match(node_parent)[1].to_i            STDERR.puts %{current level: #{structure_info.lv[node_ln]} (possible parent levels: #{structure_info.possible_parents(structure_info.lv[node_ln])})  parent level:  #{structure_info.lv[node_parent_ln]} (possible child levels: #{structure_info.possible_children(structure_info.lv[node_parent_ln])})  SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"} @@ -1297,12 +1299,12 @@ SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"        required_headers_present?        data=@data        @o_array=[] -      node=ocn=ocn_dv=ocn_sp=ocnh=ocnh0=ocnh1=ocnh2=ocnh3=ocnh4=ocnh5=ocnh6=ocno=ocnp=ocnt=ocnc=ocng=ocni=ocnu=0 # h heading, o other, t table, g group, i image +      node=ocn=ocn_dv=ocn_sp=ocnh=ocnh0=ocnh1=ocnh2=ocnh3=ocnh4=ocnh5=ocnh6=ocnh7=ocno=ocnp=ocnt=ocnc=ocng=ocni=ocnu=0 # h heading, o other, t table, g group, i image        regex_exclude_ocn_and_node = /#{Rx[:meta]}|^@\S+?:\s|^4~endnotes|^#{Mx[:lv_o]}4:endnotes#{Mx[:lv_c]}|^\^~ |<:e[:_]\d+?>|^<:\#|<:- |<[:!]!4|<hr width|#{Mx[:br_endnotes]}|\A\s*\Z/mi #ocn here #  added with Tune.code #ยก -      parent=node1=node2=node3=node4=node5=node6=nil +      parent=node1=node2=node3=node4=node5=node6=node7=nil        node0='0:0;0'        @collapsed_lv0=0 -      @lev_occurences={ a: 0, b: 0, c: 0, d: 0, l1: 0, l2: 0, l3: 0 } +      @lev_occurences={ a: 0, b: 0, c: 0, d: 0, l1: 0, l2: 0, l3: 0, l4: 0 }        data.each do |dob|          h={}          if (dob.obj !~ regex_exclude_ocn_and_node || dob.is==:code) \ @@ -1336,7 +1338,8 @@ SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"            or ln.to_s =~@md.lv3 \            or ln.to_s =~@md.lv4 \            or ln.to_s =~@md.lv5 \ -          or ln.to_s =~@md.lv6) +          or ln.to_s =~@md.lv6 \ +          or ln.to_s =~@md.lv7)              if not dob.obj =~/~#|-#/                ocnh+=1              end @@ -1523,7 +1526,7 @@ or this level should be level :B~ rather than #{dob.lv}}                  warning_incorrect_parent_level_or_level(dob.obj)                  puts "parent is level 4~ & this level #{dob.lv}  either parent should be level 5~ -or this level should be 5~ rather #{dob.lv}" #level 6 +or this level should be 5~ rather #{dob.lv}"                  document_structure_check_info(node6,node4,:error)                  @collapsed_lv6=@collapsed_lv4+1                  node4 @@ -1549,6 +1552,59 @@ or this level should be 5~ rather #{dob.lv}" #level 6                end                collapsed_level=@collapsed_lv6                node,ocn_sp=node6,"h#{ocnh}" +            elsif ln==7 \ +            or ln=~@md.lv7 +              @lev_occurences[:l4] += 1 +              if not dob.obj =~/~#|-#/ +                ocn_flag=true +                ocnh7+=1 +                node7="7:#{ocnh7};#{ocn}" +              else +                ocn_flag=false +                node7="7:0;0" +              end +              parent=if node6 +                document_structure_check_info(node7,node6) +                @collapsed_lv7=@collapsed_lv6+1 +                node5 +              elsif node5 +                warning_incorrect_parent_level_or_level(dob.obj) +                puts "parent is level 5~ & this level #{dob.lv} +either parent should be level 6~ +or this level should be 6~ rather #{dob.lv}" +                document_structure_check_info(node7,node5,:error) +                @collapsed_lv6=@collapsed_lv5+1 +                node5 +              elsif node4 +                warning_incorrect_parent_level_or_level(dob.obj) +                puts "parent is level 4~ & this level #{dob.lv} +either parent should be level 6~ +or this level should be 6~ rather #{dob.lv}" +                document_structure_check_info(node7,node4,:error) +                @collapsed_lv6=@collapsed_lv4+1 +                node4 +              elsif node3 +                warning_incorrect_parent_level_or_level(dob.obj) +                document_structure_check_info(node7,node3,:error) +                @collapsed_lv6=@collapsed_lv3+1 +                node3 +              elsif node2 +                warning_incorrect_parent_level_or_level(dob.obj) +                document_structure_check_info(node7,node2,:error) +                @collapsed_lv6=@collapsed_lv2+1 +                node2 +              elsif node1 +                warning_incorrect_parent_level_or_level(dob.obj) +                document_structure_check_info(node7,node1,:error) +                @collapsed_lv6=@collapsed_lv1+1 +                node1 +              else +                warning_incorrect_parent_level_or_level(dob.obj) +                document_structure_check_info(node7,node0,:error) +                node0 +              end +              collapsed_level=@collapsed_lv7 +              node,ocn_sp=node7,"h#{ocnh}"              end            else              unless @lev_occurences[:l1] > 0 diff --git a/lib/sisu/v6/constants.rb b/lib/sisu/v6/constants.rb index 2a5e124c..38f0449a 100644 --- a/lib/sisu/v6/constants.rb +++ b/lib/sisu/v6/constants.rb @@ -267,8 +267,8 @@ else    }  end  Db={ -  name_prefix:               "SiSU#{SiSU_is[:version_dir]}b_", -  name_prefix_db:            "sisu_#{SiSU_is[:version_dir]}b_", +  name_prefix:               "SiSU#{SiSU_is[:version_dir]}c_", +  name_prefix_db:            "sisu_#{SiSU_is[:version_dir]}c_",    col_title:                  800,    col_title_part:             400,    col_title_edition:           10, diff --git a/lib/sisu/v6/css.rb b/lib/sisu/v6/css.rb index a2c75d3c..9cdb2d76 100644 --- a/lib/sisu/v6/css.rb +++ b/lib/sisu/v6/css.rb @@ -236,7 +236,7 @@ WOK      margin-bottom: 0px;      text-indent: 0mm;    } -  p, h0, h1, h2, h3, h4, h5, h6 { +  p, h0, h1, h2, h3, h4, h5, h6, h7 {      display: block;      font-family: verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman;      font-size: 100%; @@ -447,7 +447,7 @@ WOK      padding-left: 0em;      text-indent: 0em;    } -  p, h0, h1, h2, h3, h4, h5, h6 { +  p, h0, h1, h2, h3, h4, h5, h6, h7 {      display: block;      font-family: verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman;      font-size: 100%; @@ -1307,18 +1307,18 @@ WOK      font-weight: bold;    } -  h0, h1, h2, h3, h4, h5, h6 { +  h0, h1, h2, h3, h4, h5, h6, h7 {      font-weight: bold;      line-height: 120%;      text-align: left;      margin-top: 20px;      margin-bottom: 10px;    } -  h4.norm, h5.norm, h6.norm { +  h4.norm, h5.norm, h6.norm, h7.norm {      margin-top: 10px;      margin-bottom: 0px;    } -  h1.center, h2.center, h3.center, h4.center, h5.center, h6.center { +  h1.center, h2.center, h3.center, h4.center, h5.center, h6.center, h7.center {      text-align: center;    }    h1 { font-size: 120%; } @@ -1327,6 +1327,7 @@ WOK    h4 { font-size: 105%; }    h5 { font-size: 100%; }    h6 { font-size: 100%; } +  h7 { font-size: 100%; }    h0 { font-size: 80%; }    h1.i {margin-left: 2em;} @@ -1418,6 +1419,8 @@ WOK    }    h6.banner {    } +  h7.banner { +  }    .toc {      font-weight: normal; @@ -1454,6 +1457,11 @@ WOK      font-size: 90%;      line-height: 110%;    } +  h7.toc { +    margin-left: 7em; +    font-size: 85%; +    line-height: 100%; +  }    .microtoc {      margin-top: 2px; @@ -1487,6 +1495,11 @@ WOK      font-weight: normal;      font-size: 90%;    } +  h7.microtoc { +    margin-left: 30mm; +    font-weight: normal; +    font-size: 85%; +  }    .subtoc {      margin-right: 34%; @@ -1504,6 +1517,12 @@ WOK      margin-top: 0px;      margin-bottom: 0px;    } +  h7.subtoc { +    margin-left: 4em; +    font-size: 70%; +    margin-top: 0px; +    margin-bottom: 0px; +  }    div.substance {      width: 100%; @@ -1629,15 +1648,19 @@ WOK      margin-left: 2em;      font-size: 85%;    } +  h7.minitoc { +    margin-left: 3em; +    font-size: 80%; +  }    h0.minitoc {      margin-left: 0em;      font-size: 90%;    } -  h1.c, h2.c, h3.c, h4.c, h5.c, h6.c, p.c { +  h1.c, h2.c, h3.c, h4.c, h5.c, h6.c, h7.c, p.c {      text-align: center    } -  h1.red, h2.red, h3.red, h4.red, h5.red, h6.red { +  h1.red, h2.red, h3.red, h4.red, h5.red, h6.red, h7.red {      text-align: center;      color: #ff0000;      margin-left: 5mm; @@ -1646,7 +1669,7 @@ WOK      margin-bottom: 20px;      margin-right: 15mm;    } -  h1.ruby, h2.ruby, h3.ruby, h4.ruby, h5.ruby, h6.ruby { +  h1.ruby, h2.ruby, h3.ruby, h4.ruby, h5.ruby, h6.ruby, h7.ruby {      text-align: center;      color: #990000;      margin-left: 5mm; @@ -1856,6 +1879,11 @@ WOK        font-weight: bold;        text-align: left;      } +    text[class|="h7"] { +      font-size: 110%; +      font-weight: bold; +      text-align: left; +    }      text[class|="indent0"] {        padding-left: 10%;      } @@ -2591,6 +2619,11 @@ WOK        font-weight: bold;        text-align: left;      } +    text[class|="h7"] { +      font-size: 110%; +      font-weight: bold; +      text-align: left; +    }      text[class|="indent0"] {        padding-left: 10%;      } @@ -3271,6 +3304,11 @@ WOK        font-weight: bold;        text-align: left;      } +    para.h7 { +      font-size: 110%; +      font-weight: bold; +      text-align: left; +    }      table {        margin-left: 5%;        display: block; @@ -3427,6 +3465,11 @@ WOK        font-weight: bold;        text-align: left;      } +    p.h7 { +      font-size: 150%; +      font-weight: bold; +      text-align: left; +    }      ocn {        display: block;        text-align: right; diff --git a/lib/sisu/v6/db_create.rb b/lib/sisu/v6/db_create.rb index 4d551ee2..55eab144 100644 --- a/lib/sisu/v6/db_create.rb +++ b/lib/sisu/v6/db_create.rb @@ -264,6 +264,7 @@ module SiSU_DbCreate              lev4            SMALLINT,              lev5            SMALLINT,              lev6            SMALLINT, +            lev7            SMALLINT,              en_a            SMALLINT NULL,              en_z            SMALLINT NULL,              en_a_asterisk   SMALLINT NULL, @@ -506,9 +507,9 @@ module SiSU_DbCreate            %{COMMENT ON COLUMN doc_objects.metadata_tid              IS 'tie to title in metadata_and_text';},            %{COMMENT ON COLUMN doc_objects.lev_an -            IS 'doc level A-D 1-6';}, +            IS 'doc level A-D 1-4';},            %{COMMENT ON COLUMN doc_objects.lev -            IS 'doc level 0-6 \d\~';}, +            IS 'doc level 0-7 \d\~';},            %{COMMENT ON COLUMN doc_objects.seg              IS 'segment name from level number 4 (lv 1)';},            %{COMMENT ON COLUMN doc_objects.ocn @@ -547,6 +548,8 @@ module SiSU_DbCreate              IS 'document structure, level number 5';},            %{COMMENT ON COLUMN doc_objects.lev6              IS 'document structure, level number 6';}, +          %{COMMENT ON COLUMN doc_objects.lev7 +            IS 'document structure, level number 7';},            %{COMMENT ON COLUMN doc_objects.t_of              IS 'document structure, type of object (object is of)';},            %{COMMENT ON COLUMN doc_objects.t_is diff --git a/lib/sisu/v6/db_import.rb b/lib/sisu/v6/db_import.rb index 5b44b173..54a2f434 100644 --- a/lib/sisu/v6/db_import.rb +++ b/lib/sisu/v6/db_import.rb @@ -118,7 +118,7 @@ module SiSU_DbImport          puts "#{__FILE__}:#{__LINE__}" if @opt.act[:maintenance][:set]==:on        end        @id_n =0 if @col[:lid].nil? or @col[:lid].to_s.empty? -      @col[:lv0]=@col[:lv1]=@col[:lv2]=@col[:lv3]=@col[:lv4]=@col[:lv5]=@col[:lv6]=0 +      @col[:lv0]=@col[:lv1]=@col[:lv2]=@col[:lv3]=@col[:lv4]=@col[:lv5]=@col[:lv6]=@col[:lv7]=0        @db=SiSU_Env::InfoDb.new        @pdf_fn=SiSU_Env::FileOp.new(@md).base_filename        @@dl ||=SiSU_Env::InfoEnv.new.digest.length @@ -390,6 +390,7 @@ module SiSU_DbImport                when /1/ then @col[:lv1]+=1                when /2/ then @col[:lv2]+=1                when /3/ then @col[:lv3]+=1 +              when /4/ then @col[:lv4]+=1                end                @col[:lev]=@col[:plaintext]=@col[:body]=''              elsif data.is==:heading \ @@ -480,7 +481,8 @@ module SiSU_DbImport                @col[:lev]=@col[:plaintext]=@col[:body]=''              elsif data.is==:heading \              && data.ln==6 -              txt,@col[:ocn],@col[:lev_an],@col[:ocnd],@col[:ocns],@col[:t_of],@col[:t_is],@col[:node],@col[:parent],@col[:digest_clean],@col[:digest_all]=data.obj,data.ocn,data.lv,data.odv,data.osp,data.of,data.is,data.node,data.parent,'','' +              txt,       @col[:ocn],@col[:lev_an],@col[:ocnd],@col[:ocns],@col[:t_of],@col[:t_is],@col[:node],@col[:parent],@col[:digest_clean],@col[:digest_all]= +                data.obj,data.ocn,  data.lv,      data.odv,   data.osp,   data.of,    data.is,    data.node,  data.parent,  '',                 ''                @@seg_full=data.name if data.is==:heading && data.ln==6 && data.name #check data.name                @@seg ||='' #nil # watch                @col[:seg]=@@seg @@ -508,6 +510,37 @@ module SiSU_DbImport                t=SiSU_DbTuple::LoadDocuments.new(@conn,@col,@opt,@file_maint)                @tuple_array << t.tuple                @col[:lev]=@col[:plaintext]=@col[:body]='' +            elsif data.is==:heading \ +            && data.ln==7 +              txt,       @col[:ocn],@col[:lev_an],@col[:ocnd],@col[:ocns],@col[:t_of],@col[:t_is],@col[:node],@col[:parent],@col[:digest_clean],@col[:digest_all]= +                data.obj,data.ocn,  data.lv,      data.odv,   data.osp,   data.of,    data.is,    data.node,  data.parent,  '',                 '' +              @@seg_full=data.name if data.is==:heading && data.ln==7 && data.name #check data.name +              @@seg ||='' #nil # watch +              @col[:seg]=@@seg +              @col[:lv7]+=1 +              @col[:lid]+=1 +              @col[:lev]=7 +              @hname=if @col[:seg] \ +              and not @col[:seg].to_s.empty? +                @@hname=@col[:seg].to_s +              else @@hname +              end +              @env=SiSU_Env::InfoEnv.new(@md.fns) +              @base_url="#{@env.url.root}/#{@md.fnb}/#{@hname}.html" +              txt=endnotes(txt).extract_any +              body=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_plus +              @col[:body]=special_character_escape(body) +              plaintext=@col[:body].dup +              plaintext=strip_markup(plaintext) +              @col[:plaintext]=clean_searchable_text(plaintext) +              book_idx=book_idx_hash_to_str(data.idx) +              @col[:book_idx]=clean_searchable_text(book_idx) +              @en_a,@en_z=@en[0].first,@en[0].last if @en[0] +              @en_a_asterisk,@en_z_asterisk=@en_ast[0].first,@en_ast[0].last if @en_ast[0] +              @en_a_plus,@en_z_plus=@en_pls[0].first,@en_pls[0].last if @en_pls[0] +              t=SiSU_DbTuple::LoadDocuments.new(@conn,@col,@opt,@file_maint) +              @tuple_array << t.tuple +              @col[:lev]=@col[:plaintext]=@col[:body]=''                                                                                 #% :structure :layout :comment              elsif data.of==:structure \              || data.of==:layout \ diff --git a/lib/sisu/v6/db_load_tuple.rb b/lib/sisu/v6/db_load_tuple.rb index 46d29896..d1c3005b 100644 --- a/lib/sisu/v6/db_load_tuple.rb +++ b/lib/sisu/v6/db_load_tuple.rb @@ -69,8 +69,8 @@ module SiSU_DbTuple      def initialize(conn,col,opt,file_maint)        @conn,@col,@opt,@file_maint=conn,col,opt,file_maint        @col[:lev]=@col[:lev].to_i -      unless @col[:lev].inspect=~/^[0-6]/ \ -      or @col[:lev]==0..6 +      unless @col[:lev].inspect=~/^[0-7]/ \ +      or @col[:lev]==0..7          @col[:lev]=9        end        @col[:ocn]=0 unless @col[:ocn].inspect=~/\d+/ @@ -78,11 +78,11 @@ module SiSU_DbTuple      end      def tuple                                                                    #% import line        sql_entry=if @col[:en_a] -        "INSERT INTO doc_objects (lid, metadata_tid, lev, lev_an, clean, body, book_idx, ocn, ocnd, ocns, seg, lev0, lev1, lev2, lev3, lev4, lev5, lev6, en_a, en_z, t_of, t_is, node, parent, digest_clean, digest_all) " + -        "VALUES (#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:lev_an]}', '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:book_idx]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv0]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}', '#{@col[:en_a]}', '#{@col[:en_z]}', '#{@col[:t_of]}', '#{@col[:t_is]}', '#{@col[:node]}', '#{@col[:parent]}', '#{@col[:digest_clean]}', '#{@col[:digest_all]}');" +        "INSERT INTO doc_objects (lid, metadata_tid, lev, lev_an, clean, body, book_idx, ocn, ocnd, ocns, seg, lev0, lev1, lev2, lev3, lev4, lev5, lev6, lev7, en_a, en_z, t_of, t_is, node, parent, digest_clean, digest_all) " + +        "VALUES (#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:lev_an]}', '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:book_idx]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv0]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}', '#{@col[:lv7]}', '#{@col[:en_a]}', '#{@col[:en_z]}', '#{@col[:t_of]}', '#{@col[:t_is]}', '#{@col[:node]}', '#{@col[:parent]}', '#{@col[:digest_clean]}', '#{@col[:digest_all]}');"        else -        "INSERT INTO doc_objects (lid, metadata_tid, lev, lev_an, clean, body, book_idx, ocn, ocnd, ocns, seg, lev0, lev1, lev2, lev3, lev4, lev5, lev6, t_of, t_is, node, parent, digest_clean, digest_all) " + -        "VALUES (#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:lev_an]}', '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:book_idx]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv0]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}', '#{@col[:t_of]}', '#{@col[:t_is]}', '#{@col[:node]}', '#{@col[:parent]}', '#{@col[:digest_clean]}', '#{@col[:digest_all]}');" +        "INSERT INTO doc_objects (lid, metadata_tid, lev, lev_an, clean, body, book_idx, ocn, ocnd, ocns, seg, lev0, lev1, lev2, lev3, lev4, lev5, lev6, lev7, t_of, t_is, node, parent, digest_clean, digest_all) " + +        "VALUES (#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:lev_an]}', '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:book_idx]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv0]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}', '#{@col[:lv7]}', '#{@col[:t_of]}', '#{@col[:t_is]}', '#{@col[:node]}', '#{@col[:parent]}', '#{@col[:digest_clean]}', '#{@col[:digest_all]}');"        end        if @opt.act[:verbose_plus][:set]==:on          if @opt.act[:maintenance][:set]==:on @@ -97,7 +97,7 @@ module SiSU_DbTuple          end        end        if @opt.act[:verbose][:set]==:on -        if @col[:lev].inspect =~/[0-356]/ +        if @col[:lev].inspect =~/[0-35-7]/            lev=case @col[:lev].inspect            when /0/ then ':A'            when /1/ then ':B' @@ -105,10 +105,11 @@ module SiSU_DbTuple            when /3/ then ':D'            when /5/ then ' 2'            when /6/ then ' 3' +          when /7/ then ' 4'            end -          puts %{#{lev}>\t#{@col[:lv0]}\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]}} +          puts %{#{lev}>\t#{@col[:lv0]}\t#{@col[:lv1]}\t#{@col[:lv2]}\t#{@col[:lv3]}\t#{@col[:lv4]}\t#{@col[:lv5]}\t#{@col[:lv6]}\t#{@col[:lv7]}\t#{@col[:ocn]}\t#{@col[:node]}\t#{@col[:ocns]}}          elsif @col[:lev].inspect =~/[4]/ -          puts %{ #{@cX.green}1>#{@cX.off}\t#{@col[:lv0]}\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]}\t#{@col[:seg]}} +          puts %{ #{@cX.green}1>#{@cX.off}\t#{@col[:lv0]}\t#{@col[:lv1]}\t#{@col[:lv2]}\t#{@col[:lv3]}\t#{@col[:lv4]}\t#{@col[:lv5]}\t#{@col[:lv6]}\t#{@col[:lv7]}\t#{@col[:ocn]}\t#{@col[:node]}\t#{@col[:ocns]}\t#{@col[:seg]}}          end        end        sql_entry diff --git a/lib/sisu/v6/html_format.rb b/lib/sisu/v6/html_format.rb index 2f7b030e..b2476719 100644 --- a/lib/sisu/v6/html_format.rb +++ b/lib/sisu/v6/html_format.rb @@ -1065,6 +1065,9 @@ WOK      def heading_body6        heading_normal('h6','norm')      end +    def heading_body7 +      heading_normal('h7','norm') +    end      def title_heading(tag,attrib)        cl=(@make.build.html_minitoc?) \        ? 'content' @@ -1228,6 +1231,8 @@ WOK      end      def navigation_toc_lev6      end +    def navigation_toc_lev7 +    end      def endnote_seg_body(fn='')  #FIX                                                #url construction keep within single line... BUG WATCH 200408        fn='doc' if fn.to_s.empty? #you may wish to reconsider, sends to 'doc' where no segment info        %{ @@ -1265,6 +1270,9 @@ WOK      def subtoc_lev6        subtoc_lev('h6','subtoc') if @txt      end +    def subtoc_lev7 +      subtoc_lev('h7','subtoc') if @txt +    end      def heading_sub(tag,attrib)        @txt=@txt.gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ')        %{ @@ -1357,6 +1365,9 @@ WOK      def lev6        lev('h6','toc')      end +    def lev7 +      lev('h7','toc') +    end      def strip_endnotes(txt)        txt=txt.gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ')        txt @@ -1389,6 +1400,10 @@ WOK        @txt=strip_endnotes(@txt)        lev('h6','minitoc')      end +    def mini_lev7 +      @txt=strip_endnotes(@txt) +      lev('h7','minitoc') +    end      def mini_lev0 #docinfo        lev('h1','minitoc')      end diff --git a/lib/sisu/v6/html_scroll.rb b/lib/sisu/v6/html_scroll.rb index 27caaff9..9d036469 100644 --- a/lib/sisu/v6/html_scroll.rb +++ b/lib/sisu/v6/html_scroll.rb @@ -88,11 +88,13 @@ module SiSU_HTML_Scroll        @rcdc=false        @scr={ body: [], metadata: [], owner_details: [] }        data.each do |dob| -        dob.obj=dob.obj.gsub(/#{@md.file.output_path.html_seg.rel_image}/m,@md.file.output_path.html_scroll.rel_image) +        dob.obj=dob.obj.gsub(/#{@md.file.output_path.html_seg.rel_image}/m, +          @md.file.output_path.html_scroll.rel_image)          if defined? dob.name and dob.name =~/^meta/ \          and dob.obj =~/Document Information/ -          dob.obj=dob.obj.gsub(/(Document Information(?: \(metadata\))?)/, -            '\1<a name="docinfo"></a>') +          dob.obj=dob.obj. +            gsub(/(Document Information(?: \(metadata\))?)/, +              '\1<a name="docinfo"></a>')          end          if dob.obj =~/^Metadata$/ \          and dob.lv =='B' @@ -108,7 +110,8 @@ module SiSU_HTML_Scroll            gsub(/href="#{Xx[:segment]}/m,'href="')          if dob.obj !~/(^#{Rx[:meta]}|#{Mx[:br_eof]})/            unless dob.is ==:code -            dob.obj=dob.obj.gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ') +            dob.obj=dob.obj. +              gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ')            end            if defined? dob.ocn              @p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,dob.ocn) @@ -129,6 +132,8 @@ module SiSU_HTML_Scroll                sto.heading_body5              elsif dob.ln==6                sto.heading_body6 +            elsif dob.ln==7 +              sto.heading_body7              end            elsif dob.is==:break \            and dob.from==:markup @@ -162,7 +167,8 @@ module SiSU_HTML_Scroll              elsif dob.ln==4 \              and dob.obj=='Index'                sto.heading_body4 -              book_idx=SiSU_Particulars::CombinedSingleton.instance.get_idx_html(@md.opt).html_idx +              book_idx=SiSU_Particulars::CombinedSingleton. +                instance.get_idx_html(@md.opt).html_idx                book_idx.each do |y| #takes book index prepared for segments & strips segment identifying info                  y.gsub!(/<a href="\S+?\.html#(\d+)">(\1(?:-\d+)?)<\/a>/,                    '<a href="#\1">\2</a>') @@ -176,6 +182,10 @@ module SiSU_HTML_Scroll                unless dob.obj.empty?                  sto.heading_body6                end +            elsif dob.ln==7 +              unless dob.obj.empty? +                sto.heading_body7 +              end              end            elsif dob.is==:para              if dob.indent \ @@ -222,7 +232,9 @@ module SiSU_HTML_Scroll      def tails        scr_tail=[]        format_head_scroll=SiSU_HTML_Format::HeadToc.new(@md) -      scr_tail << format_head_scroll.scroll_tail << format_head_scroll.html_close +      scr_tail \ +      << format_head_scroll.scroll_tail \ +      << format_head_scroll.html_close        scr_tail      end    end diff --git a/lib/sisu/v6/html_segments.rb b/lib/sisu/v6/html_segments.rb index 941610ee..b410d0b0 100644 --- a/lib/sisu/v6/html_segments.rb +++ b/lib/sisu/v6/html_segments.rb @@ -67,7 +67,8 @@ module SiSU_HTML_Seg    require_relative 'shared_metadata'                    # shared_metadata.rb    class Output      def initialize(md,outputfile,seg,minitoc,type='') -      @md,@output_seg_file,@seg,@minitoc,@type=md,outputfile,seg,minitoc,type +      @md, @output_seg_file,@seg,@minitoc,@type= +        md,outputfile,      seg,minitoc,  type        @title_banner_=SiSU_Env::CreateSite.new(@md.opt).html_seg_title_banner?        @file=SiSU_Env::FileOp.new(@md)        @make=SiSU_Env::ProcessingSettings.new(@md) @@ -79,59 +80,97 @@ module SiSU_HTML_Seg        if @seg[:title] =~/\S/          filename_seg=[]          if @make.build.html_top_band? -          filename_seg << @seg[:title] << @seg[:tocband_banner] +          filename_seg \ +          << @seg[:title] \ +          << @seg[:tocband_banner]          else -          filename_seg << @seg[:title] +          filename_seg \ +          << @seg[:title]          end          if @type=='endnotes'            @seg[:headings]=[]            format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md)            if @title_banner_ -            @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) +            @seg[:headings] \ +            << format_head_seg. +              title_banner(@md.title.main,@md.title.sub,@author)            end            txt_obj={ txt: 'Endnotes', ocn_display: '' }            format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) -          @seg[:headings] << format_seg.title_heading1 -          filename_seg << @seg[:heading_endnotes] << @minitoc << @seg[:headings] << %{\n<div class="#{@cl}">\n} << @seg[:endnote_all] << '</div>' # << '</div>' +          @seg[:headings] \ +          << format_seg.title_heading1 +          filename_seg \ +          << @seg[:heading_endnotes] \ +          << @minitoc << @seg[:headings] \ +          << %{\n<div class="#{@cl}">\n} \ +          << @seg[:endnote_all] \ +          << '</div>' # << '</div>'          elsif @type=='idx'            @seg[:headings]=[]            format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md)            if @title_banner_ -            @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) +            @seg[:headings] \ +            << format_head_seg. +              title_banner(@md.title.main,@md.title.sub,@author)            end            txt_obj={ txt: 'Index', ocn_display: '' }            format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj)            @seg[:headings] << format_seg.title_heading1 -          filename_seg << @seg[:heading_idx] << @minitoc << @seg[:headings] << %{\n<div class="#{@cl}">\n} << @seg[:idx] << '</div>' # << '</div>' +          filename_seg \ +          << @seg[:heading_idx] \ +          << @minitoc << @seg[:headings] \ +          << %{\n<div class="#{@cl}">\n} \ +          << @seg[:idx] \ +          << '</div>' # << '</div>'          elsif @type=='metadata'            metadata=SiSU_Metadata::Summary.new(@md).xhtml_display.metadata            @seg[:headings]=[]            format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md)            if @title_banner_ -            @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) +            @seg[:headings] \ +            << format_head_seg. +              title_banner(@md.title.main,@md.title.sub,@author)            end            txt_obj={ txt: 'Metadata', ocn_display: '' }            format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj)            @seg[:headings] << format_seg.title_heading1 -          filename_seg << @seg[:heading_idx] << @minitoc << @seg[:headings] << %{\n<div class="#{@cl}">\n} << metadata << '</div>' # << '</div>' +          filename_seg \ +          << @seg[:heading_idx] \ +          << @minitoc \ +          << @seg[:headings] \ +          << %{\n<div class="#{@cl}">\n} \ +          << metadata \ +          << '</div>' # << '</div>'          else            if @make.build.html_top_band? -            filename_seg << @minitoc << @seg[:headings] << @seg[:main] << "\n</div>\n" +            filename_seg \ +            << @minitoc \ +            << @seg[:headings] \ +            << @seg[:main] \ +            << "\n</div>\n"            else -            filename_seg << @minitoc << @seg[:main] << "\n</div>\n" +            filename_seg \ +            << @minitoc \ +            << @seg[:main] \ +            << "\n</div>\n"            end          end          filename_seg <<=if @make.build.html_top_band? -          @seg[:tail] << @seg[:tocband_bannerless] << @seg[:credits] +          @seg[:tail] \ +          << @seg[:tocband_bannerless] \ +          << @seg[:credits]          else -          @seg[:tail] << @seg[:credits] +          @seg[:tail] \ +          << @seg[:credits]          end          filename_seg=filename_seg.flatten.compact #watch          filename_seg.each do |str|            unless str =~/\A\s*\Z/              str=str.strip. -              gsub(Xx[:html_relative2],@file.path_rel_links.html_seg_2). -              gsub(Xx[:html_relative1],@file.path_rel_links.html_seg_1) +              gsub(Xx[:html_relative2], +                @file.path_rel_links.html_seg_2). +              gsub(Xx[:html_relative1], +                @file.path_rel_links.html_seg_1)              @output_seg_file << str            end          end @@ -146,7 +185,17 @@ module SiSU_HTML_Seg      @@loop_count=@@seg_total=@@tracker=0      @@is4=@@is3=@@is2=@@is1=@@is0=0      @@heading0=@@heading1=@@heading2=@@heading3=@@heading4=0 -    @@seg[:tocband_banner],@@seg[:tocband_bannerless],@@seg[:title],@@seg[:headings],@@seg[:main],@@seg[:idx],@@seg[:tail],@@seg[:credits],@@seg_subtoc_array,@@seg_endnotes_array,@@seg[:endnote_all]=Array.new(11){[]} +    @@seg[:tocband_banner], +      @@seg[:tocband_bannerless], +      @@seg[:title],@@seg[:headings], +      @@seg[:main], +      @@seg[:idx], +      @@seg[:tail], +      @@seg[:credits], +      @@seg_subtoc_array, +      @@seg_endnotes_array, +      @@seg[:endnote_all]= +      Array.new(11){[]}      @@seg[:heading_endnotes]=''      @@tablehead,@@number_of_cols=0,0      @@dp,@@segtocband=nil,nil @@ -192,7 +241,8 @@ module SiSU_HTML_Seg        idx_html=nil        if @md.book_idx          #my_make_source_file=SiSU_Env::CreateFile.new(@md.fns) -        idx_html=SiSU_Particulars::CombinedSingleton.instance.get_idx_html(@md.opt).html_idx +        idx_html=SiSU_Particulars::CombinedSingleton. +          instance.get_idx_html(@md.opt).html_idx          idx_html.each {|x| @@seg[:idx] << x }          @@seg[:heading_idx]=''        end @@ -215,7 +265,8 @@ module SiSU_HTML_Seg            @@seg_name.length          ).segmented        end -      map_nametags=SiSU_Particulars::CombinedSingleton.instance.get_map_nametags(@md).nametags_map #p map_nametags +      map_nametags=SiSU_Particulars::CombinedSingleton. +        instance.get_map_nametags(@md).nametags_map #p map_nametags        data.each do |dob|          if defined? dob.obj \          and dob.obj =~/href="#{Xx[:segment]}#+\S+?"/ @@ -227,10 +278,12 @@ module SiSU_HTML_Seg                lng=(inf.output_dir_structure.by_language_code?) \                ? ''                : '.' + @md.opt.lng -              dob.obj.sub!(/href="#{Xx[:segment]}#+(\S+?)"/,%{href="#{map_nametags[m][:segname]}#{lng}#{Sfx[:html]}#\\1"}) +              dob.obj.sub!(/href="#{Xx[:segment]}#+(\S+?)"/, +                %{href="#{map_nametags[m][:segname]}#{lng}#{Sfx[:html]}#\\1"})              else                p "NOT FOUND name_tags: #{m}" -              dob.obj.sub!(/href="#{Xx[:segment]}#+(\S+?)"/,%{href="#\\1"}) # not satisfactory +              dob.obj.sub!(/href="#{Xx[:segment]}#+(\S+?)"/, +                %{href="#\\1"}) # not satisfactory              end            end          end @@ -281,7 +334,8 @@ module SiSU_HTML_Seg                if tracking != 0                  @file=SiSU_Env::FileOp.new(@md)                  unless FileTest.directory?(@file.output_path.html_seg.dir) -                  FileUtils::mkdir_p(@file.output_path.html_seg.dir) if File.writable?("#{@file.output_path.base.dir}/.") +                  FileUtils::mkdir_p(@file.output_path.html_seg.dir) \ +                    if File.writable?("#{@file.output_path.base.dir}/.")                  end                  SiSU_HTML_Seg::Seg.new(@md).tail                  fnh={ @@ -357,7 +411,7 @@ module SiSU_HTML_Seg        && (@make.build.html_navigation_bar?)          x=if (dob.is==:heading \          || dob.is==:heading_insert) \ -        && (dob.ln.to_s =~/^[0-6]/) +        && (dob.ln.to_s =~/^[0-7]/)            x=if @@tracker < @@seg_total-1              format_head_seg.dot_control_pre_next            else @@ -387,10 +441,14 @@ module SiSU_HTML_Seg        @p_num ||= ''        if @@is0==1          @author=%{<b>#{@md.author}</b>\n} if @md.author.to_s =~/\S/ -        @@seg[:tocband_banner] << format_head_seg.navigation_band(@@segtocband,@@seg[:dot_nav]) -        @@seg[:tocband_bannerless] << '<br />' << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav]) +        @@seg[:tocband_banner] \ +        << format_head_seg.navigation_band(@@segtocband,@@seg[:dot_nav]) +        @@seg[:tocband_bannerless] \ +        << '<br />' \ +        << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav])          if @title_banner_ -          @@seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author).gsub(clean,'') +          @@seg[:headings] \ +          << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author).gsub(clean,'')          end          ocn=(@@heading0[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#{@dp}:#{@dp}#{Mx[:id_c]}$/]) \          ? $1 @@ -398,8 +456,10 @@ module SiSU_HTML_Seg          @p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)          txt_obj={ txt: @@heading0, ocn_display: @p_num.ocn_display }          format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) -        @@seg[:headings] << format_seg.title_heading0.gsub(clean,'') -        @@heading0=@@heading0.gsub(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') +        @@seg[:headings] \ +        << format_seg.title_heading0.gsub(clean,'') +        @@heading0=@@heading0. +          gsub(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'')        end        if @@is1==1          heading1=@@heading1 @@ -409,8 +469,10 @@ module SiSU_HTML_Seg          @p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)          txt_obj={ txt: heading1, ocn_display: @p_num.ocn_display }          format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) -        @@seg[:headings] << format_seg.title_heading1.gsub(clean,'') -        @@heading1=@@heading1.gsub(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') +        @@seg[:headings] \ +        << format_seg.title_heading1.gsub(clean,'') +        @@heading1=@@heading1. +          gsub(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'')        end        if @@is2==1          heading2=@@heading2 @@ -420,8 +482,10 @@ module SiSU_HTML_Seg          @p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)          txt_obj={ txt: heading2, ocn_display: @p_num.ocn_display }          format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) -        @@seg[:headings] << format_seg.title_heading2.gsub(clean,'') -        @@heading2=@@heading2.gsub(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') +        @@seg[:headings] \ +        << format_seg.title_heading2.gsub(clean,'') +        @@heading2=@@heading2. +          gsub(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'')        end        if @@is3==1          heading3=@@heading3 @@ -431,8 +495,10 @@ module SiSU_HTML_Seg          @p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)          txt_obj={ txt: heading3, ocn_display: @p_num.ocn_display }          format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) -        @@seg[:headings] << format_seg.title_heading3.gsub(clean,'') -        @@heading3=@@heading3.gsub(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') +        @@seg[:headings] \ +        << format_seg.title_heading3.gsub(clean,'') +        @@heading3=@@heading3. +          gsub(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'')        end        if @@is4==1          heading4=@@heading4 @@ -442,7 +508,8 @@ module SiSU_HTML_Seg          @p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)          txt_obj={ txt: heading4, ocn_display: @p_num.ocn_display }          format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) -        @@seg[:headings] << format_seg.title_heading4.gsub(clean,'') +        @@seg[:headings] \ +        << format_seg.title_heading4.gsub(clean,'')        end        @@tracker=@@tracker+1      end @@ -467,6 +534,8 @@ module SiSU_HTML_Seg                sto.seg_heading5              elsif dob.ln==6                sto.seg_heading6 +            elsif dob.ln==7 +              sto.seg_heading6              end            elsif dob.is==:para              if dob.indent \ @@ -589,7 +658,7 @@ module SiSU_HTML_Seg            end          end          if dob.is==:heading \ -        && (dob.ln.to_s =~/^[56]/) +        && (dob.ln.to_s =~/^[5-7]/)            case dob.ln            when 5              txt_obj={ txt: dob.obj.strip, ocn: dob.ocn } @@ -599,6 +668,10 @@ module SiSU_HTML_Seg              txt_obj={ txt: dob.obj.strip, ocn: dob.ocn }              format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj)              subtoc=format_seg.subtoc_lev6 #keep and make available, this is the subtoc +          when 7 +            txt_obj={ txt: dob.obj.strip, ocn: dob.ocn } +            format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) +            subtoc=format_seg.subtoc_lev7 #keep and make available, this is the subtoc            end            @@seg_subtoc_array << subtoc          end diff --git a/lib/sisu/v6/texpdf.rb b/lib/sisu/v6/texpdf.rb index 42e8383f..9861a5b5 100644 --- a/lib/sisu/v6/texpdf.rb +++ b/lib/sisu/v6/texpdf.rb @@ -648,6 +648,8 @@ module SiSU_TeX                tst.heading_level_2              when 6                tst.heading_level_3 +            when 7 +              tst.heading_level_4              else dob              end            when :heading_insert diff --git a/lib/sisu/v6/texpdf_format.rb b/lib/sisu/v6/texpdf_format.rb index ba99efb7..95764b60 100644 --- a/lib/sisu/v6/texpdf_format.rb +++ b/lib/sisu/v6/texpdf_format.rb @@ -323,6 +323,9 @@ module SiSU_TeX_Pdf      def heading_level_3        heading_sublevels(@dob)      end +    def heading_level_4 +      heading_sublevels(@dob) +    end      def hang        case @dob.indent        when /0/ diff --git a/lib/sisu/v6/txt_plain.rb b/lib/sisu/v6/txt_plain.rb index 69008276..fb39de37 100644 --- a/lib/sisu/v6/txt_plain.rb +++ b/lib/sisu/v6/txt_plain.rb @@ -254,6 +254,9 @@ WOK            def l6              '.'            end +          def l7 +            '.' +          end            self          end          def bold @@ -402,6 +405,9 @@ WOK              end            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 +          when 7 +            wrapped.upcase << break_line << decorate.heading_underscore.l7*times + p_num << break_line*2 +          #when 7 then wrapped.upcase << break_line << decorate.heading_underscore.l7*times + p_num << break_line*2            end          else            @plaintext[:body] << wrapped + p_num << break_line # main text, contents, body KEEP @@ -419,7 +425,9 @@ WOK          if make.build.plaintext_ocn?            if defined? dob.ocn \            and dob.ocn.is_a?(Fixnum) -            (defined? dob.ocn) ? "\n#{Dx[:ocn_o]}#{dob.ocn}#{Dx[:ocn_c]}" : '' +            (defined? dob.ocn) \ +            ? "\n#{Dx[:ocn_o]}#{dob.ocn}#{Dx[:ocn_c]}" \ +            : ''            else ''            end          else '' @@ -428,8 +436,8 @@ WOK        def markup(data)                                                       # Used for major markup instructions          SiSU_Env::InfoEnv.new(@md.fns)          @data_mod,@endnotes,@level,@cont,@copen,@plaintext_contents_close=Array.new(6){[]} -        (0..6).each { |x| @cont[x]=@level[x]=false } -        (4..6).each { |x| @plaintext_contents_close[x]='' } +        (0..7).each { |x| @cont[x]=@level[x]=false } +        (4..7).each { |x| @plaintext_contents_close[x]='' }          plaintext_tail #($1,$2)          plaintext_metadata          table_message='[table omitted, see other document formats]' diff --git a/lib/sisu/v6/xhtml.rb b/lib/sisu/v6/xhtml.rb index ee19a12e..409a2b6c 100644 --- a/lib/sisu/v6/xhtml.rb +++ b/lib/sisu/v6/xhtml.rb @@ -310,8 +310,8 @@ WOK          @rcdc=false          @level,@cont,@copen,@xml_contents_close=[],[],[],[]          xml_head -        (0..6).each { |x| @cont[x]=@level[x]=false } -        (4..6).each { |x| @xml_contents_close[x]='' } +        (0..7).each { |x| @cont[x]=@level[x]=false } +        (4..7).each { |x| @xml_contents_close[x]='' }          data.each do |dob|            dob=@trans.char_enc.utf8(dob) if @sys.locale =~/utf-?8/i #% utf8            dob=@trans.markup(dob) @@ -337,6 +337,7 @@ WOK                  when 4 then x.heading_body4                  when 5 then x.heading_body5                  when 6 then x.heading_body6 +                when 7 then x.heading_body7                  end                else                  if dob.is ==:verse diff --git a/lib/sisu/v6/xhtml_epub2.rb b/lib/sisu/v6/xhtml_epub2.rb index 0e65b469..9ab7c6ec 100644 --- a/lib/sisu/v6/xhtml_epub2.rb +++ b/lib/sisu/v6/xhtml_epub2.rb @@ -268,6 +268,7 @@ module SiSU_XHTML_EPUB2                lv_name='section_a' + @s_a_no.to_s                @nav_no+=1                @nav_no2=@nav_no +              @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[7]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4] @@ -275,7 +276,8 @@ module SiSU_XHTML_EPUB2                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[2]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[1]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[0] -              @ncxo[0],@ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,false,false,false,false +              @ncxo[0],@ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6],@ncxo[7]= +                true,  false,   false,   false,   false,   false,   false,   false                @epub.sections(dob_toc,lv_name)                if @level_a_first_occurrence \                && @make.build.toc? @@ -293,13 +295,15 @@ module SiSU_XHTML_EPUB2                lv_name='section_b' + @s_b_no.to_s                @nav_no+=1                @nav_no2=@nav_no +              @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[7]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[2]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[1] -              @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,false,false,false +              @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6],@ncxo[7]= +                true,  false,   false,   false,   false,   false,   false                @epub.sections(dob_toc,lv_name)                @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name) if dob_toc                md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name) @@ -311,12 +315,14 @@ module SiSU_XHTML_EPUB2                lv_name='section_c' + @s_c_no.to_s                @nav_no+=1                @nav_no2=@nav_no +              @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[7]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[2] -              @ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,false,false +              @ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6],@ncxo[7]= +                true,  false,   false,   false,   false,   false                @epub.sections(dob_toc,lv_name)                @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name) if dob_toc                md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name) @@ -328,11 +334,13 @@ module SiSU_XHTML_EPUB2                lv_name='section_d' + @s_d_no.to_s                @nav_no+=1                @nav_no3=@nav_no +              @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[7]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3] -              @ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,false +              @ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6],@ncxo[7]= +                true,  false,   false,   false,   false                @epub.sections(dob_toc,lv_name)                @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name) if dob_toc                md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name) @@ -344,10 +352,12 @@ module SiSU_XHTML_EPUB2                lv_name=dob_toc.name                @nav_no+=1                @dob_name=dob.name +              @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[7]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4] -              @ncxo[4],@ncxo[5],@ncxo[6]=true,false,false +              @ncxo[4],@ncxo[5],@ncxo[6],@ncxo[7]= +                true,  false,   false,   false                @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name) if dob_toc                md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name)                md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name) @@ -358,9 +368,11 @@ module SiSU_XHTML_EPUB2                hashtag='#o' + dob_toc.ocn.to_s                lv_name=@dob_name                @nav_no+=1 +              @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[7]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5] -              @ncxo[5],@ncxo[6]=true,false +              @ncxo[5],@ncxo[6],@ncxo[7]= +                true,  false, false                @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name,hashtag) if dob_toc                md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name,hashtag)                md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name,hashtag) @@ -371,13 +383,27 @@ module SiSU_XHTML_EPUB2                hashtag='#o' + dob_toc.ocn.to_s                lv_name=@dob_name                @nav_no+=1 +              @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[7]                @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6] -              @ncxo[6]=true +              @ncxo[6],@ncxo[7]= +                true,  false                @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name,hashtag) if dob_toc                md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name,hashtag)                md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name,hashtag)                md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,lv_name,hashtag)                SiSU_XHTML_EPUB2::Source::Toc.new(@md,dob_toc).level_6 +            when 7 +              @ncx_cls=[] +              hashtag='#o' + dob_toc.ocn.to_s +              lv_name=@dob_name +              @nav_no+=1 +              @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[7] +              @ncxo[7]=true +              @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name,hashtag) if dob_toc +              md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name,hashtag) +              md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name,hashtag) +              md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,lv_name,hashtag) +              SiSU_XHTML_EPUB2::Source::Toc.new(@md,dob_toc).level_7              else nil              end              toc.each do |k,d| @@ -594,6 +620,27 @@ module SiSU_XHTML_EPUB2          end          toc        end +      def level_7 +        dob=@data +        linkname=dob.obj.gsub(/#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]}/,'').strip +        ocn=dob.ocn +        toc={} +        if ocn \ +        and ocn !~/#/ +          p_num=SiSU_XHTML_EPUB2_Format::ParagraphNumber.new(@md,ocn) +          lnk_n_txt=%{  <a href="#{@@seg_url}#{Sfx[:epub_xhtml]}#o#{ocn}"> +  #{linkname} +</a>} +          txt_obj={ txt: lnk_n_txt } +          format_toc=SiSU_XHTML_EPUB2_Format::FormatToc.new(@md,txt_obj) +          toc[:seg]=format_toc.lev7 +          title=%{#{p_num.goto}#{linkname}</a>} +          txt_obj={ txt: title } +          format_toc=SiSU_XHTML_EPUB2_Format::FormatToc.new(@md,txt_obj) +          toc[:scr]=format_toc.lev7 +        end +        toc +      end      end      class ScrollHeadAndSegToc < Toc        def initialize(md='',toc='',links_guide_toc='') diff --git a/lib/sisu/v6/xhtml_epub2_format.rb b/lib/sisu/v6/xhtml_epub2_format.rb index 626eb79f..aba5b761 100644 --- a/lib/sisu/v6/xhtml_epub2_format.rb +++ b/lib/sisu/v6/xhtml_epub2_format.rb @@ -162,7 +162,7 @@ module SiSU_XHTML_EPUB2_Format      padding-left: 0em;      text-indent: 0mm;    } -  p, h0, h1, h2, h3, h4, h5, h6 { +  p, h0, h1, h2, h3, h4, h5, h6, h7 {      display: block;      font-family: verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman;      font-size: 100%; @@ -992,18 +992,18 @@ module SiSU_XHTML_EPUB2_Format      font-weight: bold;    } -  h0, h1, h2, h3, h4, h5, h6 { +  h0, h1, h2, h3, h4, h5, h6, h7 {      font-weight: bold;      line-height: 120%;      text-align: left;      margin-top: 20px;      margin-bottom: 10px;    } -  h4.norm, h5.norm, h6.norm { +  h4.norm, h5.norm, h6.norm, h7.norm {      margin-top: 10px;      margin-bottom: 0px;    } -  h1.center, h2.center, h3.center, h4.center, h5.center, h6.center { +  h1.center, h2.center, h3.center, h4.center, h5.center, h6.center, h7.center {      text-align: center;    }    h1 { font-size: 120%; } @@ -1012,6 +1012,7 @@ module SiSU_XHTML_EPUB2_Format    h4 { font-size: 105%; }    h5 { font-size: 100%; }    h6 { font-size: 100%; } +  h7 { font-size: 100%; }    h0 { font-size: 80%; }    h1.i {margin-left: 2em;} @@ -1059,6 +1060,11 @@ module SiSU_XHTML_EPUB2_Format      font-size: 90%;      line-height: 110%;    } +  h7.toc { +    margin-left: 7em; +    font-size: 90%; +    line-height: 105%; +  }    .microtoc {      margin-top: 2px; @@ -1092,6 +1098,11 @@ module SiSU_XHTML_EPUB2_Format      font-weight: normal;      font-size: 90%;    } +  h7.microtoc { +    margin-left: 30mm; +    font-weight: normal; +    font-size: 85%; +  }    .subtoc {      margin-right: 34%; @@ -1109,6 +1120,12 @@ module SiSU_XHTML_EPUB2_Format      margin-top: 0px;      margin-bottom: 0px;    } +  h7.subtoc { +    margin-left: 4em; +    font-size: 70%; +    margin-top: 0px; +    margin-bottom: 0px; +  }    div.substance {      width: 100%; @@ -1196,10 +1213,10 @@ module SiSU_XHTML_EPUB2_Format      background-color: #f9f9aa;    } -  h1.c, h2.c, h3.c, h4.c, h5.c, h6.c, p.c { +  h1.c, h2.c, h3.c, h4.c, h5.c, h6.c, h7.c, p.c {      text-align: center    } -  h1.red, h2.red, h3.red, h4.red, h5.red, h6.red { +  h1.red, h2.red, h3.red, h4.red, h5.red, h6.red, h7.red {      text-align: center;      color: #ff0000;      margin-left: 5mm; @@ -1208,7 +1225,7 @@ module SiSU_XHTML_EPUB2_Format      margin-bottom: 20px;      margin-right: 15mm;    } -  h1.ruby, h2.ruby, h3.ruby, h4.ruby, h5.ruby, h6.ruby { +  h1.ruby, h2.ruby, h3.ruby, h4.ruby, h5.ruby, h6.ruby, h7.ruby {      text-align: center;      color: #990000;      margin-left: 5mm; @@ -2043,6 +2060,9 @@ output_epub_cont_seg.close      def seg_heading6        seg_heading_sub('p','bold',@txt)      end +    def seg_heading7 +      seg_heading_sub('p','bold',@txt) +    end      def dl #check :trailer        "<dl><b>#{@txt}</b> #{@trailer}</dl>"      end @@ -2149,6 +2169,9 @@ output_epub_cont_seg.close      def subtoc_lev6        subtoc_lev('h6','subtoc') if @txt      end +    def subtoc_lev7 +      subtoc_lev('h7','subtoc') if @txt +    end      def heading_sub(tag,attrib,txt)        txt=txt.gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ')        %{ @@ -2177,6 +2200,9 @@ output_epub_cont_seg.close      def heading6        heading_sub('p','bold',@txt)      end +    def heading7 +      heading_sub('h7','bold',@txt) +    end      def navigation_heading4        %{<table summary="navigation segment heading 4" width=100% bgcolor="#08163f" border="0">  <tr><td align="center"> @@ -2195,6 +2221,11 @@ output_epub_cont_seg.close    #{@txt}  </p>}      end +    def navigation_heading7 +      %{<p class="bold"> +  #{@txt} +</p>} +    end      def navigation_center        %{<p class="centerbold">#{@txt}</p>}      end @@ -2238,6 +2269,9 @@ output_epub_cont_seg.close      def lev6        lev('h6','toc')      end +    def lev7 +      lev('h7','toc') +    end      def lev0 #docinfo        lev('h0','toc')      end diff --git a/lib/sisu/v6/xhtml_epub2_segments.rb b/lib/sisu/v6/xhtml_epub2_segments.rb index 8f44b3e8..e5e44886 100644 --- a/lib/sisu/v6/xhtml_epub2_segments.rb +++ b/lib/sisu/v6/xhtml_epub2_segments.rb @@ -372,6 +372,8 @@ WOK              sto.seg_heading5            elsif dob.ln==6              sto.seg_heading6 +          elsif dob.ln==7 +            sto.seg_heading7            end          elsif dob.is==:para            if dob.indent \ @@ -486,7 +488,7 @@ WOK            end          end          if dob.is==:heading \ -        and dob.ln.to_s =~/^[56]/ +        and dob.ln.to_s =~/^[5-7]/            case dob.ln            when 5              format_seg=SiSU_XHTML_EPUB2_Format::FormatSeg.new(@md,dob) @@ -494,6 +496,9 @@ WOK            when 6              format_seg=SiSU_XHTML_EPUB2_Format::FormatSeg.new(@md,dob)              subtoc=format_seg.subtoc_lev6 #keep and make available, this is the subtoc +          when 7 +            format_seg=SiSU_XHTML_EPUB2_Format::FormatSeg.new(@md,dob) +            subtoc=format_seg.subtoc_lev7 #keep and make available, this is the subtoc            end            @@seg_subtoc_array << subtoc          end diff --git a/lib/sisu/v6/xml_dom.rb b/lib/sisu/v6/xml_dom.rb index a3a64946..1285a1cc 100644 --- a/lib/sisu/v6/xml_dom.rb +++ b/lib/sisu/v6/xml_dom.rb @@ -226,12 +226,15 @@ WOK  WOK          if lv==4            @copen[1]=true -          @copen[2]=@copen[3]=false +          @copen[2]=@copen[3]=@copen[4]=false          elsif lv==5            @copen[2]=true -          @copen[3]=false +          @copen[3]=@copen[4]=false          elsif lv==6            @copen[3]=true +          @copen[4]=false +        elsif lv==7 +          @copen[4]=true          end        end        def xml_structure(dob,type='norm') @@ -259,21 +262,24 @@ WOK              @cont[2]=false if @cont[2]              @cont[3]=false if @cont[3]              ####### attempt to close contents -            if @copen[3] # 6~ +            if @copen[4] # 4~ +              [4,3,2,1].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" } +              @copen[1]=@copen[2]=@copen[3]=@copen[4]=false +            elsif @copen[3] # 3~                [3,2,1].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" }                @copen[1]=@copen[2]=@copen[3]=false -            elsif @copen[2] # 5~ +            elsif @copen[2] # 2~                [2,1].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" }                @copen[1]=@copen[2]=@copen[3]=false -            elsif @copen[1] # 4~ +            elsif @copen[1] # 1~                [1].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" }                @copen[1]=@copen[2]=@copen[3]=false              end              @@xml[:body] << "#{Ax[:tab]*y}</heading#{x}>" if @level[x]              @level[x]=false            end -        when 4..6 -          6.downto(lv) do |x| +        when 4..7 +          7.downto(lv) do |x|              if @level[x]==true                @xml_contents_close[x]=''              end @@ -284,42 +290,61 @@ WOK            case lv            when 4              @@xml[:body] << "#{Ax[:tab]*5}</content>" if @cont[1] -            if @copen[3]==true # 6~ +            if @copen[4]==true # 4~ +              [4,3,2,1].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" } +            elsif @copen[3]==true # 3~                [3,2,1].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" } -            elsif @copen[2]==true # 5~ +            elsif @copen[2]==true # 2~                [2,1].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" } -            elsif @copen[1]==true # 4~ +            elsif @copen[1]==true # 1~                [1].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" }              end              @cont[1]=true            when 5 -            if @cont[2] \ +            if @cont[3] \ +            or @cont[2] \              or @cont[1]                @@xml[:body] << "#{Ax[:tab]*5}</content>"              end -            if @copen[3]==true  #6~ +            if @copen[4]==true  #4~ +              [4,3,2].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" } +            elsif @copen[3]==true  #3~                [3,2].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" } -            elsif @copen[2]==true #5~ +            elsif @copen[2]==true #2~                [2].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" }              end              @cont[2]=true            when 6 -            if @cont[3] \ +            if @cont[4] \ +            or @cont[3] \              or @cont[2] \              or @cont[1]                @@xml[:body] << "#{Ax[:tab]*5}</content>"              end -            if @copen[3] #6{ +            if @copen[4] #4~ +              [4,3].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" } +            elsif @copen[3] #3~                [3].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" }              end              @cont[3]=true +          when 7 +            if @cont[4] \ +            or @cont[3] \ +            or @cont[2] \ +            or @cont[1] +              @@xml[:body] << "#{Ax[:tab]*5}</content>" +            end +            if @copen[4] #4~ +              [4].each { |v| @@xml[:body] << "#{Ax[:tab]*n}</contents#{v}>" } +            end +            @cont[4]=true            end          end          xml_el ||=''          xml_element(dob,xml_el,xml_content,type)          if lv            @level[lv]=true -          ((lv+1)..6).each { |x| @level[x]=false } +          ((lv+1)..7).each { |x| @level[x]=false }          end        end        def add_to_body(dob,type='norm') @@ -367,8 +392,8 @@ WOK          @level,@cont,@copen,@xml_contents_close=[],[],[],[]          @rcdc=false          type='norm' -        (0..6).each { |x| @cont[x]=@level[x]=false } -        (4..6).each { |x| @xml_contents_close[x]='' } +        (0..7).each { |x| @cont[x]=@level[x]=false } +        (4..7).each { |x| @xml_contents_close[x]='' }          xml_head          data.each do |dob|            @trans.char_enc.utf8(dob) if @sys.locale =~/utf-?8/i #% utf8 @@ -420,6 +445,10 @@ WOK                      type="heading_content_#{dob.lv}"                      xml_structure(dob,type)                      dob.obj=x.heading_body6 +                  elsif dob.ln==7 +                    type="heading_content_#{dob.lv}" +                    xml_structure(dob,type) +                    dob.obj=x.heading_body7                    end                  else                    dob.ocn @@ -486,7 +515,7 @@ WOK            end          end          @content_flag=true -        6.downto(4) do |x| +        7.downto(4) do |x|            y=x - 1; v=x - 3            if @level[x]==true #2004w36 bug fix? watch/test previous logic broke on free.for.all @coontent_flag introduced              if @content_flag==true diff --git a/lib/sisu/v6/xml_format.rb b/lib/sisu/v6/xml_format.rb index 70c1a27f..38cc7f85 100644 --- a/lib/sisu/v6/xml_format.rb +++ b/lib/sisu/v6/xml_format.rb @@ -1115,6 +1115,9 @@ WOK      def heading_body6        heading_normal('h6','norm')      end +    def heading_body7 +      heading_normal('h7','norm') +    end      def title_header(tag,attrib)        %{  <div class="content"> @@ -1291,6 +1294,9 @@ WOK      def subtoc_lev6        subtoc_lev('h6','subtoc') if @txt      end +    def subtoc_lev7 +      subtoc_lev('h7','subtoc') if @txt +    end      #% para sisu      def header_sub(tag,attrib)        @txt=@txt.gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ') @@ -1303,12 +1309,6 @@ WOK  </div>  }      end -    def header5 -      header_sub('p','bold') -    end -    def header6 -      header_sub('p','bold') -    end      def header4        %{  <div class="substance"> @@ -1320,6 +1320,15 @@ WOK  </div>  }      end +    def header5 +      header_sub('p','bold') +    end +    def header6 +      header_sub('p','bold') +    end +    def header7 +      header_sub('p','bold') +    end      def navigation_header4        %{<table summary="navigation segment header 4" width=100% bgcolor="#08163f" border="0">  <tr><td align="center"> @@ -1338,6 +1347,11 @@ WOK    #{@txt}  </p>}      end +    def navigation_header7 +      %{<p class="bold"> +  #{@txt} +</p>} +    end      def navigation_center        "<center>#{@txt}</center>"      end @@ -1381,6 +1395,10 @@ WOK      def lev6        lev('h6','toc')      end +    def lev7 +      lev('h7','toc') +      #lev('b','toc') +    end      def lev0 #docinfo        lev('h0','toc')      end @@ -1402,6 +1420,9 @@ WOK      def mini_lev6        lev('h6','minitoc')      end +    def mini_lev7 +      lev('h7','minitoc') +    end      def mini_lev0 #docinfo        lev('h0','minitoc')      end diff --git a/lib/sisu/v6/xml_odf_odt.rb b/lib/sisu/v6/xml_odf_odt.rb index bb69be5d..c5e06109 100644 --- a/lib/sisu/v6/xml_odf_odt.rb +++ b/lib/sisu/v6/xml_odf_odt.rb @@ -111,7 +111,9 @@ module SiSU_XML_ODF_ODT              SiSU_Screen::Ansi.new(                @opt.act[:color_state][:set],                @opt.fns, -              "file://#{@md.file.output_path.odt.dir}/#{@md.file.base_filename.odt}" +              'file://' \ +              + @md.file.output_path.odt.dir + '/' \ +              + @md.file.base_filename.odt              ).flow            end          end @@ -173,16 +175,19 @@ module SiSU_XML_ODF_ODT                if x =~/\S+/ then @n << x                end              end -          else              @n << n +          else                  @n << n            end          end        end        def odf_book_idx        if @md.book_idx -        idx_arr,idx_raw=[],SiSU_Particulars::CombinedSingleton.instance.get_idx_raw(@md.opt).raw_idx +        idx_arr=[] +        idx_raw=SiSU_Particulars::CombinedSingleton. +          instance.get_idx_raw(@md.opt).raw_idx          idx_raw.each do |x|            x=if x.is_a?(String) -            SiSU_XML_ODF_ODT_Format::FormatBookIndex.new(x).book_idx_bookmark +            SiSU_XML_ODF_ODT_Format::FormatBookIndex.new(x). +              book_idx_bookmark            else nil            end            idx_arr << x.strip if x.is_a?(String) @@ -191,7 +196,8 @@ module SiSU_XML_ODF_ODT        end        end        def odf_metadata -        @@odf[:metadata]=SiSU_Metadata::Summary.new(@md).odf.metadata +        @@odf[:metadata]=SiSU_Metadata::Summary.new(@md). +          odf.metadata        end        def odf_tail          manifest="#{@md.file.output_path.manifest.url}/#{@md.file.base_filename.manifest}" @@ -224,19 +230,22 @@ module SiSU_XML_ODF_ODT          @@docstart=false          if dob.use_ != :dummy            dob.tmp=dob.obj -          dob.obj=%{#{breakpage}<text:h text:style-name="H_#{dob.ln}" text:outline-level="#{dob.ln}">#{p_num[:set_ref]}#{set_bookmark_tag(dob)}#{dob.obj}#{p_num[:display]}</text:h>} +          dob.obj=%{#{breakpage}<text:h text:style-name="H_#{dob.ln}" text:outline-level="#{dob.ln}">} \ +          + %{#{p_num[:set_ref]}#{set_bookmark_tag(dob)}#{dob.obj}#{p_num[:display]}</text:h>}          else dob.tmp,dob.obj='',''          end          dob        end        def toc(dob,p_num) -        hardspace=(dob.lv =~/[A-C]/i) \ +        hardspace=(dob.lv =~/[A-D]/i) \          ? '<text:p text:style-name="Standard"/>'          : ''          toc_heading=dob.ocn \ -        ? %{<text:bookmark-ref text:reference-format="text" text:ref-name="#{dob.ocn}">#{dob.tmp}</text:bookmark-ref>} +        ? (%{<text:bookmark-ref text:reference-format="text" text:ref-name="#{dob.ocn}">} \ +          + %{#{dob.tmp}</text:bookmark-ref>})          : dob.tmp -        dob.obj=%{<text:h text:style-name="H_#{dob.ln}" text:outline-level="#{dob.ln}">#{toc_heading}</text:h>#{hardspace}} +        dob.obj=%{<text:h text:style-name="H_#{dob.ln}" text:outline-level="#{dob.ln}">} \ +        + %{#{toc_heading}</text:h>#{hardspace}}          dob        end        def image_src(i) @@ -253,7 +262,9 @@ module SiSU_XML_ODF_ODT                @md.opt.act[:color_state][:set],                "ERROR - image:",                %{"#{i}" missing}, -              "search locations: #{@env.path.image_source_include_local},#{@env.path.image_source_include_remote} and #{@env.path.image_source_include}" +              "search locations: #{@env.path.image_source_include_local}," \ +              + "#{@env.path.image_source_include_remote} and" \ +              + "#{@env.path.image_source_include}"              ).error2 unless @md.opt.act[:quiet][:set]==:on              nil            end @@ -271,7 +282,9 @@ module SiSU_XML_ODF_ODT              @md.opt.act[:color_state][:set],              "ERROR - image:",                %{"#{i}" missing}, -              "search locations: #{@env.path.image_source_include_local},#{@env.path.image_source_include_remote} and #{@env.path.image_source_include}" +              "search locations: #{@env.path.image_source_include_local}," \ +              + "#{@env.path.image_source_include_remote} and" \ +              + "#{@env.path.image_source_include}"            ).error2 unless @md.opt.act[:quiet][:set]==:on            nil          end @@ -280,8 +293,10 @@ module SiSU_XML_ODF_ODT          # copy image to od image directory (unless exists)          # divide pixel dimension by 37.79485 and retain 3 decimal places          m=img[1] -        i=/^(\S+?\.(?:png|jpg|gif))/.match(m).captures.join if m =~/^(\S+?\.(?:png|jpg|gif))/ -        c=/^\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"/.match(m).captures.join if m =~/^\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"/ +        i=/^(\S+?\.(?:png|jpg|gif))/.match(m).captures.join \ +          if m =~/^(\S+?\.(?:png|jpg|gif))/ +        c=/^\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"/.match(m).captures.join \ +          if m =~/^\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"/          w,h=/\s(\d+)x(\d+)/.match(m).captures if m =~/\s\d+x\d+/          w=(w.to_i/37.79485).to_s          h=(h.to_i/37.79485).to_s @@ -290,7 +305,10 @@ module SiSU_XML_ODF_ODT          image_source=image_src(i)          if image_source            if FileTest.file?("#{image_source}/#{i}") -            FileUtils::cp("#{image_source}/#{i}","#{@env.processing_path.odt}/Pictures/#{i}") +            FileUtils::cp( +              "#{image_source}/#{i}", +              "#{@env.processing_path.odt}/Pictures/#{i}" +            )            else STDERR.puts %{\t*WARN* did not find image - "#{image_source}/#{i}" [#{__FILE__}:#{__LINE__}]}            end          end @@ -325,7 +343,8 @@ module SiSU_XML_ODF_ODT        def text_link_odf(txt,url,trail)          txt=txt.gsub(/(\\\+)/,'+') #this is convoluted, and risky :-(          url=url.gsub(/(\\\+)/,'+') #this is convoluted, and risky :-( -        map_nametags=SiSU_Particulars::CombinedSingleton.instance.get_map_nametags(@md).nametags_map +        map_nametags=SiSU_Particulars::CombinedSingleton. +          instance.get_map_nametags(@md).nametags_map          t=case url          when /^https?:/            %{<text:a xl:type="simple" xl:href="#{url}">#{txt.strip}</text:a>#{trail}} @@ -342,7 +361,8 @@ module SiSU_XML_ODF_ODT            end            t=map_nametags[url] \            && map_nametags[url][:segname] \ -          ? %{<text:a xl:type="simple" xl:href="#{@env.url.root}/#{@md.fnb}/#{map_nametags[url][:segname]}#{Sfx[:html]}##{url}">#{txt.strip}</text:a>#{trail}} +          ? (%{<text:a xl:type="simple" xl:href="#{@env.url.root}/#{@md.fnb}/#{map_nametags[url][:segname]}#{Sfx[:html]}##{url}">} \ +            + %{#{txt.strip}</text:a>#{trail}})            : %{#{txt.strip}#{trail}}          end          t @@ -359,7 +379,8 @@ module SiSU_XML_ODF_ODT              txt=txt.gsub(/([)(\]\[])/,"\\\\\\1").                gsub(/([+?*])/,"\\\\\\1") # problems with +              url=url.gsub(/([+?])/,"\\\\\\1") # problems with + -            dob.obj=dob.obj.gsub(/#{Mx[:lnk_o]}[ ]*#{txt}#{Mx[:lnk_c]}#{Mx[:url_o]}#{url}#{Mx[:url_c]}/m,text_link_odf(txt,url,trail)). #make sure trailing ']' are not caught in url +            dob.obj=dob.obj.gsub(/#{Mx[:lnk_o]}[ ]*#{txt}#{Mx[:lnk_c]}#{Mx[:url_o]}#{url}#{Mx[:url_c]}/m, +                text_link_odf(txt,url,trail)). #make sure trailing ']' are not caught in url                gsub(/\\([)(\]\[?])/,'\1') #clumsy fix            end            m=nil @@ -374,7 +395,8 @@ module SiSU_XML_ODF_ODT              txt=txt.gsub(/([)(\]\[])/,"\\\\\\1").                gsub(/([+?*])/,"\\\\\\1") # problems with +              url=url.gsub(/([+?])/,"\\\\\\1") # problems with + -            dob.obj=dob.obj.gsub(/#{Mx[:lnk_o]}[ ]*#{txt}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{url}#{Mx[:rel_c]}/m,text_link_odf_bookmark(txt,url,trail)). #make sure trailing ']' are not caught in url +            dob.obj=dob.obj.gsub(/#{Mx[:lnk_o]}[ ]*#{txt}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{url}#{Mx[:rel_c]}/m, +                text_link_odf_bookmark(txt,url,trail)). #make sure trailing ']' are not caught in url                gsub(/\\([)(\]\[?])/,'\1') #clumsy fix            end            m=nil @@ -387,7 +409,8 @@ module SiSU_XML_ODF_ODT            m.each do |i|              txt,url,trail=i[1],i[2]              txt=txt.gsub(/([)(\]\[])/,"\\\\\\1") -            dob.obj=dob.obj.gsub(/#{Mx[:lnk_o]}[ ]*#{txt}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{url}#{Mx[:rel_c]}/m,text_link_odf(txt,url,trail)). #make sure trailing ']' are not caught in url +            dob.obj=dob.obj.gsub(/#{Mx[:lnk_o]}[ ]*#{txt}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{url}#{Mx[:rel_c]}/m, +                text_link_odf(txt,url,trail)). #make sure trailing ']' are not caught in url                gsub(/\\([)(\]\[?])/,'\1') #clumsy fix            end            m=nil @@ -431,11 +454,13 @@ module SiSU_XML_ODF_ODT            @astx||=10000            @astxs||=20000            if str =~/#{Mx[:en_a_o]}\d+\s+/ -            str=str.gsub(/#{Mx[:en_a_o]}(\d+)\s+(.+?)#{Mx[:en_a_c]}/,'<text:note text:id="ftn\1" text:note-class="footnote"><text:note-citation>\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>') +            str=str.gsub(/#{Mx[:en_a_o]}(\d+)\s+(.+?)#{Mx[:en_a_c]}/, +              '<text:note text:id="ftn\1" text:note-class="footnote"><text:note-citation>\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>')            end            if str =~/#{Mx[:en_a_o]}([*]+)\s+/              a=$1.gsub(/([*])/,"\\\\\\1") -              str=str.gsub(/#{Mx[:en_a_o]}([*]+)\s+(.+?)#{Mx[:en_a_c]}/,%{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>}) +              str=str.gsub(/#{Mx[:en_a_o]}([*]+)\s+(.+?)#{Mx[:en_a_c]}/, +                %{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>})                @astxs+=1            end            if str=~/#{Mx[:en_a_o]}[*+]+\s/ @@ -444,7 +469,8 @@ module SiSU_XML_ODF_ODT                a=x[0].gsub(/([*+])/,"\\\\\\1")                str=group_clean(str)                str=footnote_urls(str) -              str=str.gsub(/#{Mx[:en_a_o]}(#{a})\s+(.+?)#{Mx[:en_a_c]}/,%{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>}) +              str=str.gsub(/#{Mx[:en_a_o]}(#{a})\s+(.+?)#{Mx[:en_a_c]}/, +                %{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>})                @astx+=1              end            end @@ -454,7 +480,8 @@ module SiSU_XML_ODF_ODT                a=x[0].gsub(/([*+])/,"\\\\\\1")                str=group_clean(str)                str=footnote_urls(str) -              str=str.gsub(/#{Mx[:en_b_o]}(#{a})\s+(.+?)#{Mx[:en_b_c]}/,%{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>}) +              str=str.gsub(/#{Mx[:en_b_o]}(#{a})\s+(.+?)#{Mx[:en_b_c]}/, +                %{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>})                @astx+=1              end            end @@ -495,7 +522,8 @@ module SiSU_XML_ODF_ODT          dob.obj.split(/#{Mx[:br_line]}|#{Mx[:br_nl]}/).each_with_index do |parablock,i|            set_ref=(i==0) ? "#{p_num[:set_ref]}#{set_bookmark_tag(dob)}" : ''            parablock=group_clean(parablock) -          parablock=parablock.gsub(/<text:a xl:type="simple" xl:href="(.+?)">/m,'<text:a xl:type="simple" xl:href="\1">'). +          parablock=parablock.gsub(/<text:a xl:type="simple" xl:href="(.+?)">/m, +              '<text:a xl:type="simple" xl:href="\1">').              gsub(/<(\/text:a)>/,'<\1>').              gsub(/<(text:note text:id=.+?)>/,'<\1>').              gsub(/<(text:p text:style-name="Footnote")>/,'<\1>'). @@ -519,13 +547,15 @@ module SiSU_XML_ODF_ODT          dob.obj.split(/#{Mx[:br_line]}|#{Mx[:br_nl]}/).each_with_index do |parablock,i|            set_ref=(i==0) ? "#{p_num[:set_ref]}#{set_bookmark_tag(dob)}" : ''            parablock=group_clean(parablock) -          parablock=parablock.gsub(/<text:a xl:type="simple" xl:href="(.+?)">/m,'<text:a xl:type="simple" xl:href="\1">'). +          parablock=parablock.gsub(/<text:a xl:type="simple" xl:href="(.+?)">/m, +              '<text:a xl:type="simple" xl:href="\1">').              gsub(/<(\/text:a)>/,'<\1>').              gsub(/<(text:note text:id=.+?)>/,'<\1>').              gsub(/<(text:p text:style-name="Footnote")>/,'<\1>').              gsub(/<(\/?text:(?:note-citation|note-body|note|p))>/,'<\1>')            parablock=footnote(parablock) -          parray << %{<text:p text:style-name="P_group">#{set_ref}#{parablock}</text:p>} if parablock =~/\S+/ +          parray << %{<text:p text:style-name="P_group">#{set_ref}#{parablock}</text:p>} \ +            if parablock =~/\S+/          end          dob.obj=parray.join \          + %{<text:p text:style-name="P_group">#{p_num[:display]}</text:p>} \ @@ -593,7 +623,7 @@ module SiSU_XML_ODF_ODT          if dob.is==:heading            @@odf[:body] << heading(dob,p_num).obj << break_line*2            if SiSU_Env::ProcessingSettings.new(md).build.toc? -            if dob.lv =~/[A-C1]/i +            if dob.lv =~/[A-D1]/i                @@odf[:toc] << toc(dob,p_num).obj              end            end @@ -623,8 +653,8 @@ module SiSU_XML_ODF_ODT          dir.path.odt_bld          @data_mod,@endnotes,@level,@cont,@copen,@odf_contents_close=Array.new(6){[]}          @rcdc=false -        (0..6).each { |x| @cont[x]=@level[x]=false } -        (4..6).each { |x| @odf_contents_close[x]='' } +        (0..7).each { |x| @cont[x]=@level[x]=false } +        (4..7).each { |x| @odf_contents_close[x]='' }          odf_tail #($1,$2)          bullet=image_src('bullet_09.png')          if bullet @@ -668,7 +698,8 @@ module SiSU_XML_ODF_ODT            dob.obj=dob.obj.gsub(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'<del>\1</del>').              gsub(/#{Mx[:fa_insert_o]}(.+?)#{Mx[:fa_insert_c]}/,'<ins>\1</ins>').              gsub(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,'<cite>\1</cite>'). -            gsub(/#{Mx[:tag_o]}\S+?#{Mx[:tag_c]}/,'<text:bookmark-start text:name="\1"/><text:bookmark-end text:name="\1"/>'). #check +            gsub(/#{Mx[:tag_o]}\S+?#{Mx[:tag_c]}/, +              '<text:bookmark-start text:name="\1"/><text:bookmark-end text:name="\1"/>'). #check              gsub(/#{Mx[:mk_o]}#([a-zA-Z]+)#{Mx[:mk_c]}/,'&\1;').              gsub(/#{Mx[:mk_o]}(#[0-9]+)#{Mx[:mk_c]}/,'&\1;').              gsub(/#{Mx[:mk_o]}[~-]##{Mx[:mk_c]}/,'') @@ -706,7 +737,8 @@ module SiSU_XML_ODF_ODT            wordlist=dob.obj.scan(/\S+/)            dob.obj=tidywords(wordlist).join(' ').strip            @rcdc=true if @rcdc==false \ -          and (dob.obj =~/~metadata/ or dob =~/#{Mx[:lv_o]}1:meta#{Mx[:lv_x]}\s*Document Information/) #fix Mx[:lv_o] +          and (dob.obj =~/~metadata/ \ +          or dob =~/#{Mx[:lv_o]}1:meta#{Mx[:lv_x]}\s*Document Information/) #fix Mx[:lv_o]            if dob.is !~/(^#{Rx[:meta]}|#{Mx[:br_eof]}|#{Mx[:br_endnotes]})/ #check              if defined? dob.ocn and dob.ocn =~/\d+/                @p_num=SiSU_XML_ODF_ODT_Format::ParagraphNumber.new(@make,dob.ocn) @@ -835,7 +867,8 @@ WOK          end          od.close          opendoc=@md.file.base_filename.odt #watch where output by language -        FileUtils::mkdir_p(@md.file.output_path.odt.dir) unless FileTest.directory?(@md.file.output_path.odt.dir) +        FileUtils::mkdir_p(@md.file.output_path.odt.dir) \ +          unless FileTest.directory?(@md.file.output_path.odt.dir)          if FileTest.directory?(@env.processing_path.odt) \          and SiSU_Env::SystemCall.new.zip            pwd=Dir.pwd diff --git a/lib/sisu/v6/xml_odf_odt_format.rb b/lib/sisu/v6/xml_odf_odt_format.rb index 68457d00..09c039bc 100644 --- a/lib/sisu/v6/xml_odf_odt_format.rb +++ b/lib/sisu/v6/xml_odf_odt_format.rb @@ -166,6 +166,8 @@ module SiSU_XML_ODF_ODT_Format      end      def heading_body6      end +    def heading_body7 +    end    end    class Table      @@tablehead,@@table_counter=0,0 #reinitialise on new file diff --git a/lib/sisu/v6/xml_sax.rb b/lib/sisu/v6/xml_sax.rb index d90b552b..d595e4a4 100644 --- a/lib/sisu/v6/xml_sax.rb +++ b/lib/sisu/v6/xml_sax.rb @@ -333,8 +333,8 @@ WOK          @endnotes,@level,@cont,@copen,@xml_contents_close=[],[],[],[],[]          @rcdc=false          xml_head -        (0..6).each { |x| @cont[x]=@level[x]=false } -        (4..6).each { |x| @xml_contents_close[x]='' } +        (0..7).each { |x| @cont[x]=@level[x]=false } +        (4..7).each { |x| @xml_contents_close[x]='' }          data.each do |dob|            @trans.char_enc.utf8(dob) if @sys.locale =~/utf-?8/i #% utf8            dob=@trans.markup(dob) @@ -361,6 +361,7 @@ WOK                    when 4 then x.heading_body4                    when 5 then x.heading_body5                    when 6 then x.heading_body6 +                  when 7 then x.heading_body7                    end                  else                    if dob.is==:verse @@ -415,7 +416,7 @@ WOK              dob.obj=dob.obj.gsub(/#{Mx[:pa_o]}:\S+#{Mx[:pa_c]}/,'') if dob.obj            end          end -        6.downto(4) do |x| +        7.downto(4) do |x|            y=x - 1; v=x - 3            @@xml[:body] << "#{Ax[:tab]*5}</content>\n#{Ax[:tab]*y}</contents#{v}>" if @level[x]==true          end @@ -423,7 +424,7 @@ WOK            y=x - 1            @@xml[:body] << "#{Ax[:tab]*y}</heading#{x}>" if @level[x]==true          end -        #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{Ax[:tab]*y}</level #{x}>" if @level[x]==true } +        #7.downto(1) { |x| y=x - 1; @@xml[:body] << "#{Ax[:tab]*y}</level #{x}>" if @level[x]==true }        end        def pre          rdf=SiSU_XML_Tags::RDF.new(@md) | 
