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 | |
parent | html segments, links to concordance file only if made, fix (diff) |
html segments structure and info provided (a bit verbose), and css
-rw-r--r-- | lib/sisu/v0/css.rb | 260 | ||||
-rw-r--r-- | lib/sisu/v0/html.rb | 5 | ||||
-rw-r--r-- | lib/sisu/v0/html_format.rb | 304 | ||||
-rw-r--r-- | lib/sisu/v0/html_segments.rb | 15 |
4 files changed, 149 insertions, 435 deletions
diff --git a/lib/sisu/v0/css.rb b/lib/sisu/v0/css.rb index 1eef5023..449f51d8 100644 --- a/lib/sisu/v0/css.rb +++ b/lib/sisu/v0/css.rb @@ -285,7 +285,7 @@ WOK text-align: left; } - p.tiny, p.tiny_left, p.tiny_right, p.tiny_center { + .tiny, .tiny_left, .tiny_right, .tiny_center { font-size: 10px; margin-top: 0px; margin-bottom: 0px; @@ -634,6 +634,7 @@ WOK margin-top: 20px; margin-bottom: 10px; } + h1.banner { font-size: 120%; } @@ -767,6 +768,13 @@ WOK background-color: #eeeeee; margin-right:1em; } + div.summary { + margin: 0; + padding: 0; + border-left: 13em solid #eeeeee; + padding-left: 1em; + background-color: #eeeeee; + } div.content { margin: 0; padding: 0; @@ -915,256 +923,6 @@ WOK #banner h1 { margin:0px; padding:10px} WOK end - def html_bk #stylesheet for html... check use -<<WOK - document { - display: block; - margin-left: 0mm; - margin-right: 0mm; - } - head { - display: block; - margin-bottom: 20px; - background-color: #dddddd; - } - dc,keywords,copyright { - display: block; - font-family: #{fonts}; - color: blue; - background-color: #dddddd; - font-weight: normal; - text-align: justify; - font-size: xx-small%; - line-height: 120%; - margin-left: 5%; - margin-right: 5mm; - margin-top: 0px; - margin-bottom: 0px; - } - keywords,copyright { - display: block; - font-family: #{fonts}; - color: red; - background-color: #dddddd; - font-weight: normal; - text-align: justify; - font-size: xx-small%; - line-height: 120%; - margin-left: 5%; - margin-right: 5mm; - margin-top: 0px; - margin-bottom: 0px; - } - table { - margin-left: 5%; - display: block; - } - tr { - display: block; - } - th, td { - display: inline; - } - th.left { - text-align: left; - } - td.right { - text-align: right; - } - body { - color: black; - background: #ffffff; - } - a:link { - color: #003399; - text-decoration: none; - } - a:visited { - color: #003399; - text-decoration: none; - /* background-color: #e3ecef; */ - } - a:hover { - color: #000000; - text-decoration: underline; - background-color: #fff3b6; - } - a:hover IMG { - background-color: #ffffff; - } - a:active { - color: #003399; - text-decoration: underline; - } - p { - display: block; - font-family: #{fonts}; - font-weight: normal; - text-align: justify; - font-size: 100%; - line-height: 150%; - margin-left: 5%; - margin-right: 5%; - margin-top: 2px; - margin-bottom: 0px; - } - p.norm { } - p.h1 { - font-family: #{fonts}; - font-size: 120%; - font-weight: bold; - text-align: left; - line-height: 120%; - margin-top: 20px; - margin-bottom: 10px; - } - p.h2 { - font-weight: bold; - font-size: 110%; - text-align: left; - margin-top: 20px; - margin-bottom: 10px; - } - p.h3 { - font-size: 110%; - font-weight: bold; - text-align: left; - } - p.h4 { - font-size: 110%; - font-weight: bold; - text-align: left; - } - p.h5 { - font-size: 110%; - font-weight: bold; - text-align: left; - } - p.h6 { - font-size: 110%; - font-weight: bold; - text-align: left; - } - p.toc1 { - font-weight: bold; - font-size: small; - text-align: left; - line-height: 100%; - margin-left: 5%; - margin-right: 5%; - margin-top: 10px; - margin-bottom: 5px; - } - p.toc2 { - font-weight: bold; - font-size: x-small; - text-align: left; - line-height: 100%; - margin-left: 5%; - margin-right: 10%; - margin-top: 10px; - margin-bottom: 5px; - } - p.toc3 { - font-size: x-small; - text-align: left; - line-height: 100%; - margin-left: 5%; - margin-right: 10%; - margin-top: 10px; - margin-bottom: 5px; - } - p.toc4 { - font-size: x-small; - text-align: left; - line-height: 100%; - margin-left: 10%; - margin-right: 10%; - margin-top: 5px; - margin-bottom: 5px; - } - p.toc5 { - font-size: x-small; - text-align: left; - line-height: 100%; - margin-left: 15%; - margin-right: 10%; - margin-top: 5px; - margin-bottom: 5px; - } - p.toc6 { - font-size: x-small; - text-align: left; - line-height: 100%; - margin-left: 20%; - margin-right: 10%; - margin-top: 5px; - margin-bottom: 5px; - } -/* microtoc for use later --> */ -/* - -*/ -/* subtoc --> */ - p.subtoc4 { - font-size: x-small; - text-align: left; - line-height: 100%; - margin-left: 10%; - margin-right: 10%; - margin-top: 5px; - margin-bottom: 5px; - } - p.subtoc5 { - font-size: x-small; - text-align: left; - line-height: 100%; - margin-left: 15%; - margin-right: 10%; - margin-top: 5px; - margin-bottom: 5px; - } - p.subtoc6 { - font-size: x-small; - text-align: left; - line-height: 100%; - margin-left: 20%; - margin-right: 10%; - margin-top: 5px; - margin-bottom: 5px; - } - p.ocn { - display: block; - text-align: right; - vertical-align: super; - color: #999999; - font-size: xx-small; - margin-right: 0mm; - margin-top: 0px; - margin-bottom: 0px; - } - p.note { - display: block; - font-size: small; - font-family: #{fonts}; - font-weight: normal; - line-height: 150%; - text-align: justify; - margin-left: 10%; - margin-right: 5%; - margin-top: 4px; - margin-bottom: 0px; - } - en { - font-size: xx-small; - vertical-align: super; - } - i { font-style: italic; } - b { font-style: bold; } - u { text-decoration: underline; } - br { display: block; } -WOK - end def xhtml #stylesheet for xhtml <<WOK /* SiSU css xhtml & sax.xml default style */ diff --git a/lib/sisu/v0/html.rb b/lib/sisu/v0/html.rb index 28098f6c..fd2294ba 100644 --- a/lib/sisu/v0/html.rb +++ b/lib/sisu/v0/html.rb @@ -359,7 +359,10 @@ WOK else format_toc.lev1 end toc[:seg_mini]=if para =~/^#{Mx[:lv_o]}\d:meta#{Mx[:lv_c]}\s*Document Information/ - format_toc.mini_tail + x=if @md.concord_make + format_toc.mini_concord_tail + else format_toc.mini_tail + end else format_toc.mini_lev1 end title=if para =~/(#{Mx[:id_o]}~0;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]})$/ 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 diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb index c4d136b7..db387105 100644 --- a/lib/sisu/v0/html_segments.rb +++ b/lib/sisu/v0/html_segments.rb @@ -221,11 +221,11 @@ module SiSU_HTML_seg if @@is1 == 1 @dc_creator=%{<b>#{@md.dc_creator}</b>\n} if @md.dc_creator.to_s =~/\S/ @@seg[:tocband_banner] << format_head_seg.navigation_band(@@segtocband,@@seg[:dot_nav]) - endnote_section_close=unless @@get_hash_fn =~/metadata/ - format_head_seg.endnote_section_close + conditional_div_close=unless @@get_hash_fn =~/metadata/ #watch + '</div>' else '' end - @@seg[:tocband_bannerless] << endnote_section_close << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav]) + @@seg[:tocband_bannerless] << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav]) @@seg[:headers] << format_head_seg.seg_head_escript if SiSU_HTML_Format::Head_seg.method_defined? :seg_head_escript #debug PHP move up in text #bug @@seg[:headers] << format_head_seg.title_banner(@md.title,@md.subtitle,@dc_creator).gsub(clean,'') paranum=if @@header1[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1 @@ -270,6 +270,7 @@ module SiSU_HTML_seg end def markup(para) @debug=[] + para.gsub!(/(?:\s*#{Mx[:br_page]}\s*|\s*#{Mx[:br_page_new]}\s*)+/m,'') format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) if para !~/^#{Rx[:meta]}/ m=para[/.+?#{Mx[:id_o]}~(\d+);(?:[ohm]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/] @@ -386,9 +387,9 @@ module SiSU_HTML_seg filename_seg=[] filename_seg << @@seg[:title] << @@seg[:tocband_banner] if type !~/endnote/ - filename_seg << @@minitoc << @@seg[:main] + filename_seg << @@minitoc << @@seg[:headers] << @@seg[:main] else - filename_seg << @@seg[:header_endnotes] << @@minitoc << %{\n<div class="content">\n} << @@seg[:endnote_all] + filename_seg << @@seg[:header_endnotes] << @@minitoc << @@seg[:headers] << %{\n<div class="content">\n} << @@seg[:endnote_all] #<< '</div>' end filename_seg << @@seg[:tail] << @@seg[:tocband_bannerless] << @@seg[:credits] filename_seg.flatten!.compact! @@ -477,8 +478,8 @@ module SiSU_HTML_seg try.each do |e| format_seg=SiSU_HTML_Format::Format_seg.new(@md,e) note_match=if e =~/#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]}/ - format_seg.endnote_body_seg_tail_indent - else format_seg.endnote_body_seg_tail + format_seg.endnote_body_indent + else format_seg.endnote_body end @@seg_endnotes_array << note_match end |