aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/xhtml_epub2_format.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v5/xhtml_epub2_format.rb')
-rw-r--r--lib/sisu/v5/xhtml_epub2_format.rb67
1 files changed, 32 insertions, 35 deletions
diff --git a/lib/sisu/v5/xhtml_epub2_format.rb b/lib/sisu/v5/xhtml_epub2_format.rb
index 4004a446..bbd02a6d 100644
--- a/lib/sisu/v5/xhtml_epub2_format.rb
+++ b/lib/sisu/v5/xhtml_epub2_format.rb
@@ -58,7 +58,6 @@
=end
module SiSU_XHTML_EPUB2_Format
- include SiSU_Viz
class ParagraphNumber
def initialize(md,ocn)
@md,@ocn=md,ocn.to_s
@@ -1235,6 +1234,7 @@ module SiSU_XHTML_EPUB2_Format
end
end
module SanitizeXML
+ require_relative 'xhtml_parts' # xhtml_parts.rb
def self.xml(x)
if x.is_a?(String)
x=x.gsub(/ /,' ') if Ep[:alt]==:on
@@ -1249,12 +1249,10 @@ module SiSU_XHTML_EPUB2_Format
end
end
class HeadInformation
- include SiSU_Viz
- attr_reader :md,:rdf,:vz
+ attr_reader :md,:rdf
def initialize(md)
@md=md
# DublinCore 1 - title
- @vz=SiSU_Viz::Defaults.new
@css=SiSU_Env::CSS_Stylesheet.new(md)
@seg_name_xhtml=(SiSU_XHTML_EPUB2::Source::Seg.new.seg_name_xhtml || [])
@seg_name_xhtml_tracker=(SiSU_XHTML_EPUB2::Source::Seg.new.seg_name_xhtml_tracker || [])
@@ -1722,15 +1720,16 @@ output_epub_cont_seg.close
end
def table_close
%{ </font>
-#{@vz.table_close}}
+#{the_table_close}}
end
def xhtml_close
- %{#{@vz.credits_sisu_epub}
+ %{#{SiSU_Proj_XHTML::Bits.new.credits_sisu_epub}
</body>
</html>}
end
end
class HeadToc < HeadInformation
+ include SiSU_Parts_XHTML
def initialize(md)
super(md)
@md=md
@@ -1757,16 +1756,16 @@ output_epub_cont_seg.close
end
def concordance
if @md.concord_make
- %{#{@vz.margin_css}
+ %{#{the_margin.css}
<h4 class="toc">
<a href="./#{@md.file.base_filename.html_concordance}">
<i>Concordance</i>
</a>
</h4>
-#{@vz.table_close}}
+#{the_table_close}}
else
- %{#{@vz.margin_css}
-#{@vz.table_close}}
+ %{#{the_margin.css}
+#{the_table_close}}
end
end
def links_guide_open(type='horizontal')
@@ -1787,40 +1786,40 @@ output_epub_cont_seg.close
%{<p class="small_left">Prefix: #{@md.prefix_b}}
end
def make_seg
- concord=concordance_link(@vz.nav_txt_concordance)
+ concord=concordance_link(the_nav.txt_concordance)
%{<table summary="toc segment" border="0" cellpadding="3" cellspacing="0">
<tr><td align="center" bgcolor="white">
- #{@vz.nav_txt_toc_link}
+ #{the_nav.txt_toc_link}
</td>
<td align="center" bgcolor="white">
<font size=2>
#{concord}
-#{@vz.table_close}}
+#{the_table_close}}
end
def manifest #check structure
- manifest=manifest_link(@vz.nav_txt_manifest)
- %{#{@vz.margin_txt_3}
- #{@vz.paragraph_font_small}
+ manifest=manifest_link(the_nav.txt_manifest)
+ %{#{the_margin.txt_3}
+ #{the_font.paragraph_font_small}
#{manifest}
</font>
-#{@vz.table_close}}
+#{the_table_close}}
end
def concordance #check structure
- concord=concordance_link(@vz.nav_txt_concordance)
- %{#{@vz.margin_txt_3}
- #{@vz.paragraph_font_small}
+ concord=concordance_link(the_nav.txt_concordance)
+ %{#{the_margin.txt_3}
+ #{the_font.paragraph_font_small}
#{concord}
</font>
-#{@vz.table_close}}
+#{the_table_close}}
end
def metadata
- %{#{@vz.margin_css}
+ %{#{the_margin.css}
<h4 class="toc">
<a href="#{@metalink}">
<i>MetaData</i>
</a>
</h4>
-#{@vz.table_close}}
+#{the_table_close}}
end
end
class HeadSeg < HeadInformation
@@ -1850,8 +1849,8 @@ output_epub_cont_seg.close
super(md)
end
def toc_owner_details
- %{#{@vz.margin_txt_3}
-#{@vz.paragraph_font_small}
+ %{#{the_margin.txt_3}
+#{the_font.paragraph_font_small}
<a href="#owner.details">
Owner Details
<font size="1" color="#777777">
@@ -1859,11 +1858,11 @@ output_epub_cont_seg.close
</font>
</a>
</font>
-#{@vz.table_close}}
+#{the_table_close}}
end
end
class FormatTextObject
- @vz=SiSU_Viz::Defaults.new
+ include SiSU_Parts_XHTML
attr_accessor :md,:t_o,:txt,:ocn,:format,:table,:link,:linkname,:paranum,:p_num,:headname,:banner,:url
def initialize(md,t_o)
@md,@t_o=md,t_o
@@ -1907,7 +1906,6 @@ output_epub_cont_seg.close
@txt=@txt.gsub(/#{Mx[:mk_o]}[-~]##{Mx[:mk_c]}/,'')
end
@p_num=ParagraphNumber.new(@md,@ocn)
- @vz=SiSU_Viz::Defaults.new
end
def nametags_seg(dob) #FIX
tags=''
@@ -2084,13 +2082,13 @@ output_epub_cont_seg.close
end
end
def bold_para
- %{#{@vz.margin_txt_0}
+ %{#{the_margin.txt_0}
<p class="bold">
#{@txt}
</p>
-#{@vz.margin_num_css}
+#{the_margin.num_css}
#{$ep[:hsp]*3}
-#{@vz.table_close}}
+#{the_table_close}}
end
def bold_heading #unused
@txt=@txt.gsub(/[1-9]~\S+/,'').
@@ -2098,9 +2096,9 @@ output_epub_cont_seg.close
%{<p class="bold">
#{@txt}
</p>
-#{@vz.margin_num_css}
+#{the_margin.num_css}
#{$ep[:hsp]*3}
-#{@vz.table_close}}
+#{the_table_close}}
end
def toc_head_copy_at
@txt=SanitizeXML.xml(@txt)
@@ -2122,7 +2120,6 @@ output_epub_cont_seg.close
class FormatScroll < FormatTextObject
def initialize(md,txt)
super(md,txt)
- @vz=SiSU_Viz::Defaults.new
end
end
class FormatSeg < FormatTextObject
@@ -2206,7 +2203,7 @@ output_epub_cont_seg.close
<p class="bold">
#{@txt}
</p>
-#{@vz.table_close}}
+#{the_table_close}}
end
def navigation_heading5
%{<p class="bold">