From 32fd8f3908bc8632e2d8ab4d872f6e4362fe031b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 12 Oct 2014 10:52:35 -0400 Subject: v5: merge v6: remove defaults.rb & some relics related to sisu skins --- lib/sisu/v5/xml_format.rb | 629 ++-------------------------------------------- 1 file changed, 19 insertions(+), 610 deletions(-) (limited to 'lib/sisu/v5/xml_format.rb') diff --git a/lib/sisu/v5/xml_format.rb b/lib/sisu/v5/xml_format.rb index 7959696c..0b319683 100644 --- a/lib/sisu/v5/xml_format.rb +++ b/lib/sisu/v5/xml_format.rb @@ -60,8 +60,8 @@ =end module SiSU_XML_Format require_relative 'dp' # dp.rb - include SiSU_Param - include SiSU_Viz + require_relative 'xml_parts' # xml_parts.rb + include SiSU_Param class ParagraphNumber def initialize(md,paranum) @md=md @@ -86,6 +86,7 @@ module SiSU_XML_Format end end class HeadInformation + include SiSU_Parts_XML def initialize #dc rdf @full_title=@subtitle=@author=@subject=@description=@publisher=@contributor=@date=@type=@format=@identifier=@source=@language=@relation=@coverage=@rights=@copyright=@owner=@keywords='' @md=@@md @@ -197,7 +198,6 @@ module SiSU_XML_Format if @md.rights.copyright.all # possibly redundant see dc.rights @owner=%{\n} if @md.owner @keywords=%{\n} if @md.keywords - @vz=SiSU_Viz::Defaults.new #margin,paragraph,table,banner,url,png,txt,color,font,nav_txt,nav_png,credits,js,php @index='index' end def meta_content_clean(content='') @@ -279,6 +279,7 @@ WOK end end class FormatTextObject + include SiSU_Parts_XML attr_accessor :md,:txt,:format,:paranum,:p_num,:para_id,:headname,:font def initialize(md,dob) @md,@dob=md,dob @@ -292,7 +293,6 @@ WOK @lnk_url=@lnk_url.gsub(rgx,'') if @lnk_url =~rgx rgx=/~\{\d+\s+(.+?)\}~/ @lnk_url=@lnk_url.gsub(rgx,'\1') if @lnk_url =~rgx - @vz=SiSU_Viz::Defaults.new end def scr_endnote_body "#{@txt} " @@ -368,13 +368,12 @@ WOK end end class HeadInformation - include SiSU_Viz + include SiSU_Parts_XML attr_reader :md,:sfx,:pdf,:rdf,:vz def initialize(md) @md=md @rdf=SiSU_XML_Tags::RDF.new(md) # DublinCore 1 - title - @vz=SiSU_Viz::Defaults.new @stylesheet=SiSU_Style::CSS_HeadInfo.new(md).stylesheet @seg_name_html=(SiSU_HTML::Source::Seg.new.seg_name_html || []) @seg_name_html_tracker=(SiSU_HTML::Source::Seg.new.seg_name_html_tracker || []) @@ -389,7 +388,7 @@ WOK end def table_close %{ -#{@vz.table_close}} +#{the_table_close}} end def html_close #moved %{ @@ -398,597 +397,8 @@ WOK end class XML end - class HeadToc < HeadInformation - def initialize(md) - super(md) - @md=md - @tocband_scroll,@tocband_segtoc=make_scroll,make_seg - end - def scroll_head_navigation_band - pdf=if @md.programs[:pdf] - < - #{make_seg_scroll_pdf} - -WOK - else '' - end - %{ -#{pdf} -
- #{@vz.banner_band} - -   -#{@vz.table_close} -

} - end - def concordance_navigation_band(type='') - if type=~/pdf/ - @tocband_concordance=make_concordance - end - %{ - - -
- #{@vz.banner_band} - - #{@tocband_concordance} - -   - #{@vz.png_nav_toc} -   -#{@vz.table_close} -

} - end - def seg_head_navigation_band(type='') - if type=~/pdf/ - @tocband_segtoc=make_scroll_seg_pdf - end - firstseg=%{ - #{@vz.png_nav_nxt} - } if @md.firstseg =~/\S+/ - %{ - - - -} - %{
- #{@vz.banner_band} - - #{@tocband_segtoc} - -  #{firstseg}  -#{@vz.table_close} -

} - end - def seg_head_navigation_band_bottom(type='') - if type=~/pdf/ - @tocband_segtoc=make_scroll_seg_pdf - end - firstseg=%{ - #{@vz.png_nav_nxt} - } if @md.firstseg =~/\S+/ - %{ - - - -} - %{
-   - - #{@tocband_segtoc} - -  #{firstseg}  -#{@vz.table_close} -

} - end - def make_seg_scroll_pdf - wgt=Widget.new(@md) - scroll=%{

- #{@vz.nav_txt_doc_link} -
- - #{scroll} - #{wgt.seg(@vz.nav_txt_toc_link)}#{wgt.pdf}#{wgt.odf} - #{wgt.concordance(@vz.nav_txt_concordance)} - #{wgt.manifest} - #{wgt.search} - #{wgt.home} -
} - end - def make_scroll_seg_pdf - seg='' - wgt=Widget.new(@md) - seg=%{

- #{@vz.nav_txt_toc_link} -
- - #{seg} - #{wgt.scroll(@vz.nav_txt_doc_link)}#{wgt.pdf}#{wgt.odf} -
- #{wgt.concordance(@vz.nav_txt_concordance)} - #{wgt.manifest} - #{wgt.search} - #{wgt.home} -
} - end - def make_concordance - wgt=Widget.new(@md) - %{ - - #{wgt.seg(@vz.nav_txt_toc_link)}#{wgt.scroll(@vz.nav_txt_doc_link)}#{wgt.pdf}#{wgt.odf} -
- #{wgt.concordance(@vz.nav_txt_concordance)} - #{wgt.manifest} - #{wgt.search} - #{wgt.home} -
} - end - def head - %{#{doc_type} - - - #{@md.html_title} - - -#{@rdf.rdftoc} -#{@rdf.metatag_html} -#{@stylesheet.css_head} - -#{@vz.color_body} - - -} - end - def links_guide_open(type='horizontal') - if type=='vertical'; links_guide_vertical_open - else links_guide_horizontal_open - end - end - def links_guide_close #(type='horizontal') - insert='' - insert=if @md.sfx_src =~/s?/ - link='http://sisudoc.org' #get from defaults - url='sisudoc.org' - insert= %{ -

  • - - #{url} - -
  • - - -} - end - %{ #{insert} -} - end - def prefix_a - end - def rights - copyright=meta_content_clean(@md.rights.copyright.all) - rights=copyright(/^\s*Copyright\s+\(C\)/,'Copyright © ') - %{

    Rights: #{rights}

    -

    } - end - def prefix_b - %{

    Prefix: #{@md.prefix_b}

    } - end - def scroll_head_title_banner_open - %{

    -#{@md.icon} -
    -#{@vz.banner_instrument_cover_band_scr}} - end - def seg_head_title_banner_open - %{
    - #{@md.icon} -
    -#{@vz.banner_instrument_cover_band_seg}} - end - def make_scroll - concord=concordance_link(@vz.nav_txt_concordance) - %{ - -
    - #{@vz.nav_txt_doc_link} - - #{concord} -#{@vz.table_close}} - end - def make_seg - concord=concordance_link(@vz.nav_txt_concordance) - %{ - -
    - #{@vz.nav_txt_toc_link} - - - #{concord} -#{@vz.table_close}} - end - def manifest #check structure - manifest=manifest_link(@vz.nav_txt_manifest) - %{#{@vz.margin_txt_3} - #{@vz.paragraph_font_small} - #{manifest} - -#{@vz.table_close}} - end - def concordance #check structure - concord=concordance_link(@vz.nav_txt_concordance) - %{#{@vz.margin_txt_3} - #{@vz.paragraph_font_small} - #{concord} - -#{@vz.table_close}} - end - def metadata - %{#{@vz.margin_css} -

    - - MetaData - -

    -#{@vz.table_close}} - end - def seg_tail - %{ -
    -

     

    - - - -
    - #{@vz.banner_band} - -
    - #{@tocband_segtoc} -
    -
    -

     

    -#{@vz.credits_splash} -#{@vz.credits_sisu} - - - - - - -
    - - -} - end - def scroll_tail #debug - nav=scroll_head_navigation_band - %{ -
    -#{nav} -#{@vz.credits_splash} -#{@vz.credits_sisu} - - - - - - -
    - - -} - end - def seg_navigation_tail #this is a bug area, look up and "tidy" - #nav=scroll_head_navigation_band - %{ -
    -

     

    -#{@vz.credits_splash} -#{@vz.credits_sisu} - - - - - - -
    - - -} - end - end - class HeadSeg < HeadInformation - def initialize(md) #(md='') - super(md) - end - def head - %{#{doc_type} - - - #{@seg_name_html[@seg_name_html_tracker]} - - #{@md.html_title} - - -#{@rdf.rdfseg} -#{@rdf.metatag_html} -#{@vz.font_css_table_file} - -#{@vz.color_body} - - -} - end - def title_banner(title,subtitle,creator) - end - def dot_control_pre_next - %{ - - -} - pre=%{} if f_pre==true - nxt=%{} if f_nxt==true - %{
    - - #{@vz.png_nav_dot_pre} - - - - #{@vz.png_nav_dot_toc} - - - - #{@vz.png_nav_dot_nxt} - -#{@vz.table_close}} - end - def toc_nav(f_pre=false,f_nxt=false,use=1) - pre=nxt='' - toc=%{ - - #{@vz.png_nav_toc} - - - - #{@vz.png_nav_pre} - - - - #{@vz.png_nav_nxt} - -
    - -#{pre} -#{toc} -#{nxt} -
    -#{@vz.table_close}} - end - def toc_next2 - toc_nav(false,true).dup - end - def toc_pre_next2 - toc_nav(true,true).dup - end - def toc_pre2 - toc_nav(true,false,2).dup - end - def doc_types #used in seg_nav_band ### - wgt=Widget.new(@md) - #dir=SiSU_Env::InfoEnv.new(@md.fns) - if @md.concord_make - %{ - - - #{wgt.seg(@vz.nav_txt_toc_link)} - #{wgt.scroll(@vz.nav_txt_doc_link)} - #{wgt.pdf}#{wgt.odf} -
    - #{wgt.concordance(@vz.nav_txt_concordance)} - #{wgt.manifest} - #{wgt.search} - #{wgt.home} -
    } - else - %{ - - - #{wgt.seg(@vz.nav_txt_toc_link)} - #{wgt.scroll(@vz.nav_txt_doc_link)} - #{wgt.pdf}#{wgt.odf} -
    - #{wgt.manifest} - #{wgt.search} - #{wgt.home} -
    } - end - end - def navigation_table - %{ -
    - - - } - end - def navigation_table1 - %{ -
    - } - end - def navigation_table2 - %{ -
    - } - end - def header_advert_local_1 - dir=SiSU_Env::InfoEnv.new(@fns) - %{
    - -
    - - #{@md.ad_alt} - -

    -#{@vz.table_close} -} - end - def header_advert_local_2 - dir=SiSU_Env::InfoEnv.new(@fns) - %{

    - -
    - - #{@md.ad_alt} - -

    -#{@vz.table_close} -} - end - def header_advert_external - dir=SiSU_Env::InfoEnv.new(@fns) - %{

    - -
    - - #{@md.ad_alt} - -

    -#{@vz.table_close} -} - end - def credit - %{ -

    -#{@vz.credits_splash} -#{@vz.credits_sisu} - - - - - - -
    -} - end - def navigation_band(segtocband,seg_table_top_control) #change name to navigaion_band_banner - %{ - - - -
    -#{@vz.banner_band} - - #{doc_types} - - #{segtocband} -
    -#{seg_table_top_control}} - end - def navigation_band_bottom(segtocband,seg_table_top_control) #change name to navigaion_band_bannerless - %{ -
    - - - -
    - #{doc_types} - - #{segtocband} -
    - #{seg_table_top_control} -
    -} - end - def endnote_mark -%{ -

    -


    -

    } - end - def endnote_section_open -%{ -
    -} - end - def endnote_section_close -%{ -
    -} #revisit - end - def head - %{#{doc_type} - - - #{@seg_name_html[@seg_name_html_tracker]} - - #{@md.html_title} - - -#{@rdf.rdfseg} -#{@rdf.metatag_html} -#{@stylesheet.css_head} - -#{@vz.color_body} - - -} - end - def title_banner(title,subtitle,creator) - %{ -
    -

    - #{title} -

    -

    - #{subtitle} -

    -

    - #{creator} -

    -

    - copy @ - - #{@vz.txt_home} - -

    -
    -} - end - end - class HeadScroll < HeadToc - def initialize(md) #(md='') - super(md) - end - def toc_owner_details - %{#{@vz.margin_txt_3} -#{@vz.paragraph_font_small} - - Owner Details - -     - - - -#{@vz.table_close}} - end - def table - %{ - -
    - -#{@vz.paragraph_txt}} - end - def table1 - %{ -
    -#{@vz.paragraph_txt}} - end - def table2 - %{ -
    -#{@vz.paragraph_txt}} - end - end class FormatTextObject - @vz=SiSU_Viz::Defaults.new + include SiSU_Parts_XML attr_accessor :md,:dob,:txt,:ocn,:format,:table,:link,:linkname,:paranum,:p_num,:headname,:banner,:url def initialize(md,t_o) @md,@t_o=md,t_o @@ -1034,7 +444,6 @@ WOK end end @dob=t_o if defined? t_o.is - @vz=SiSU_Viz::Defaults.new end def endnote_body %{ @@ -1183,13 +592,13 @@ WOK end end def bold_para - %{#{@vz.margin_txt_0} + %{#{the_margin.txt_0}

    #{@txt}

    -#{@vz.margin_num_css} +#{the_margin.num_css}     -#{@vz.table_close}} +#{the_table_close}} end def bold_header @txt=@txt.gsub(/[1-9]~(\S+)/,''). @@ -1197,9 +606,9 @@ WOK %{

    #{@txt}

    -#{@vz.margin_num_css} +#{the_margin.num_css}     -#{@vz.table_close}} +#{the_table_close}} end def toc_head_copy_at %{

    #{@txt}

    \n} @@ -1215,9 +624,9 @@ WOK end end class FormatScroll < FormatTextObject + include SiSU_Parts_XML def initialize(md,txt) super(md,txt) - @vz=SiSU_Viz::Defaults.new end end class FormatSeg < FormatTextObject @@ -1240,11 +649,11 @@ WOK
    - + #{@txt}

    -#{@vz.table_close}} +#{the_table_close}} end def navigation_toc_lev3 #change bold use css %{

    @@ -1252,11 +661,11 @@ WOK

    - + #{@txt}

    -#{@vz.table_close}} +#{the_table_close}} end def navigation_toc_lev4 %{ @@ -1266,7 +675,7 @@ WOK

    #{@txt}

    -#{@vz.table_close}} +#{the_table_close}} end def navigation_toc_lev5 end @@ -1344,7 +753,7 @@ WOK

    #{@txt}

    -#{@vz.table_close}} +#{the_table_close}} end def navigation_header5 %{

    -- cgit v1.2.3