aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v6/xhtml_epub2_tune.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-10-12 10:46:48 -0400
committerRalph Amissah <ralph@amissah.com>2014-10-12 10:46:48 -0400
commit53b74bac29e476d4000b76d10acc0c31e2376669 (patch)
tree0624c1e81d661c6f1296e66679b9e9cd29debaac /lib/sisu/v6/xhtml_epub2_tune.rb
parentv5 v6: html, epub, set document body language (diff)
v6: '*_parts', remove defaults.rb & some relics related to sisu skins, long gone
* old code removed & substituted as required by *_parts * attending code changes, fairly wide ranging, test
Diffstat (limited to 'lib/sisu/v6/xhtml_epub2_tune.rb')
-rw-r--r--lib/sisu/v6/xhtml_epub2_tune.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/sisu/v6/xhtml_epub2_tune.rb b/lib/sisu/v6/xhtml_epub2_tune.rb
index 07337309..836ccce3 100644
--- a/lib/sisu/v6/xhtml_epub2_tune.rb
+++ b/lib/sisu/v6/xhtml_epub2_tune.rb
@@ -61,6 +61,7 @@ require_relative 'dp' # dp.rb
module SiSU_XHTML_EPUB2_Tune
require_relative 'se' # se.rb
include SiSU_Env; include SiSU_Screen
+ require_relative 'xhtml_parts' # xhtml_parts.rb
require_relative 'xhtml_epub2_format' # xhtml_epub2_format.rb #watch
@@line_mode=''
@@endnote_array=[]
@@ -109,12 +110,11 @@ module SiSU_XHTML_EPUB2_Tune
end
end
class Tune
+ include SiSU_Parts_XHTML
def initialize(data,md)
@data,@md=data,md
- @vz=SiSU_Viz::Defaults.new
@sys=SiSU_Env::SystemCall.new
@env=SiSU_Env::InfoEnv.new(@md.fns)
- @brace_url=SiSU_Viz::Defaults.new.url_decoration
end
def songsheet
begin
@@ -261,18 +261,18 @@ module SiSU_XHTML_EPUB2_Tune
dob.obj.gsub(/\<:ad\s+(\S+)?\s+(\S+\.png)\s+(.+)?\;\s+(.+)?\;\s*\>/,
%{\n<center><a href="\\1" target="_top"><img src="#{@env.url.images_epub}/\\2" alt="\\3" /></a></center>\n})
end
- dob.obj=dob.obj.gsub(/!pick/,%{<img border="0" height="15" width="15" src="#{@env.url.images_epub}/#{@vz.icon_choice}" alt="stellar" />}).
- gsub(/!new/,%{#{$ep[:hsp]}<img border="0" height="15" width="15" src="#{@env.url.images_epub}/#{@vz.icon_new}" alt="new" />}).
+ dob.obj=dob.obj.gsub(/!pick/,%{<img border="0" height="15" width="15" src="#{@env.url.images_epub}/#{the_icon.i_choice}" alt="stellar" />}).
+ gsub(/!new/,%{#{$ep[:hsp]}<img border="0" height="15" width="15" src="#{@env.url.images_epub}/#{the_icon.i_new}" alt="new" />}).
gsub(/<:h(.{1,7}?)>/,'<a href="#h\1">\1</a>').
gsub(/<:to(\d{1,7}?)>/,%{<a href="#to\\1">to#{$ep[:hsp]}\{#{$ep[:hsp]}\\1#{$ep[:hsp]}\}</a> }).
gsub(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'<a href="\1" target="_top">\1</a>'). #http ftp matches escaped, no decoration
- gsub(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="mailto:\\1">\\1</a>#{@brace_url.xml_close}}).
- gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="\\1" target="_top">\\1</a>#{@brace_url.xml_close}}) #http ftp matches with decoration
+ gsub(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,%{#{the_url_decoration.xml_open}<a href="mailto:\\1">\\1</a>#{the_url_decoration.xml_close}}).
+ gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{the_url_decoration.xml_open}<a href="\\1" target="_top">\\1</a>#{the_url_decoration.xml_close}}) #http ftp matches with decoration
if dob.obj =~/..\/\S+/ \
and dob.obj !~/(\"..\/\S+?\"|>\s*..\/\S+<)/
dob.obj=dob.obj.gsub(/(\.\.\/\S+)/,'<a href="\1">\1</a>')
end
- dob.obj=dob.obj.gsub(/<a href="\.\.\//,%{<a href="#{@vz.url_site}/})
+ dob.obj=dob.obj.gsub(/<a href="\.\.\//,%{<a href="#{the_url.site}/})
else
dob.obj=dob.obj.gsub(/</m,'&lt;').gsub(/>/m,'&gt;')
end