From 0ec2677657a7199d5210d9e013fe62334c83f71a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 17 Aug 2008 01:18:19 -0400 Subject: html segments structure and info provided (a bit verbose), and css --- lib/sisu/v0/css.rb | 260 ++---------------------------------- lib/sisu/v0/html.rb | 5 +- lib/sisu/v0/html_format.rb | 304 ++++++++++++++++++------------------------- lib/sisu/v0/html_segments.rb | 15 ++- 4 files changed, 149 insertions(+), 435 deletions(-) (limited to 'lib') 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; @@ -913,256 +921,6 @@ WOK } #column_right p { font-size:12px} #banner h1 { margin:0px; padding:10px} -WOK - end - def html_bk #stylesheet for html... check use -< */ -/* - -*/ -/* 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 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 - %{ + %{ #{wgt.seg(@vz.nav_txt_toc_link)} @@ -988,7 +988,9 @@ WOK toc_metadata end def title_banner(title,subtitle,creator) - %{

+ %{ +

+

#{title}

@@ -1002,7 +1004,9 @@ WOK #{@vz.txt_home} -

} +

+
+} end end class Head_scroll < Head_toc @@ -1055,7 +1059,7 @@ WOK # ##{@vz.table_close}} # end - def title_endnote + def title_endnote #revisit # %{#{@vz.margin_txt_0} # #{@vz.paragraph_txt} # @@ -1063,37 +1067,6 @@ WOK #   ##{@vz.table_close}} end -# def tail -# %{
-##{@vz.margin_txt_0} -#
-# -# -#
-##{@vz.banner_band} -# -#
#@tocband_scroll
-#
-#
-##{@vz.paragraph_txt} -#
-# #{@vz.credits_splash} -# #{@vz.credits_sisu} -#
-##{@vz.margin_num} -##{@vz.table_close} -# -# -# -# -# -# -# -# #{@md.title*10} -# -# -#} -# 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 + %{ +

+ #@one +

+} + end + def endnote_body_indent + %{ +

+ #@one +

+} + end + def no_paranum + %{ +
+ +

+ #@one #@two +

+
+} + end def para_form_css(tag,attrib) # regular paragraphs shaped here ul=ulc='' ul,ulc="" if @tag =~/li/ @@ -1157,26 +1154,80 @@ 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 - "
#@one #@two
" + + def header_normal(tag,attrib) + %{ +
+ #{@p_num.ocn_display} + <#{tag} class="#{attrib}" #{@p_num.id}>#{@p_num.name} + #@headname + #@parablock + +
+} end - def table_css_end # - ' -

- ' + 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) + %{ +
+<#{tag} class="#{attrib}"> + #@one + +
+} + 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 %{
-

- #@one #@two -

+
} + end + def dl + "
#@one #@two
" + end + def table_css_end # + ' +

+ ' end def gsub_body case @one @@ -1230,52 +1281,6 @@ WOK super(md,*txt) @vz=SiSU_Env::Get_init.instance.skin end - def endnote_body - %{ -

- #@one -

-} - end - def header_normal - %{ -
- #{@p_num.ocn_display} - <#@tag class="#@class" #{@p_num.id}>#{@p_num.name} - #@headname - #@parablock - -
-} - 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) @@ -1328,20 +1333,6 @@ WOK def navigation_toc_lev5 end def navigation_toc_lev6 - end - def endnote_body_seg_tail #FIX - %{ -

- #@one -

-} - end - def endnote_body_seg_tail_indent - %{ -

- #@one -

-} 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

} end - def title_header - %{ -
- #@two -<#@tag class="#@class"> - #@one - -
-} - 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 - %{ -
- - -
-} - end - def subtoc_lev + def subtoc_lev(tag,attrib) one=if @one \ and @one =~/<\/?i>|/mi @one.gsub(/<\/?i>|/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!(/ \d+<\/sup> /m,'') end - %{<#@tag class="#@class"> - - #{one} - #{note} - } + %{<#{tag} class="#{attrib}"> + #{one} #{note} + } 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 - %{ -
-#{@p_num.ocn_display} -

#{@p_num.name} - #@format - #@parablock -

-
-} - 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,' ') %{
- #{@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} - +
} 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 + %{ +
+ #{@p_num.ocn_display} +

#{@p_num.name} + #@format + #@parablock +

+
+} end def navigation_header4 %{ @@ -1528,22 +1481,21 @@ WOK # # Document Information (metadata) # - x=if @md.concord_make - %{ -

- Concordance (wordlist) -

+ %{

Manifest (alternative outputs)

} - else - %{ + end + def mini_concord_tail + %{ +

+ Concordance (wordlist) +

Manifest (alternative outputs)

} - 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=%{#{@md.dc_creator}\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 + '' 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
\n} << @@seg[:endnote_all] + filename_seg << @@seg[:header_endnotes] << @@minitoc << @@seg[:headers] << %{\n
\n} << @@seg[:endnote_all] #<< '
' 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 -- cgit v1.2.3