diff options
author | Ralph Amissah <ralph@amissah.com> | 2008-08-17 01:18:19 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2008-08-17 01:18:19 -0400 |
commit | 0ec2677657a7199d5210d9e013fe62334c83f71a (patch) | |
tree | 4d0d18c204196427e39640783068569da7b5f1fa /lib/sisu/v0/html_format.rb | |
parent | html segments, links to concordance file only if made, fix (diff) |
html segments structure and info provided (a bit verbose), and css
Diffstat (limited to 'lib/sisu/v0/html_format.rb')
-rw-r--r-- | lib/sisu/v0/html_format.rb | 304 |
1 files changed, 128 insertions, 176 deletions
diff --git a/lib/sisu/v0/html_format.rb b/lib/sisu/v0/html_format.rb index 0bfe580e..4992dc6d 100644 --- a/lib/sisu/v0/html_format.rb +++ b/lib/sisu/v0/html_format.rb @@ -765,7 +765,7 @@ WOK wgt=Widget.new(@md) #dir=SiSU_Env::Info_env.new(@md.fns) x=if @md.concord_make - %{ + %{ <table summary="segment navigation available documents types: toc,doc,pdf,concordance" border="0" cellpadding="3" cellspacing="0"> <tr> #{wgt.seg(@vz.nav_txt_toc_link)} @@ -988,7 +988,9 @@ WOK toc_metadata end def title_banner(title,subtitle,creator) - %{<p class="tiny"> + %{ +<div class="summary"> + <p class="tiny"> #{title} </p> <p class="tiny"> @@ -1002,7 +1004,9 @@ WOK <a href="#{@vz.url_home}"> #{@vz.txt_home} </a> - </p>} + </p> +</div> +} end end class Head_scroll < Head_toc @@ -1055,7 +1059,7 @@ WOK # </h4> ##{@vz.table_close}} # end - def title_endnote + def title_endnote #revisit # %{#{@vz.margin_txt_0} # #{@vz.paragraph_txt} # <a name="endnotes" id="endnotes"></a> @@ -1063,37 +1067,6 @@ WOK # ##{@vz.table_close}} end -# def tail -# %{<br /> -##{@vz.margin_txt_0} -#<table summary="scroll tail" bgcolor="#777777"> -#<tr><td width="20%"> -##{@vz.banner_band} -#</td> -#<td width="60%"> -#<center>#@tocband_scroll</center> -#</td></tr> -#</table> -#<br /> -##{@vz.paragraph_txt} -# <center> -# #{@vz.credits_splash} -# #{@vz.credits_sisu} -# </center> -##{@vz.margin_num} -##{@vz.table_close} -#<a name="bottom id="finish"></a> -#<a name="down" id="down"></a> -#<a name="end" id="end"></a> -#<a name="finish" id="finish"></a> -#<a name="stop" id="stop"></a> -#<a name="credits" id="credits"></a> -#<font color="white" size="0"> -# #{@md.title*10} -#</font> -#</body> -#</html>} -# end end class Format_text_object @vz=SiSU_Env::Get_init.instance.skin @@ -1130,6 +1103,30 @@ WOK end @vz=SiSU_Env::Get_init.instance.skin end + def endnote_body + %{ +<p class="endnote"> + #@one +</p> +} + end + def endnote_body_indent + %{ + <p class="endnote_indent"> + #@one + </p> +} + end + def no_paranum + %{ +<div class="substance"> + <label class="ocn"> </label> + <p class="norm"> + #@one #@two + </p> +</div> +} + end def para_form_css(tag,attrib) # regular paragraphs shaped here ul=ulc='' ul,ulc="<ul>\n ","\n </ul>" if @tag =~/li/ @@ -1157,27 +1154,81 @@ WOK def bullet para_form_css('li','bullet') end - def format(tag,atrib) - para_form_css(tag,atrib) + def format(tag,attrib) + para_form_css(tag,attrib) end - def dl - "<dl><b>#@one</b> #@two</dl>" + + def header_normal(tag,attrib) + %{ +<div class="substance"> + #{@p_num.ocn_display} + <#{tag} class="#{attrib}" #{@p_num.id}>#{@p_num.name} + #@headname + #@parablock + </#{tag}> +</div> +} end - def table_css_end #<!TZ!> - '</table> - </p> - </div>' + def heading_body + header_normal('p','norm') end - def no_paranum + def heading_body1 + header_normal('h1','norm') + end + def heading_body2 + header_normal('h2','norm') + end + def heading_body3 + header_normal('h3','norm') + end + def heading_body4 + header_normal('h4','norm') + end + def heading_body5 + header_normal('h5','norm') + end + def heading_body6 + header_normal('h6','norm') + end + def title_header(tag,attrib) + %{ +<div class="content"> +<#{tag} class="#{attrib}"> + #@one + </#{tag}> +</div> +} + end + def title_header1 + title_header('h1','tiny') + end + def title_header2 + title_header('h2','tiny') + end + def title_header3 + title_header('h3','tiny') + end + def title_header4 + '' + end + def title_header4_old %{ <div class="substance"> <label class="ocn"> </label> - <p class="norm"> - #@one #@two - </p> + <h4 class="banner"> + #@one + </h4> </div> } end + def dl + "<dl><b>#@one</b> #@two</dl>" + end + def table_css_end #<!TZ!> + '</table> + </p> + </div>' + end def gsub_body case @one when /^(?:#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]}\s*)?\((i+|iv|v|vi+|ix|x|xi+)\)/ @@ -1230,52 +1281,6 @@ WOK super(md,*txt) @vz=SiSU_Env::Get_init.instance.skin end - def endnote_body - %{ -<p class="endnote"> - #@one -</p> -} - end - def header_normal - %{ -<div class="substance"> - #{@p_num.ocn_display} - <#@tag class="#@class" #{@p_num.id}>#{@p_num.name} - #@headname - #@parablock - </#@tag> -</div> -} - end - def heading_body - @tag,@class='p','norm' - header_normal - end - def heading_body1 - @tag,@class='h1','norm' - header_normal - end - def heading_body2 - @tag,@class='h2','norm' - header_normal - end - def heading_body3 - @tag,@class='h3','norm' - header_normal - end - def heading_body4 - @tag,@class='h4','norm' - header_normal - end - def heading_body5 - @tag,@class='h5','norm' - header_normal - end - def heading_body6 - @tag,@class='h6','norm' - header_normal - end end class Format_seg < Format_text_object def initialize(md='',*txt) @@ -1329,20 +1334,6 @@ WOK end def navigation_toc_lev6 end - def endnote_body_seg_tail #FIX - %{ - <p class="endnote"> - #@one - </p> -} - end - def endnote_body_seg_tail_indent - %{ - <p class="endnote_indent"> - #@one - </p> -} - end def endnote_seg_body(fn='') #FIX #url construction keep within single line... BUG WATCH 200408 fn='doc' if fn.empty? #you may wish to reconsider, sends to 'doc' where no segment info %{ @@ -1351,39 +1342,7 @@ WOK </p> } end - def title_header - %{ -<div class="substance"> - #@two -<#@tag class="#@class"> - #@one - </#@tag> -</div> -} - end - def title_header1 - @tag,@class='h1','banner' - title_header - end - def title_header2 - @tag,@class='h2','banner' - title_header - end - def title_header3 - @tag,@class='h3','banner' - title_header - end - def title_header4 - %{ -<div class="substance"> - <label class="ocn"> </label> - <h4 class="banner"> - #@one - </h4> -</div> -} - end - def subtoc_lev + def subtoc_lev(tag,attrib) one=if @one \ and @one =~/<\/?i>|<a\s+name="\S+?">/mi @one.gsub(/<\/?i>|<a\s+name="\S+?">/mi,'') #removes name markers from subtoc, go directly to substantive text @@ -1396,50 +1355,44 @@ WOK one.gsub!(/(?:#{Mx[:en_a_o]}|#{Mx[:en_b_o]}).+?(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})\s*/m,' ') one.gsub!(/<a[\n\s]+name="-\d+"[\n\s]+href="#_\d+"> <sup>\d+<\/sup> /m,'') end - %{<#@tag class="#@class"> - <a href="##@two"> - <i>#{one}</i> - </a> #{note} - </#@tag>} + %{<#{tag} class="#{attrib}"> + <a href="##@two"><i>#{one}</i></a> #{note} + </#{tag}>} end def subtoc_lev5 - @tag,@class='h5','subtoc' - subtoc_lev if @one + subtoc_lev('h5','subtoc') if @one end def subtoc_lev6 - @tag,@class='h6','subtoc' - subtoc_lev if @one + subtoc_lev('h6','subtoc') if @one end #% para sisu - def header4 - %{ -<div class="substance"> -#{@p_num.ocn_display} - <h1 class="norm" #{@p_num.id}>#{@p_num.name} - #@format - #@parablock - </h1> -</div> -} - end - def header_sub + def header_sub(tag,attrib) @parablock.gsub!(/(?:#{Mx[:en_a_o]}|#{Mx[:en_b_o]}).+?(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})\s*/m,' ') %{ <div class="substance"> - #{@p_num.ocn_display} - <#@tag class="#@class" #{@p_num.id}>#{@p_num.name} #{@headname} + #{@p_num.ocn_display} + <#{tag} class="#{attrib}" #{@p_num.id}>#{@p_num.name} #{@headname} #{@parablock} - </#@tag> + </#{tag}> </div> } end def header5 - @tag,@class='p','bold' - header_sub + header_sub('p','bold') end def header6 - @tag,@class='p','bold' - header_sub + header_sub('p','bold') + end + def header4 + %{ +<div class="substance"> + #{@p_num.ocn_display} + <h1 class="norm" #{@p_num.id}>#{@p_num.name} + #@format + #@parablock + </h1> +</div> +} end def navigation_header4 %{<table summary="navigation segment header 4" width=100% bgcolor="#08163f" border="0"> @@ -1528,22 +1481,21 @@ WOK # <h0 class="minitoc"> # <a href="metadata.html">Document Information (metadata)</a> # </h0> - x=if @md.concord_make - %{ - <h4 class="minitoc"> - <a href="concordance.html">Concordance (wordlist)</a> - </h4> + %{ <h4 class="minitoc"> <a href="sisu_manifest.html">Manifest (alternative outputs)</a> </h4> } - else - %{ + 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 |