diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v3dv/concordance.rb | 17 | ||||
-rw-r--r-- | lib/sisu/v3dv/css.rb | 16 | ||||
-rw-r--r-- | lib/sisu/v3dv/epub.rb | 58 | ||||
-rw-r--r-- | lib/sisu/v3dv/epub_format.rb | 142 | ||||
-rw-r--r-- | lib/sisu/v3dv/epub_segments.rb | 20 | ||||
-rw-r--r-- | lib/sisu/v3dv/html.rb | 8 | ||||
-rw-r--r-- | lib/sisu/v3dv/html_format.rb | 91 | ||||
-rw-r--r-- | lib/sisu/v3dv/html_promo.rb | 21 | ||||
-rw-r--r-- | lib/sisu/v3dv/html_segments.rb | 63 | ||||
-rw-r--r-- | lib/sisu/v3dv/manifest.rb | 22 | ||||
-rw-r--r-- | lib/sisu/v3dv/shared_images.rb | 7 | ||||
-rw-r--r-- | lib/sisu/v3dv/texpdf.rb | 37 | ||||
-rw-r--r-- | lib/sisu/v3dv/texpdf_format.rb | 6 | ||||
-rw-r--r-- | lib/sisu/v3dv/xml_format.rb | 31 |
14 files changed, 228 insertions, 311 deletions
diff --git a/lib/sisu/v3dv/concordance.rb b/lib/sisu/v3dv/concordance.rb index 7ec234bc..3d8ab38a 100644 --- a/lib/sisu/v3dv/concordance.rb +++ b/lib/sisu/v3dv/concordance.rb @@ -122,7 +122,18 @@ WOK head_banner=SiSU_HTML_Format::HeadToc.new(@md) minitoc=SiSU_HTML_MiniToc::TocMini.new(@md,@data).songsheet.join("\n") stylesheet=SiSU_Style::CSS_HeadInfo.new(@md).stylesheet - toc='<div class="toc">' + minitoc + '</div>' + make=SiSU_Env::ProcessingSettings.new(@md) + if make.build.manifest_minitoc? + toc='<div class="toc">' + minitoc + '</div>' + div_class='content' + else + toc='' + div_class='content0' + end + top_band=if make.build.html_top_band? + head_banner.concordance_navigation_band('pdf') + else '' + end <<WOK <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> @@ -141,9 +152,9 @@ WOK </head> <body> #{@vz.js_top} - #{head_banner.concordance_navigation_band('pdf')} + #{top_band} #{toc} -<div class="content"> +<div class="#{div_class}"> #{@doc_details} <p>Word index links are to html versions of the text the segmented version followed by the scroll (single document) version.<br />[For segmented text references [T1], [T2] or [T3] appearing without a link, indicates that the word appears in a title (or subtitle) of the text (that is identifiable by the appended object citation number).]</p> <p>(The word listing/index is Case sensitive: Capitalized words appear before lower case)</p> diff --git a/lib/sisu/v3dv/css.rb b/lib/sisu/v3dv/css.rb index cdcd16cd..cbbd05ca 100644 --- a/lib/sisu/v3dv/css.rb +++ b/lib/sisu/v3dv/css.rb @@ -64,7 +64,7 @@ module SiSU_Style @md,@ft=md,ft @env=SiSU_Env::InfoEnv.new('',md) @fn_css ||=SiSU_Env::CSS_Default.new - @o_str ||=SiSU_Env::OutputStructure.new(md).output_dir_structure + @o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure css_copy end def stylesheet @@ -107,12 +107,12 @@ module SiSU_Style end def css_head (css_embed?) \ - ? css_action\ + ? css_action : "#{css_path.html}#{css_path.html_seg}" end def css_head_seg (css_embed?) \ - ? css_action \ + ? css_action : css_path.html_seg end def css_head_xml @@ -1534,12 +1534,12 @@ WOK padding-left: 1em; padding-right: 1em; } -/* - div.content { - margin-left: 1em; - margin-right: 1em; + div.content0, div.main_column0 { + margin: 0; + padding: 0; + border-left: 0% solid #ffffff; + padding-left: 5%; } -*/ div.scroll { margin: 0; padding: 0; diff --git a/lib/sisu/v3dv/epub.rb b/lib/sisu/v3dv/epub.rb index 7d90883b..e9aeb4de 100644 --- a/lib/sisu/v3dv/epub.rb +++ b/lib/sisu/v3dv/epub.rb @@ -192,6 +192,7 @@ module SiSU_EPUB @vz=SiSU_Env::GetInit.instance.skin @epub=SiSU_EPUB_Format::HeadInformation.new(@md) @tell=SiSU_Screen::Ansi.new(@md.opt.cmd) if @md + @make=SiSU_Env::ProcessingSettings.new(@md) end def songsheet #extracts toc for scroll & seg SiSU_Screen::Ansi.new(@md.opt.cmd,'Toc').txt_grey if @md.opt.cmd =~/[MVv]/ @@ -211,8 +212,10 @@ module SiSU_EPUB @@toc[:seg] << %{<div class="content">\n<div class="substance">} @@toc[:scr] << %{<div class="content">\n<div class="substance">} md_opf_a_content << @epub.metadata_opf.manifest_content_sisu_toc - md_opf_a_spine << @epub.metadata_opf.spine_sisu_toc - md_opf_a_guide << @epub.metadata_opf.guide_sisu_toc + if @make.build.toc? + md_opf_a_spine << @epub.metadata_opf.spine_sisu_toc + md_opf_a_guide << @epub.metadata_opf.guide_sisu_toc + end @ncxo=[nil,false,false,false,false,false,false] @dob_toc2,@dob_toc3=nil,nil @ncx_cls=[] @@ -234,7 +237,8 @@ module SiSU_EPUB @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4]=true,false,false,false @epub.sections(dob_toc,name_s_a) @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,name_s_a) if dob_toc - if @level_a_first_occurrence + if @level_a_first_occurrence \ + && @make.build.toc? @nav_no+=1 @@toc[:ncx] << @epub.toc_ncx.navmap_sisu_toc(@nav_no) #epub ncx navmap, toc @level_a_first_occurrence=false @@ -298,7 +302,6 @@ module SiSU_EPUB begin @@toc[:seg] << toc[:seg] @@toc[:scr] << toc[:seg] - @@toc[:seg_mini] << toc[:seg_mini] if toc[:seg_mini] rescue; SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error end end @@ -323,10 +326,6 @@ module SiSU_EPUB @md.firstseg=@@firstseg @@toc end - def minitoc - minitoc=@@toc[:seg_mini].join("\n") - '<div class="toc">' + minitoc + '</div>' - end protected def level_1 dob=@data @@ -348,14 +347,6 @@ module SiSU_EPUB format_toc.lev0 else format_toc.lev1 end - toc[:seg_mini]=if dob.name =~/^meta/ \ - and dob.obj =~/Document Information/ #check - x=if @md.concord_make - format_toc.mini_concord_tail - else format_toc.mini_tail - end - else format_toc.mini_lev1 - end title=if dob.ocn ==0 if dob.name =~/^meta/ \ and dob.obj =~/Document Information/ @@ -389,7 +380,6 @@ module SiSU_EPUB format_toc=SiSU_EPUB_Format::FormatToc.new(@md,txt_obj) toc={} toc[:seg]=format_toc.lev2 - toc[:seg_mini]=format_toc.mini_lev2 if p_num title=%{#{p_num.goto}#{linkname}</a>} txt_obj={ txt: title } @@ -409,7 +399,6 @@ module SiSU_EPUB format_toc=SiSU_EPUB_Format::FormatToc.new(@md,txt_obj) toc={} toc[:seg]=format_toc.lev3 - toc[:seg_mini]=format_toc.mini_lev3 if p_num title=%{#{p_num.goto}#{linkname}</a>} txt_obj={ txt: title } @@ -437,7 +426,6 @@ module SiSU_EPUB format_toc=SiSU_EPUB_Format::FormatToc.new(@md,txt_obj) toc={} toc[:seg]=format_toc.lev4 - toc[:seg_mini]=format_toc.mini_lev4 title=%{#{p_num.goto}#{linkname}</a>} if p_num txt_obj={ txt: title } format_toc=SiSU_EPUB_Format::FormatToc.new(@md,txt_obj) @@ -457,7 +445,6 @@ module SiSU_EPUB txt_obj={ txt: lnk_n_txt } format_toc=SiSU_EPUB_Format::FormatToc.new(@md,txt_obj) toc[:seg]=format_toc.lev5 - toc[:seg_mini]=format_toc.mini_lev5 title=%{#{p_num.goto}#{linkname}</a>} txt_obj={ txt: title } format_toc=SiSU_EPUB_Format::FormatToc.new(@md,txt_obj) @@ -478,7 +465,6 @@ module SiSU_EPUB txt_obj={ txt: lnk_n_txt } format_toc=SiSU_EPUB_Format::FormatToc.new(@md,txt_obj) toc[:seg]=format_toc.lev6 - toc[:seg_mini]=format_toc.mini_lev6 title=%{#{p_num.goto}#{linkname}</a>} txt_obj={ txt: title } format_toc=SiSU_EPUB_Format::FormatToc.new(@md,txt_obj) @@ -582,7 +568,8 @@ module SiSU_EPUB @md,@output=md,output @epub_doc="#{@md.fnb}.epub" @epub_header=SiSU_EPUB_Format::HeadInformation.new(@md) - @make=SiSU_Env::CreateFile.new(@md.fns) + @make=SiSU_Env::ProcessingSettings.new(@md) + @make_file=SiSU_Env::CreateFile.new(@md.fns) end def songsheet mimetype @@ -593,23 +580,23 @@ module SiSU_EPUB output_zip end def mimetype - out=@make.epub.mimetype + out=@make_file.epub.mimetype out<<@epub_header.mimetype out.close end def metainf_container #container.xml file in META-INF directory - out=@make.epub.metainf_cont + out=@make_file.epub.metainf_cont out<<@epub_header.metainf_container out.close end def css - out=@make.epub.xhtml_css + out=@make_file.epub.xhtml_css out << SiSU_EPUB_Format::CSS.new.css_epub_xhtml out.close end def epub_toc_ncx begin - out=@make.epub.toc_ncx + out=@make_file.epub.toc_ncx @output.each do |para| unless para =~/\A\s*\Z/ out.puts para @@ -621,7 +608,7 @@ module SiSU_EPUB end def epub_metadata_opf begin - out=@make.epub.metadata + out=@make_file.epub.metadata @output.each do |para| unless para =~/\A\s*\Z/ out.puts para @@ -663,17 +650,16 @@ module SiSU_EPUB end def segtoc begin - filename_html_segtoc=@make.epub.xhtml_segtoc - filename_html_index=@make.epub.xhtml_index - @output.each do |para| - para=para.strip - unless para =~/\A\s*\Z/ - filename_html_segtoc.puts para,"\n" - filename_html_index.puts para,"\n" + if @make.build.toc? + filename_html_index=@make_file.epub.xhtml_index + @output.each do |para| + para=para.strip + unless para =~/\A\s*\Z/ + filename_html_index.puts para,"\n" + end end + filename_html_index.close end - filename_html_segtoc.close - filename_html_index.close rescue; SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error end end diff --git a/lib/sisu/v3dv/epub_format.rb b/lib/sisu/v3dv/epub_format.rb index f88b6745..e11f5d3d 100644 --- a/lib/sisu/v3dv/epub_format.rb +++ b/lib/sisu/v3dv/epub_format.rb @@ -63,26 +63,22 @@ module SiSU_EPUB_Format @md,@ocn=md,ocn.to_s @ocn ||='' vz=SiSU_Env::GetInit.instance.skin - @skin_no_ocn=if defined? vz.ocn_display_off \ - and vz.ocn_display_off==true - true - else false - end end def ocn_display - if @md.markup.inspect =~/no_ocn/ \ - or @md.opt.mod.inspect =~/--no-ocn/ \ - or @skin_no_ocn - ocn_class='ocn_off' - @ocn.gsub(/^(\d+|)$/, - %{<label class="#{ocn_class}"> </label>}) - elsif @ocn.to_i==0 - @ocn.gsub(/^(\d+|)$/, - %{<label class="#{ocn_class}"> </label>}) - else + @make=SiSU_Env::ProcessingSettings.new(@md) + if @make.build.ocn? ocn_class='ocn' + if @ocn.to_i==0 + @ocn.gsub(/^(\d+|)$/, + %{<label class="#{ocn_class}"> </label>}) + else + @ocn.gsub(/^(\d+|)$/, + %{<label class="#{ocn_class}"><a href="#o\\1" class="lnk#{ocn_class}">\\1</a></label>}) + end + else + ocn_class='ocn_off' @ocn.gsub(/^(\d+|)$/, - %{<label class="#{ocn_class}"><a href="#o\\1" class="lnk#{ocn_class}">\\1</a></label>}) + %{<label class="#{ocn_class}"> </label>}) end end def name @@ -1198,36 +1194,6 @@ module SiSU_EPUB_Format background-color: #f9f9aa; } - .minitoc { - font-weight: normal; - margin-top: 2px; - margin-bottom: 2px; - } - h1.minitoc, h2.minitoc, h3.minitoc { - margin-left: 0em; - font-weight: bold; - text-align: left; - font-size: 90%; - margin-top: 4px; - margin-bottom: 4px; - } - h4.minitoc { - margin-left: 0em; - font-size: 90%; - } - h5.minitoc { - margin-left: 1em; - font-size: 85%; - } - h6.minitoc { - margin-left: 2em; - font-size: 85%; - } - h0.minitoc { - margin-left: 0em; - font-size: 90%; - } - h1.c, h2.c, h3.c, h4.c, h5.c, h6.c, p.c { text-align: center } @@ -2123,52 +2089,6 @@ WOK def initialize(md,txt) super(md,txt) end - def navigation_toc_lev1_advert - %{#{@banner.home_button}\n -<p class="center"> -#{@txt} -#{@two} -</a></p>} - end - def navigation_toc_lev1 - %{#{@banner.nav_toc}} - end - def navigation_toc_lev2 #change bold use css - %{<table summary="navigation segment level 2"> -<tr><td width ="20"> -</td> -<td> - <font size="3" #{@vz.font_face}> - <b>#{@txt}</b> - </font> - </p> -#{@vz.table_close}} - end - def navigation_toc_lev3 #change bold use css - %{<table summary="navigation segment level 3"> -<tr><td width ="20"> -</td> -<td> - <font size="3" #{@vz.font_face}> - <b>#{@txt}</b> - </font> - </p> -#{@vz.table_close}} - end - def navigation_toc_lev4 - %{<table summary="navigation segment level 4"> -<tr><td width ="80"> -</td> -<td> -<p> - #{@txt} -</p> -#{@vz.table_close}} - end - def navigation_toc_lev5 - end - def navigation_toc_lev6 - 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 %{ @@ -2298,44 +2218,6 @@ WOK def lev0 #docinfo lev('h0','toc') end - def mini_lev1 - lev('h1','minitoc') - end - def mini_lev2 - lev('h2','minitoc') - end - def mini_lev3 - lev('h3','minitoc') - end - def mini_lev4 - lev('h4','minitoc') - end - def mini_lev5 - lev('h5','minitoc') - end - def mini_lev6 - lev('h6','minitoc') - end - def mini_lev0 #docinfo - lev('h0','minitoc') - end - def mini_tail - %{ - <h4 class="minitoc"> - <a href="sisu_manifest.html">Manifest (alternative outputs)</a> - </h4> -} - end - def mini_concord_tail - %{ - <h4 class="minitoc"> - <a href="concordance.html">Concordance (wordlist)</a> - </h4> - <h4 class="minitoc"> - <a href="sisu_manifest.html">Manifest (alternative outputs)</a> - </h4> -} - end end end __END__ diff --git a/lib/sisu/v3dv/epub_segments.rb b/lib/sisu/v3dv/epub_segments.rb index 96abfdc0..262fde3c 100644 --- a/lib/sisu/v3dv/epub_segments.rb +++ b/lib/sisu/v3dv/epub_segments.rb @@ -61,8 +61,8 @@ module SiSU_EPUB_Seg require_relative 'epub' # epub.rb require_relative 'shared_metadata' # shared_metadata.rb class Output - def initialize(md,outputfile,seg,minitoc,type='') - @md,@output_epub_cont_seg,@seg,@minitoc,@type=md,outputfile,seg,minitoc,type + def initialize(md,outputfile,seg,type='') + @md,@output_epub_cont_seg,@seg,@type=md,outputfile,seg,type end def output #CONSIDER if @seg[:title] =~/\S/ @@ -132,10 +132,10 @@ WOK @vz=SiSU_Env::GetInit.instance.skin @seg_name_xhtml=@@seg_name_xhtml || nil @seg_name_xhtml_tracker=@@tracker || nil + @make=SiSU_Env::ProcessingSettings.new(@md) if @md end def songsheet begin - @minitoc=SiSU_EPUB::Source::Toc.new(@md,@data).minitoc data=get_subtoc_endnotes(@data) data=articles(data) SiSU_EPUB_Seg::Seg.new.cleanup # (((( added )))) @@ -231,15 +231,15 @@ WOK output_epub_cont_seg=File.new(segfilename,'w') if @@seg_name_xhtml[tracking-1] if dob.is==:heading \ or @@seg_name_xhtml[tracking-1] !~/endnotes|book_index|metadata/ - SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,@minitoc).output + SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg).output elsif dob.is==:heading_insert if @@seg_name_xhtml[tracking-1]=='endnotes' - SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,@minitoc,'endnotes').output + SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,'endnotes').output elsif @@seg_name_xhtml[tracking-1]=='book_index' - SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,@minitoc,'idx').output + SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,'idx').output @@seg[:idx]=[] elsif @@seg_name_xhtml[tracking-1]=='metadata' # navigation bug FIX - SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,@minitoc,'metadata').output + SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,'metadata').output else puts "#{__FILE__}::#{__LINE__}" end else puts "#{__FILE__}::#{__LINE__}" @@ -250,7 +250,7 @@ WOK if @@seg_name_xhtml[tracking] =='metadata' segfilename="#{dir_epub_cont}/#{@@seg_name_xhtml[tracking]}#{Sfx[:epub_xhtml]}" output_epub_cont_seg=File.new(segfilename,'w') - SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,@minitoc,'metadata').output + SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,'metadata').output SiSU_EPUB_Seg::Seg.new.reinitialise #BUG navigation bug with items following metadata, and occurring before manifest, this becomes a bug ... work area for book index, FIX end #@output_epub_cont_seg.close #%(((( EOF )))) --> @@ -411,7 +411,9 @@ WOK and dob.ln==4 @@seg[:main] << %{\n<div class="content">\n} @@seg[:main] << dob_xhtml - @@seg[:main] << @@seg_subtoc[@@get_hash_fn] #% insertion of sub-toc + if @make.build.segsubtoc? + @@seg[:main] << @@seg_subtoc[@@get_hash_fn] #% insertion of sub-toc + end else @@seg[:main] << dob_xhtml end diff --git a/lib/sisu/v3dv/html.rb b/lib/sisu/v3dv/html.rb index 75d89382..fee51f2c 100644 --- a/lib/sisu/v3dv/html.rb +++ b/lib/sisu/v3dv/html.rb @@ -510,6 +510,7 @@ WOK def initialize(md='',toc='',links_guide_toc='') @md,@toc,@links_guide_toc=md,toc,links_guide_toc @vz=SiSU_Env::GetInit.instance.skin + @make=SiSU_Env::ProcessingSettings.new(@md) end def in_common toc_shared=[] @@ -566,8 +567,9 @@ WOK if defined? @md.prefix_b toc_shared << prefix_b end - #Table of Contents added/appended here - toc_shared << @toc[:scr] + scr_toc=if @make.build.toc? #Table of Contents added/appended here + toc_shared << @toc[:scr] + end @segtoc << @links_guide_toc @segtoc << @toc[:seg] if defined? @md.rights.all \ @@ -608,7 +610,7 @@ WOK def initialize(data='',md='') @data,@md=data,md @file=SiSU_Env::FileOp.new(md) - @o_str ||=SiSU_Env::OutputStructure.new(md).output_dir_structure + @o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure end def scroll begin diff --git a/lib/sisu/v3dv/html_format.rb b/lib/sisu/v3dv/html_format.rb index d8b44760..56360455 100644 --- a/lib/sisu/v3dv/html_format.rb +++ b/lib/sisu/v3dv/html_format.rb @@ -62,27 +62,22 @@ module SiSU_HTML_Format def initialize(md,ocn) @md,@ocn=md,ocn.to_s @ocn ||='' - vz=SiSU_Env::GetInit.instance.skin - @skin_no_ocn=if defined? vz.ocn_display_off \ - and vz.ocn_display_off==true - true - else false - end end def ocn_display - if @md.markup.inspect =~/no_ocn/ \ - or @md.opt.mod.inspect =~/--no-ocn/ \ - or @skin_no_ocn + @make=SiSU_Env::ProcessingSettings.new(@md) + if @make.build.ocn? + ocn_class='ocn' + if @ocn.to_i==0 + @ocn.gsub(/^(\d+|)$/, + %{<label class="#{ocn_class}"><a name="#{@ocn}"> </a></label>}) + else + @ocn.gsub(/^(\d+|)$/, + %{<label class="#{ocn_class}"><a name="#{@ocn}" href="##{@ocn}" class="lnk#{ocn_class}">\\1</a></label>}) + end + else ocn_class='ocn_off' @ocn.gsub(/^(\d+|)$/, %{<label class="#{ocn_class}"> </label>}) - elsif @ocn.to_i==0 - @ocn.gsub(/^(\d+|)$/, - %{<label class="#{ocn_class}"><a name="#{@ocn}"> </a></label>}) - else - ocn_class='ocn' - @ocn.gsub(/^(\d+|)$/, - %{<label class="#{ocn_class}"><a name="#{@ocn}" href="##{@ocn}" class="lnk#{ocn_class}">\\1</a></label>}) end end def name @@ -109,7 +104,7 @@ module SiSU_HTML_Format @metalink='#metadata' @tocband_scroll,@tocband_segtoc=nil,nil @stylesheet=SiSU_Style::CSS_HeadInfo.new(md).stylesheet - @o_str ||=SiSU_Env::OutputStructure.new(md).output_dir_structure + @o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure @index='index' @toc="#{@md.file.output_path.html_seg.dir}/#{@md.file.base_filename.html_segtoc}" end @@ -206,7 +201,8 @@ module SiSU_HTML_Format @cf_defaults=SiSU_Env::InfoProcessingFlag.new @env=SiSU_Env::InfoEnv.new(md.fns) @file=SiSU_Env::FileOp.new(md) - @o_str ||=SiSU_Env::OutputStructure.new(md).output_dir_structure + @o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure + @make=SiSU_Env::ProcessingSettings.new(@md) end def home %{<td align="center" bgcolor=#{@vz.color_band2}> @@ -234,11 +230,15 @@ module SiSU_HTML_Format } end def search - env=SiSU_Env::InfoEnv.new(@md.fns,@md) - env.widget.search_form('sisusearch',nil,nil,true) + if @make.build.html_search_form? + env=SiSU_Env::InfoEnv.new(@md.fns,@md) + env.widget.search_form('sisusearch',nil,nil,true) + else '' + end end def manifest - if not @o_str.dump_or_redirect? + if @make.build.links_to_manifest? \ + and not @o_str.dump_or_redirect? manifest_lnk=if @file.output_dir_structure.by_language_code? \ or @file.output_dir_structure.by_filetype? "#{Xx[:html_relative1]}manifest/#{@file.base_filename.manifest}" @@ -321,28 +321,30 @@ module SiSU_HTML_Format def initialize(md) super(md) @md=md - @o_str ||=SiSU_Env::OutputStructure.new(md).output_dir_structure + @o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure + @make=SiSU_Env::ProcessingSettings.new(@md) end def scroll_head_navigation_band - pdf=if @md.programs[:pdf] - <<WOK + if @make.build.html_top_band? + search_and_manifest=<<WOK <td align="center" width="60%"> - #{make_seg_scroll_pdf} + #{make_scroll_search_form_and_manifest_link} </td> WOK - else '' - end - %{<table summary="table of contents scroll navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}> + %{<table summary="table of contents scroll navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}> <tr><td width="20%"> #{@vz.banner_band} -</td>#{pdf} +</td>#{search_and_manifest} <td width="20%"> #{@vz.table_close} <p />} + else '' + end end def concordance_navigation_band(type='') - %{<table summary="concordance navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}> + if @make.build.html_top_band? + %{<table summary="concordance navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}> <tr><td width="20%"> #{@vz.banner_band} </td> @@ -352,6 +354,8 @@ WOK </a> #{@vz.table_close} <p />} + else '' + end end def seg_head_navigation_band(type='') firstseg=%{<a href="#{@md.firstseg}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top" alt="->"> @@ -369,25 +373,6 @@ WOK #{@vz.table_close} <p />} end - def seg_head_navigation_band_bottom(type='') #retired 2.7.9 - if type=~/pdf/ - @tocband_segtoc=make_scroll_seg_pdf - end - firstseg=%{<a href="#{@md.firstseg}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top" alt="->"> - #{png_nav.nxt} - </a>} if @md.firstseg =~/\S+/ - %{<table summary="table of contents segment navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}> -<tr><td width="20%"> - -</td> -<td width="75%" align="center"> - #{@tocband_segtoc} -</td> -<td width="5%" align="right"> - #{firstseg} -#{@vz.table_close} -<p />} - end def manifest_link(text) # @file=SiSU_Env::FileOp.new(@md) if @md %{<font size=2> @@ -404,7 +389,7 @@ WOK else '' end end - def make_seg_scroll_pdf + def make_scroll_search_form_and_manifest_link wgt=SiSU_HTML_Format::Widget.new(@md) scroll=%{<td align="center" bgcolor=#{@vz.color_band2}> #{@vz.nav_txt_doc_link} @@ -992,6 +977,7 @@ WOK end @p_num=ParagraphNumber.new(@md,@ocn) @vz=SiSU_Env::GetInit.instance.skin + @make=SiSU_Env::ProcessingSettings.new(@md) end def nametags_scroll(dob) tags='' @@ -1134,8 +1120,11 @@ WOK heading_normal('h6','norm') end def title_heading(tag,attrib) + cl=(@make.build.html_minitoc?) \ + ? 'content' + : 'content0' %{ -<div class="content"> +<div class="#{cl}"> <#{tag} class="#{attrib}"> #{@named}#{@txt} </#{tag}> diff --git a/lib/sisu/v3dv/html_promo.rb b/lib/sisu/v3dv/html_promo.rb index 7617b52c..f53211e9 100644 --- a/lib/sisu/v3dv/html_promo.rb +++ b/lib/sisu/v3dv/html_promo.rb @@ -67,22 +67,33 @@ module SiSU_HTML_Promo @ad=SiSU_Env::GetInit.instance.ads @vz=SiSU_Env::GetInit.instance.skin @flag=@env.widget.promo? + @make=SiSU_Env::ProcessingSettings.new(@md) end def div def major - @flag[:ad] ? '<div id="pane_major">' : '' + (@make.build.html_right_pane? \ + && @flag[:ad]) \ + ? '<div id="pane_major">' + : '' end def minor - @flag[:ad] ? '<div id="pane_minor">' : '' + (@make.build.html_right_pane? \ + && @flag[:ad]) \ + ? '<div id="pane_minor">' + : '' end def close - @flag[:ad] ? '</div>' : '' + (@make.build.html_right_pane? \ + && @flag[:ad]) \ + ? '</div>' + : '' end self end - def display #(type=nil,id=nil) + def display ads_array,promo_array=[],[] - if @flag[:ad] + if @make.build.html_right_pane? \ + && @flag[:ad] ads=if @md.promo && @md.promo.length > 0 #promo set in document promo_array=@md.promo elsif @flag[:sk] #promo set in associated skin diff --git a/lib/sisu/v3dv/html_segments.rb b/lib/sisu/v3dv/html_segments.rb index b20d2271..b1dbf73f 100644 --- a/lib/sisu/v3dv/html_segments.rb +++ b/lib/sisu/v3dv/html_segments.rb @@ -66,11 +66,19 @@ module SiSU_HTML_Seg @md,@output_seg_file,@seg,@minitoc,@type=md,outputfile,seg,minitoc,type @title_banner_=SiSU_Env::CreateSite.new(@md.opt.cmd).html_seg_title_banner? @file=SiSU_Env::FileOp.new(@md) + @make=SiSU_Env::ProcessingSettings.new(@md) + @cl=(@make.build.html_minitoc?) \ + ? 'content' + : 'content0' end def output if @seg[:title] =~/\S/ filename_seg=[] - filename_seg << @seg[:title] << @seg[:tocband_banner] + if @make.build.html_top_band? + filename_seg << @seg[:title] << @seg[:tocband_banner] + else + filename_seg << @seg[:title] + end if @type=='endnotes' @seg[:headings]=[] format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md) @@ -80,7 +88,7 @@ module SiSU_HTML_Seg 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="content">\n} << @seg[:endnote_all] << '</div>' # << '</div>' + 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) @@ -90,7 +98,7 @@ module SiSU_HTML_Seg 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="content">\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]=[] @@ -101,11 +109,19 @@ module SiSU_HTML_Seg 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="content">\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" + else + 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] else - filename_seg << @minitoc << @seg[:headings] << @seg[:main] << "\n</div>\n" + @seg[:tail] << @seg[:credits] end - filename_seg << @seg[:tail] << @seg[:tocband_bannerless] << @seg[:credits] filename_seg=filename_seg.flatten.compact #watch filename_seg.each do |str| unless str =~/\A\s*\Z/ @@ -138,7 +154,13 @@ module SiSU_HTML_Seg @seg_name_html=@@seg_name_html || nil @seg_name_html_tracker=@@tracker || nil @env=SiSU_Env::InfoEnv.new(@md.fns) if @md - @make=SiSU_Env::InfoSet.new(@md) if @md + if @md + @make=SiSU_Env::ProcessingSettings.new(@md) + @cl=(@make.build.html_minitoc?) \ + ? 'content' + : 'content0' + else @cl='content' + end if @md @title_banner_=SiSU_Env::CreateSite.new(@md.opt.cmd).html_seg_title_banner? end @@ -245,7 +267,7 @@ module SiSU_HTML_Seg SiSU_HTML_Seg::Seg.new(@md).tail segfilename="#{@file.output_path.html_seg.dir}/#{@@seg_name_html[tracking-1]}#{@md.lang_code_insert}#{Sfx[:html]}" output_seg_file=File.new(segfilename,'w') if @@seg_name_html[tracking-1] - minitoc=(@make.html_minitoc?) \ + minitoc=(@make.build.html_minitoc?) \ ? @minitoc : '' if dob.is==:heading \ @@ -306,12 +328,19 @@ module SiSU_HTML_Seg end def heading_art(dob) format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md) - if (dob.is==:heading \ - || dob.is==:heading_insert) \ - && (dob.ln.to_s =~/^[1-6]/) - if @@tracker < @@seg_total-1; @@seg[:dot_nav]=format_head_seg.dot_control_pre_next - else @@seg[:dot_nav]=format_head_seg.dot_control_pre + @@seg[:dot_nav]=if (@make.build.html_navigation?) \ + && (@make.build.html_navigation_bar?) + x=if (dob.is==:heading \ + || dob.is==:heading_insert) \ + && (dob.ln.to_s =~/^[1-6]/) + x=if @@tracker < @@seg_total-1 + format_head_seg.dot_control_pre_next + else + format_head_seg.dot_control_pre + end + else @@seg[:dot_nav] end + else @@seg[:dot_nav]='' end ads=SiSU_HTML_Promo::Ad.new(@md) @@seg[:title]=format_head_seg.head_seg << ads.div.major @@ -458,9 +487,11 @@ module SiSU_HTML_Seg if (dob.is==:heading \ || dob.is==:heading_insert) \ && dob.ln==4 - @@seg[:main] << %{\n<div class="content">\n} + @@seg[:main] << %{\n<div class="#{@cl}">\n} @@seg[:main] << dob_html - @@seg[:main] << @@seg_subtoc[@@get_hash_fn] #% insertion of sub-toc + if @make.build.segsubtoc? + @@seg[:main] << @@seg_subtoc[@@get_hash_fn] #% insertion of sub-toc + end else @@seg[:main] << dob_html #unless @@flag_alt==true end @@ -469,7 +500,7 @@ module SiSU_HTML_Seg def tail format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md) if @md.flag_auto_endnotes and @@seg_endnotes[@@get_hash_fn] - @@seg[:tail] << %{\n<div class="content">\n<div class="endnote">\n} + @@seg[:tail] << %{\n<div class="#{@cl}">\n<div class="endnote">\n} if @@seg_endnotes[@@get_hash_fn].flatten.length > 0 @@seg[:tail] << format_head_seg.endnote_mark @@seg[:tail] << @@seg_endnotes[@@get_hash_fn].flatten #endnotes deposited at end of individual segments ||@|EXTRACTION OF ENDNOTES| diff --git a/lib/sisu/v3dv/manifest.rb b/lib/sisu/v3dv/manifest.rb index 19fdc65c..0eb580b3 100644 --- a/lib/sisu/v3dv/manifest.rb +++ b/lib/sisu/v3dv/manifest.rb @@ -103,10 +103,11 @@ module SiSU_Manifest @manifest={ txt: [], html: [] } @md,@fns=md,md.fns @env=SiSU_Env::InfoEnv.new(@md.fns) + @make=SiSU_Env::ProcessingSettings.new(@md) @fnb=@md.fnb @base_url="#{@env.url.root}/#{@fnb}" @f=SiSU_Env::FileOp.new(@md) - @o_str=SiSU_Env::OutputStructure.new(md).output_dir_structure + @o_str=SiSU_Env::ProcessingSettings.new(md).output_dir_structure @image_path=if @o_str.dump_or_redirect? %{./image} else @@ -395,6 +396,13 @@ module SiSU_Manifest id,file='Manpage',@f.base_filename.manpage summarize(id,file,pth,rel,url) end + if FileTest.file?(@f.place_file.sqlite_discreet.dir)==true + id,file='SQLite3 file',@f.base_filename.sqlite_discreet + pth=@f.output_path.sqlite_discreet.dir + rel=@f.output_path.sqlite_discreet.rel_sm + url=@f.output_path.sqlite_discreet.url + summarize(id,file,pth,rel,url) + end if FileTest.file?(@f.place_file.txt.dir)==true if @md.opt.cmd =~/a/; id='Plaintext (Unix (UTF-8) with footnotes)' elsif @md.opt.cmd =~/e/; id='Plaintext (Unix (UTF-8) with endnotes)' @@ -439,7 +447,7 @@ module SiSU_Manifest def qrc_image fn=@md.fnb pth=(@o_str.dump_or_redirect?) \ - ? '.' \ + ? '.' : 'qrcode' img_md="#{pth}/#{fn}.md.png" img_title="#{pth}/#{fn}.title.png" @@ -758,13 +766,17 @@ WOK minitoc=SiSU_HTML_MiniToc::TocMini.new(@md,data).songsheet.join("\n") id,file='','' vz=SiSU_Env::GetInit.instance.skin + search_form=if @make.build.search_form? + "<td>#{@env.widget_static.search_form}</td>" + else '' + end banner_table=if vz.banner_home_button_only !~ /http:\/\/www\.jus\.uio\.no\/sisu/ \ and vz.banner_home_button_only !~ /sisu\.home\.png/ <<WOK <table summary="band" border="0" cellpadding="3" cellspacing="0"> <tr><td align="left" width="15%" bgcolor="#ffffff">#{vz.banner_band}</td> <td width="70%"><p class="tiny">#{@brace_url.xml_open}<a href="#{@base_url}/#{file}">#{@base_url}/#{file}</a>#{@brace_url.xml_close}</p></td> -<td>#{@env.widget_static.search_form}</td></tr> +#{search_form}</tr> </table> WOK else @@ -772,7 +784,7 @@ WOK <table summary="band" border="0" cellpadding="3" cellspacing="0"> <tr><td align="left" bgcolor="#ffffff"><a href="http://www.jus.uio.no/sisu/" target="_top"><img border="0" src="#{vz.url_path_image_sys}/sisu.png" alt="SiSU -->" /></a></td> <td><p class="tiny">#{@brace_url.xml_open}<a href="#{@base_url}/#{file}">#{@base_url}/#{file}</a>#{@brace_url.xml_close}</p></td> -<td>#{@env.widget_static.search_form}</td></tr> +#{search_form}</tr> </table> WOK end @@ -793,7 +805,7 @@ SiSU manifest: #{@md.title.full} <body bgcolor="#ffffff" text="#000000" link="#003090" lang="en" xml:lang="en"> #{banner_table} WOK - if @env.manifest_minitoc? + if @make.build.manifest_minitoc? if @o_str.dump_or_redirect? elsif @env.output_dir_structure.by_language_code? \ or @env.output_dir_structure.by_filetype? diff --git a/lib/sisu/v3dv/shared_images.rb b/lib/sisu/v3dv/shared_images.rb index a61fdd38..1d398213 100644 --- a/lib/sisu/v3dv/shared_images.rb +++ b/lib/sisu/v3dv/shared_images.rb @@ -56,6 +56,7 @@ ** Description: common file for xml generation =end module SiSU_Images + require_relative 'particulars' # particulars.rb class Source def initialize(opt) @particulars=SiSU_Particulars::CombinedSingleton.instance.get_all(opt) @@ -68,7 +69,7 @@ module SiSU_Images @particulars=particulars @md=@particulars.md @env=@particulars.env - @o_str ||=SiSU_Env::OutputStructure.new(@md).output_dir_structure + @o_str ||=SiSU_Env::ProcessingSettings.new(@md).output_dir_structure end def songsheet images_set.select_sisu_base @@ -97,11 +98,11 @@ module SiSU_Images def dest_path(image_type) pth=if image_type==:image_sys pth=(@o_str.dump_or_redirect?) \ - ? "#{@md.file.output_path.html.dir}/image" \ + ? "#{@md.file.output_path.html.dir}/image" : "#{@env.path.webserv}/_sisu/image_sys" elsif image_type==:image pth=(@o_str.dump_or_redirect?) \ - ? "#{@md.file.output_path.html.dir}/image" \ + ? "#{@md.file.output_path.html.dir}/image" : "#{@env.path.webserv}/_sisu/image" end end diff --git a/lib/sisu/v3dv/texpdf.rb b/lib/sisu/v3dv/texpdf.rb index c69f7b9c..f0fb6b99 100644 --- a/lib/sisu/v3dv/texpdf.rb +++ b/lib/sisu/v3dv/texpdf.rb @@ -285,16 +285,11 @@ module SiSU_TeX @vz=SiSU_Env::GetInit.instance.skin @dp=@@dp ||=SiSU_Env::InfoEnv.new.digest.pattern @brace_url=SiSU_Viz::Skin.new.url_decoration - vz=SiSU_Env::GetInit.instance.skin l=SiSU_Env::StandardiseLanguage.new(@md.opt.lng).language @language=l[:n] @translate=SiSU_Translate::Source.new(@md,@language) - @skin_no_ocn=if defined? vz.ocn_display_off \ - and vz.ocn_display_off==true - true - else false - end @codeblock_box='listings' #alternative 'boites' + @make ||=SiSU_Env::ProcessingSettings.new(@md) end def songsheet begin @@ -324,12 +319,6 @@ module SiSU_TeX if @md.flag_tables #WORK ON 2009 data=tables(data) #uncomment to start experimenting with tables end - ocn=if @md.markup.inspect =~/no_ocn/ \ - or @md.opt.mod.inspect =~/--no-ocn/ \ - or @skin_no_ocn - false - else true - end data=number_paras(data) data=markup(data) output(data) @@ -741,12 +730,20 @@ WOK @tex_file << @@prefix_b if defined? @md.creator.prefix_b and @md.creator.prefix_b end x={} - x[:l] =<<WOK -#{@tex_ml.newpage('landscape')} -\\pagestyle{fancy} + if (@make.build.toc?) + toc=<<WOK \\renewcommand{\\contentsname}{#{@translate.contents}} \\tableofcontents +WOK + toc_pb={ l: @tex_ml.newpage('landscape'), p: @tex_ml.newpage('portrait') } + else + toc='' + toc_pb={ l: '', p: '' } + end + x[:l] =<<WOK #{@tex_ml.newpage('landscape')} +\\pagestyle{fancy} +#{toc}#{toc_pb[:l]} \\pagenumbering{arabic} #{@tex_ml.paraskip_normal} #{@tex_ml.newpage('landscape')} @@ -754,8 +751,7 @@ WOK x[:p] =<<WOK #{@tex_ml.newpage('portrait')} \\pagestyle{fancy} -\\renewcommand{\\contentsname}{#{@translate.contents}} -\\tableofcontents +#{toc}#{toc_pb[:p]} #{@tex_ml.newpage('portrait')} \\pagenumbering{arabic} #{@tex_ml.paraskip_normal} @@ -814,11 +810,7 @@ WOK if dob.of ==:para paranum=dob.ocn ? dob.ocn : '' paranum = '' if paranum.to_i==0 - paranumber_display=if @md.markup.inspect =~/no_ocn/ \ - or @md.opt.mod.inspect =~/--no-ocn/ \ - or not dob.ocn_ - '' - else + paranumber_display=if @make.build.ocn? tags='' #[keep] code that follows inserts "name tags" as hypertargets, currently using ocn (converting nametags to ocn) for internal linking, related code: |texpdf_format.rb|@|uses nametags directly| #if dob.tags.length > 0 # insert tags "hypertargets" @@ -827,6 +819,7 @@ WOK # end #end "\\begin{tiny}\\hspace{0mm}\\end{tiny}{\\marginpar{\\begin{tiny}\\hspace{0mm}\\hypertarget{#{dob.ocn}}{#{dob.ocn}}#{tags}\\end{tiny}}}" #ocn object citation numbering + else '' end dob.tmp = paranumber_display + dob.tmp end diff --git a/lib/sisu/v3dv/texpdf_format.rb b/lib/sisu/v3dv/texpdf_format.rb index fdcdc3d1..ae277ec6 100644 --- a/lib/sisu/v3dv/texpdf_format.rb +++ b/lib/sisu/v3dv/texpdf_format.rb @@ -104,9 +104,13 @@ module SiSU_TeX_Pdf @brace_rel=SiSU_Viz::Skin.new.rel_decoration @env ||=SiSU_Env::InfoEnv.new(@md.fns) @tex2pdf=@@tex3pdf ||=SiSU_Env::SystemCall.new.tex2pdf_engine + @make ||=SiSU_Env::ProcessingSettings.new(@md) end def ocn_display(dob) - "\\begin{tiny}\\hspace{0mm}\\end{tiny}{\\marginpar{\\begin{tiny}\\hspace{0mm}\\hypertarget{#{dob.ocn}}{#{dob.ocn}}\\end{tiny}}}" #ocn object citation numbering + show_ocn=(@make.build.ocn?) \ + ? dob.ocn + : '' + "\\begin{tiny}\\hspace{0mm}\\end{tiny}{\\marginpar{\\begin{tiny}\\hspace{0mm}\\hypertarget{#{dob.ocn}}{#{show_ocn}}\\end{tiny}}}" #ocn object citation numbering end def table_special_characters(r) r=r.gsub(/#{Mx[:tc_p]}|$/u,'&'). diff --git a/lib/sisu/v3dv/xml_format.rb b/lib/sisu/v3dv/xml_format.rb index 0b1e9eef..b40efc18 100644 --- a/lib/sisu/v3dv/xml_format.rb +++ b/lib/sisu/v3dv/xml_format.rb @@ -331,29 +331,22 @@ WOK def initialize(md,ocn) @md,@ocn=md,ocn.to_s @ocn ||='' - vz=SiSU_Env::GetInit.instance.skin - @skin_no_ocn=if not ocn - true - elsif defined? vz.ocn_display_off \ - and vz.ocn_display_off==true - true - else false - end end def ocn_display - if @md.markup.inspect =~/no_ocn/ \ - or @md.opt.mod.inspect =~/--no-ocn/ \ - or @skin_no_ocn - ocn_class='ocn_off' - @ocn.gsub(/^(\d+|)$/, - %{<label class="#{ocn_class}"> </label>}) - elsif @ocn.to_i==0 - @ocn.gsub(/^(\d+|)$/, - %{<label class="#{ocn_class}"><a name="#{@ocn}"> </a></label>}) - else + @make=SiSU_Env::ProcessingSettings.new(@md) + if @make.build.ocn? ocn_class='ocn' + if @ocn.to_i==0 + @ocn.gsub(/^(\d+|)$/, + %{<label class="#{ocn_class}"><a name="#{@ocn}"> </a></label>}) + else + @ocn.gsub(/^(\d+|)$/, + %{<label class="#{ocn_class}"><a name="#{@ocn}">\\1</a></label>}) + end + else + ocn_class='ocn_off' @ocn.gsub(/^(\d+|)$/, - %{<label class="#{ocn_class}"><a name="#{@ocn}">\\1</a></label>}) + %{<label class="#{ocn_class}"> </label>}) end end def name |