From 151f10430123b4999de4e511cdba34b4ff1d6a0b Mon Sep 17 00:00:00 2001
From: Ralph Amissah
#{@txt}
#{@txt}
#{h[:txt]}
-
- #{@vz.nav_txt_pdf_portrait}
-
-
-
-
- #{@vz.nav_txt_pdf_landscape}
-
-
-}
- else ''
- end
- end
end
class XML
end
@@ -648,8 +630,6 @@ WOK
def initialize(md)
super(md)
end
- def title_banner(title,subtitle,creator)
- end
def dot_control_pre_next
pre="#{@seg_name_html[@seg_name_html_tracker-1]}#{@md.lang_code_insert}#{Sfx[:html]}"
up=@toc
diff --git a/lib/sisu/v6/html_format.rb b/lib/sisu/v6/html_format.rb
index bf1703a1..e2fa7dc6 100644
--- a/lib/sisu/v6/html_format.rb
+++ b/lib/sisu/v6/html_format.rb
@@ -271,24 +271,6 @@ module SiSU_HTML_Format
else ''
end
end
- def pdf #retired 2.7.9
- pdf=if @md.programs[:pdf] \
- and @cf_defaults.cf_0 =~/p/
- %{
-
-
- #{@vz.nav_txt_pdf_portrait}
-
-
-
-
- #{@vz.nav_txt_pdf_landscape}
-
-
-}
- else ''
- end
- end
end
class XML
end
@@ -648,8 +630,6 @@ WOK
def initialize(md)
super(md)
end
- def title_banner(title,subtitle,creator)
- end
def dot_control_pre_next
pre="#{@seg_name_html[@seg_name_html_tracker-1]}#{@md.lang_code_insert}#{Sfx[:html]}"
up=@toc
--
cgit v1.2.3
From bd5e94912c594372eca319e75e15c364b7e124ea Mon Sep 17 00:00:00 2001
From: Ralph Amissah
" unless x =~/^(\.)+$/ }
diff --git a/lib/sisu/v5/xhtml_epub2.rb b/lib/sisu/v5/xhtml_epub2.rb
index 33e3a529..2073bb4b 100644
--- a/lib/sisu/v5/xhtml_epub2.rb
+++ b/lib/sisu/v5/xhtml_epub2.rb
@@ -61,7 +61,11 @@
=end
module SiSU_XHTML_EPUB2
- require 'pstore'
+ begin
+ require 'pstore'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pstore NOT FOUND (LoadError)')
+ end
require_relative 'particulars' # particulars.rb
include SiSU_Particulars
require_relative 'defaults' # defaults.rb
diff --git a/lib/sisu/v5/xml_fictionbook2.rb b/lib/sisu/v5/xml_fictionbook2.rb
index 6549fa12..c72332bb 100644
--- a/lib/sisu/v5/xml_fictionbook2.rb
+++ b/lib/sisu/v5/xml_fictionbook2.rb
@@ -227,7 +227,11 @@ module SiSU_XML_Fictionbook
endnotes
end
def extract_images #work on
- require "base64"
+ begin
+ require 'base64'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('base64 NOT FOUND (LoadError)')
+ end
images_raw,images_base64_fb2=[],[]
images_base64={}
if defined? @md.make.cover_image[:cover]
diff --git a/lib/sisu/v5/xml_odf_odt.rb b/lib/sisu/v5/xml_odf_odt.rb
index a6a7a127..3cb2fbbf 100644
--- a/lib/sisu/v5/xml_odf_odt.rb
+++ b/lib/sisu/v5/xml_odf_odt.rb
@@ -73,8 +73,12 @@ module SiSU_XML_ODF_ODT
require_relative 'txt_shared' # txt_shared.rb
@@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0
class Source
- require 'zlib'
- require 'find'
+ begin
+ require 'zlib'
+ require 'find'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('zlib or find NOT FOUND (LoadError)')
+ end
def initialize(opt)
@opt=opt
@particulars=SiSU_Particulars::CombinedSingleton.instance.get_all(opt)
diff --git a/lib/sisu/v6/ao_hash_digest.rb b/lib/sisu/v6/ao_hash_digest.rb
index b2fd8bfd..ce45b9e4 100644
--- a/lib/sisu/v6/ao_hash_digest.rb
+++ b/lib/sisu/v6/ao_hash_digest.rb
@@ -75,7 +75,11 @@ module SiSU_AO_Hash
data=@data.compact
@tuned_file=[]
sha_ =(@env.digest.type=='sha256' ? true : false)
- sha_ ? (require 'digest/sha2') : (require 'digest/md5')
+ begin
+ sha_ ? (require 'digest/sha2') : (require 'digest/md5')
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error((sha_ ? 'digest/sha2' : 'digest/md5') + ' NOT FOUND')
+ end
data.each do |t_o|
unless t_o.obj.is_a?(Array)
t_o.obj=t_o.obj.strip
diff --git a/lib/sisu/v6/ao_images.rb b/lib/sisu/v6/ao_images.rb
index 76721d63..0279994d 100644
--- a/lib/sisu/v6/ao_images.rb
+++ b/lib/sisu/v6/ao_images.rb
@@ -62,8 +62,12 @@
=end
module SiSU_AO_Images
class Images
- #require 'RMagick'
- #include Magick
+ #begin
+ # require 'RMagick'
+ # include Magick
+ #rescue LoadError
+ # SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('RMagic NOT FOUND (LoadError)')
+ #end
def initialize(md,data)
@md,@data=md,data
end
diff --git a/lib/sisu/v6/cgi_pgsql.rb b/lib/sisu/v6/cgi_pgsql.rb
index 2bcd42e3..3b0b610b 100644
--- a/lib/sisu/v6/cgi_pgsql.rb
+++ b/lib/sisu/v6/cgi_pgsql.rb
@@ -192,9 +192,13 @@ module SiSU_CGI_PgSQL
* Description: generates naive cgi search form for search of sisu database (pgsql)
#{gpl}
=end
- require 'cgi'
- require 'fcgi'
- require 'dbi'
+ begin
+ require 'cgi'
+ require 'fcgi'
+ require 'dbi'
+ rescue LoadError
+ puts 'cgi, fcgi or dbi NOT FOUND (LoadError)'
+ end
@stub_default='#{@name_of[:db]}'
@image_src='#{@image_src}'
@hosturl_cgi='#{@name_of[:host_url_cgi]}'
diff --git a/lib/sisu/v6/cgi_sqlite.rb b/lib/sisu/v6/cgi_sqlite.rb
index fff0f98f..daf915e6 100644
--- a/lib/sisu/v6/cgi_sqlite.rb
+++ b/lib/sisu/v6/cgi_sqlite.rb
@@ -165,9 +165,13 @@ module SiSU_CGI_SQLite
* Description: generates naive cgi search form for search of sisu database (sqlite)
#{gpl}
=end
- require 'cgi'
- require 'fcgi'
- require 'dbi'
+ begin
+ require 'cgi'
+ require 'fcgi'
+ require 'dbi'
+ rescue LoadError
+ puts 'cgi, fcgi or dbi NOT FOUND (LoadError)'
+ end
@stub_default='sisu_sqlite'
@image_src='#{@image_src}'
@hosturl_cgi='#{@env.url.webserv_base_cgi(@opt)}/cgi-bin'
diff --git a/lib/sisu/v6/composite.rb b/lib/sisu/v6/composite.rb
index 044f31c4..ebbd14f6 100644
--- a/lib/sisu/v6/composite.rb
+++ b/lib/sisu/v6/composite.rb
@@ -178,10 +178,14 @@ module SiSU_Assemble
end
tuned_file << if loadfile =~ /(?:https?|file):\/\/\S+?\.ss[ti]$/ # and NetTest
imagedir = /((?:https?|file):\/\/\S+?)\/[^\/]+?\.ss[ti]$/.match(loadfile).captures.join + '/_sisu/image' #watch
- require 'uri'
+ begin
+ require 'uri'
+ require 'open-uri'
+ require 'pp'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('uri, open-uri or pp NOT FOUND (LoadError)')
+ end
image_uri=URI.parse(imagedir)
- require 'open-uri'
- require 'pp'
insert=open(loadfile)
insert_array=insert.dup
insert.close
diff --git a/lib/sisu/v6/db_import.rb b/lib/sisu/v6/db_import.rb
index e9fc4d5c..e1342b1d 100644
--- a/lib/sisu/v6/db_import.rb
+++ b/lib/sisu/v6/db_import.rb
@@ -66,7 +66,6 @@ module SiSU_DbImport
require_relative 'db_load_tuple' # db_load_tuple.rb
require_relative 'db_sqltxt' # db_sqltxt.rb
require_relative 'html_lite_shared' # html_lite_shared.rb
- require 'sqlite3'
class Import < SiSU_DbText::Prepare
include SiSU_Param
include SiSU_Screen
diff --git a/lib/sisu/v6/dbi.rb b/lib/sisu/v6/dbi.rb
index 6804ab97..acb75e0f 100644
--- a/lib/sisu/v6/dbi.rb
+++ b/lib/sisu/v6/dbi.rb
@@ -120,9 +120,12 @@ manually create the database: "#{cX.green}#{@db.db}#{cX.off}" if it does not yet
end
def read_sqlite
begin
- @conn=@db.sqlite.conn_sqlite3
- rescue
- ensure
+ begin
+ require 'sqlite3'
+ @conn=@db.sqlite.conn_sqlite3
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('sqlite3 NOT FOUND (LoadError)')
+ end
end
end
def connect
diff --git a/lib/sisu/v6/dbi_discrete.rb b/lib/sisu/v6/dbi_discrete.rb
index b842c767..0ac84db4 100644
--- a/lib/sisu/v6/dbi_discrete.rb
+++ b/lib/sisu/v6/dbi_discrete.rb
@@ -69,8 +69,12 @@ module SiSU_DBI_Discrete #% database building
include SiSU_DbDBI
require_relative 'html_lite_shared' # html_lite_shared.rb
include SiSU_FormatShared
- require 'fileutils'
- include FileUtils::Verbose
+ begin
+ require 'fileutils'
+ include FileUtils::Verbose
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('fileutils NOT FOUND (LoadError)')
+ end
class SQL
def initialize(opt)
SiSU_Env::Load.new('dbi',true).prog
@@ -145,9 +149,12 @@ module SiSU_DBI_Discrete #% database building
end
def read_sqlite
begin
- @conn=@db.sqlite.conn_sqlite3
- rescue
- ensure
+ begin
+ require 'sqlite3'
+ @conn=@db.sqlite.conn_sqlite3
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('sqlite3 not available')
+ end
end
end
def connect
diff --git a/lib/sisu/v6/defaults.rb b/lib/sisu/v6/defaults.rb
index ca3c0c04..a26edae9 100644
--- a/lib/sisu/v6/defaults.rb
+++ b/lib/sisu/v6/defaults.rb
@@ -62,7 +62,11 @@
=end
$latex_run=nil
module SiSU_Viz
- require 'uri'
+ begin
+ require 'uri'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('uri NOT FOUND (LoadError)')
+ end
require_relative 'sysenv' # sysenv.rb
include SiSU_Env
require_relative 'css' # css.rb
diff --git a/lib/sisu/v6/html.rb b/lib/sisu/v6/html.rb
index 8a909677..148672e5 100644
--- a/lib/sisu/v6/html.rb
+++ b/lib/sisu/v6/html.rb
@@ -61,7 +61,11 @@
=end
module SiSU_HTML
- require 'pstore'
+ begin
+ require 'pstore'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pstore NOT FOUND (LoadError)')
+ end
require_relative 'particulars' # particulars.rb
include SiSU_Particulars
require_relative 'defaults' # defaults.rb
diff --git a/lib/sisu/v6/hub.rb b/lib/sisu/v6/hub.rb
index 7e2a009d..62b8eaa0 100644
--- a/lib/sisu/v6/hub.rb
+++ b/lib/sisu/v6/hub.rb
@@ -72,7 +72,11 @@ module SiSU
require_relative 'defaults' # defaults.rb
include SiSU_Viz
require_relative 'utils' # utils.rb
- require 'uri'
+ begin
+ require 'uri'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('uri NOT FOUND (LoadError)')
+ end
class HubMaster
def initialize(argv)
pwd_the=Dir.pwd
@@ -246,8 +250,12 @@ module SiSU
end
end
class Processing
- require 'fileutils'
- include FileUtils
+ begin
+ require 'fileutils'
+ include FileUtils
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('fileutils NOT FOUND (LoadError)')
+ end
@@env=nil
attr_accessor :op
def initialize(opt)
@@ -645,7 +653,11 @@ module SiSU
end
def actions
if @opt.act[:profile][:set]==:on
- require 'profile'
+ begin
+ require 'profile'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('profile NOT FOUND (LoadError)')
+ end
end
action_on_file_ =if @opt.act[:rsync][:set]==:on \
&& @opt.act[:site_init][:set]==:on
diff --git a/lib/sisu/v6/options.rb b/lib/sisu/v6/options.rb
index 632ac5a8..93d11acc 100644
--- a/lib/sisu/v6/options.rb
+++ b/lib/sisu/v6/options.rb
@@ -62,7 +62,11 @@
=end
module SiSU_Commandline
- require 'pathname'
+ begin
+ require 'pathname'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pathname NOT FOUND (LoadError)')
+ end
require_relative 'sysenv' # sysenv.rb
require_relative 'param_make' # param_make.rb
@@sisu_call_origin_path=nil
diff --git a/lib/sisu/v6/param.rb b/lib/sisu/v6/param.rb
index b74e0dc1..bc9bf9df 100644
--- a/lib/sisu/v6/param.rb
+++ b/lib/sisu/v6/param.rb
@@ -61,8 +61,12 @@
=end
module SiSU_Param
- require 'uri'
- require 'pstore'
+ begin
+ require 'uri'
+ require 'pstore'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('uri or pstore NOT FOUND (LoadError)')
+ end
require_relative 'sysenv' # sysenv.rb
include SiSU_Env
require_relative 'param_make' # param_make.rb
diff --git a/lib/sisu/v6/particulars.rb b/lib/sisu/v6/particulars.rb
index 44fa536a..7e850f4c 100644
--- a/lib/sisu/v6/particulars.rb
+++ b/lib/sisu/v6/particulars.rb
@@ -62,7 +62,11 @@
=end
module SiSU_Particulars
- require 'singleton'
+ begin
+ require 'singleton'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('singleton NOT FOUND (LoadError)')
+ end
require_relative 'sysenv' # sysenv.rb
include SiSU_Env
require_relative 'param' # param.rb
diff --git a/lib/sisu/v6/remote.rb b/lib/sisu/v6/remote.rb
index 3c4982c8..ed5d7fba 100644
--- a/lib/sisu/v6/remote.rb
+++ b/lib/sisu/v6/remote.rb
@@ -112,8 +112,12 @@ module SiSU_Remote
@tell=lambda { SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],@msg,"#{@msgs.inspect if @msgs}") }
end
def fns
- require 'open-uri'
- require 'pp'
+ begin
+ require 'open-uri'
+ require 'pp'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('open-uri or pp NOT FOUND (LoadError)')
+ end
require_relative 'composite' # composite.rb
@rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/
threads=[]
@@ -158,7 +162,11 @@ module SiSU_Remote
def sisupod
get_p=@get_s
if get_p.length > 0 #% remote sisupod
- require 'net/http'
+ begin
+ require 'net/http'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('net/http NOT FOUND (LoadError)')
+ end
for requested_pod in get_p
pod_info=RemoteDownload.new(requested_pod)
Net::HTTP.start(pod_info.pod.site) do |http|
diff --git a/lib/sisu/v6/rexml.rb b/lib/sisu/v6/rexml.rb
index f9b94cee..63e70a42 100644
--- a/lib/sisu/v6/rexml.rb
+++ b/lib/sisu/v6/rexml.rb
@@ -62,14 +62,22 @@
=end
module SiSU_Rexml
# load XML file for REXML parsing
- require 'rexml/document' if FileTest.directory?("#{Config::CONFIG['rubylibdir']}/rexml") #Config::CONFIG['sitedir']
+ begin
+ require 'rexml/document' if FileTest.directory?("#{Config::CONFIG['rubylibdir']}/rexml") #Config::CONFIG['sitedir']
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('rexml/document NOT FOUND (LoadError)')
+ end
require_relative 'param' # param.rb
include SiSU_Param
require_relative 'sysenv' # sysenv.rb
include SiSU_Env
include SiSU_Viz
class Rexml
- require 'rexml/document' if FileTest.directory?("#{Config::CONFIG['rubylibdir']}/rexml") #Config::CONFIG['sitedir']
+ begin
+ require 'rexml/document' if FileTest.directory?("#{Config::CONFIG['rubylibdir']}/rexml") #Config::CONFIG['sitedir']
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('rexml/document NOT FOUND (LoadError)')
+ end
def initialize(md,fno)
@md,@fno=md,fno
@env=SiSU_Env::InfoEnv.new(@md.fns)
diff --git a/lib/sisu/v6/shared_markup_alt.rb b/lib/sisu/v6/shared_markup_alt.rb
index b84d167a..4971dde0 100644
--- a/lib/sisu/v6/shared_markup_alt.rb
+++ b/lib/sisu/v6/shared_markup_alt.rb
@@ -208,7 +208,11 @@ module SiSU_TextRepresentation
end
@env ||=SiSU_Env::InfoEnv.new(@md.fns)
@sha_ =((@env.digest.type =='sha256') ? true : false)
- @sha_ ? (require 'digest/sha2') : (require 'digest/md5')
+ begin
+ @sha_ ? (require 'digest/sha2') : (require 'digest/md5')
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error((@sha_ ? 'digest/sha2' : 'digest/md5') + ' NOT FOUND')
+ end
end
def digest(txt)
d=nil
diff --git a/lib/sisu/v6/src_kdissert_share.rb b/lib/sisu/v6/src_kdissert_share.rb
index ecf559fb..9624e460 100644
--- a/lib/sisu/v6/src_kdissert_share.rb
+++ b/lib/sisu/v6/src_kdissert_share.rb
@@ -64,8 +64,12 @@ module SiSU_KdiSource
require_relative 'sysenv' # sysenv.rb
include SiSU_Env
class Source
- require 'fileutils'
- include FileUtils
+ begin
+ require 'fileutils'
+ include FileUtils
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('fileutils NOT FOUND (LoadError)')
+ end
def initialize(opt)
@opt=opt
@env=SiSU_Env::InfoEnv.new(@opt.fns)
diff --git a/lib/sisu/v6/sst_from_xml.rb b/lib/sisu/v6/sst_from_xml.rb
index 728f3f54..ee864b03 100644
--- a/lib/sisu/v6/sst_from_xml.rb
+++ b/lib/sisu/v6/sst_from_xml.rb
@@ -64,8 +64,12 @@
module SiSU_sstFromXML
require_relative 'sysenv' # sysenv.rb
class Convert
- require 'rexml/document'
- include REXML
+ begin
+ require 'rexml/document'
+ include REXML
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('rexml/document NOT FOUND (LoadError)')
+ end
def initialize(opt)
@opt=opt
@sisu,@sisu_base=[],[]
diff --git a/lib/sisu/v6/sysenv.rb b/lib/sisu/v6/sysenv.rb
index 46bb30ca..437d4088 100644
--- a/lib/sisu/v6/sysenv.rb
+++ b/lib/sisu/v6/sysenv.rb
@@ -66,12 +66,20 @@
module SiSU_Env
require_relative 'constants' # constants.rb
require_relative 'utils' # utils.rb
- require 'fileutils'
- include FileUtils::Verbose
- require 'singleton'
+ begin
+ require 'singleton'
+ require 'fileutils'
+ include FileUtils::Verbose
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('singleton or fileutils NOT FOUND (LoadError)')
+ end
@@noyaml=false
class InfoDate
- require 'date'
+ begin
+ require 'date'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('date NOT FOUND (LoadError)')
+ end
attr_accessor :dt,:t
def initialize
@dt,@t=Date.today.to_s,Time.now
@@ -97,7 +105,11 @@ module SiSU_Env
end
end
class InfoSystemGen
- require 'rbconfig'
+ begin
+ require 'rbconfig'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('rbconfig NOT FOUND (LoadError)')
+ end
@@user,@@home,@@hostname,@@pwd,@@sisu_etc,@@host,@@arch,@@rbver,@@dir_arch,@@dir_sitearch,@@dir_bin,@@locale,@@rc,@@sisurc_path,@@ad=ENV['USER'],ENV['HOME'],ENV['HOSTNAME'],ENV['PWD'],Config::CONFIG['sysconfdir'] + '/sisu',Config::CONFIG['host'],Config::CONFIG['arch'],%x{ruby -v}.strip,Config::CONFIG['archdir'],Config::CONFIG['sitearchdir'],Config::CONFIG['bindir'],%x{locale charmap}.strip,nil,nil,{} # %x{ruby -v}.strip # Config::CONFIG['rb_ver']
out=Config::CONFIG['localstatedir']
etc=Config::CONFIG['sysconfdir'] + '/sisu'
@@ -242,10 +254,18 @@ module SiSU_Env
end
if load_prog \
and @prog=~/dbi/
- require 'dbi' #revisit
+ begin
+ require 'dbi'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('dbi NOT FOUND (LoadError)')
+ end
end
if load_prog
- require @prog
+ begin
+ require @prog
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error("#{@prog} NOT FOUND (LoadError)")
+ end
else
@mandatory \
? (SiSU_Screen::Ansi.new(@prog,"*WARN* module required: #{@prog}").warn)
@@ -330,7 +350,11 @@ module SiSU_Env
f=S_CONF[:rc_yml]
p_f="#{v}/#{f}"
if FileTest.exist?(p_f)
- require 'yaml'
+ begin
+ require 'yaml'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('yaml NOT FOUND (LoadError)')
+ end
@@sisurc_path=v
@@rc=YAML::load(File::open(p_f))
break
@@ -339,7 +363,11 @@ module SiSU_Env
f='sisurc.yaml'
p_f="#{v}/#{f}"
if FileTest.exist?(p_f)
- require 'yaml'
+ begin
+ require 'yaml'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('yaml NOT FOUND (LoadError)')
+ end
@@sisurc_path=v
@@rc=YAML::load(File::open(p_f))
break
@@ -378,7 +406,11 @@ module SiSU_Env
else
if FileTest.exist?("#{v}/list.yml")
unless @@ad[:promo_list]
- require 'yaml'
+ begin
+ require 'yaml'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('yaml NOT FOUND (LoadError)')
+ end
@@ad[:promo_list] ||= YAML::load(File::open("#{v}/list.yml"))
end
@@ad[:flag_promo]=true
@@ -396,7 +428,11 @@ module SiSU_Env
else
if FileTest.exist?("#{v}/promo.yml")
unless @@ad[:promo]
- require 'yaml'
+ begin
+ require 'yaml'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('yaml NOT FOUND (LoadError)')
+ end
@@ad[:promo] ||= YAML::load(File::open("#{v}/promo.yml"))
end
@@ad[:flag_promo]=true
@@ -1030,9 +1066,13 @@ module SiSU_Env
end
end
class InfoEnv < EnvCall
- require 'pathname'
- require 'fileutils'
- include FileUtils
+ begin
+ require 'pathname'
+ require 'fileutils'
+ include FileUtils
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pathname or fileutils NOT FOUND (LoadError)')
+ end
attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:stub_pwd,:stub_src,:webserv_host_cgi,:webserv_port_cgi,:processing,:processing_git,:etc,:yamlrc_dir
@@image_flag,@@local_image=true,true #warning on @@image_flag
@@fb,@@man_path=nil,nil
@@ -3169,8 +3209,12 @@ WOK
end
end
class CleanOutput
- require 'fileutils'
- include FileUtils::Verbose
+ begin
+ require 'fileutils'
+ include FileUtils::Verbose
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('fileutils NOT FOUND (LoadError)')
+ end
def initialize(opt)
@opt=opt
z=SiSU_Env::FileMap.new(opt)
@@ -3326,7 +3370,11 @@ WOK
end
class InfoRemote < FileMap
@@flag_remote=false
- require 'socket'
+ begin
+ require 'socket'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('socket NOT FOUND (LoadError)')
+ end
def initialize(opt)
super(opt) #
@opt=opt
@@ -3674,8 +3722,12 @@ WOK
end
class InfoVersion
" unless x =~/^(\.)+$/ }
diff --git a/lib/sisu/v6/xhtml_epub2.rb b/lib/sisu/v6/xhtml_epub2.rb
index 6447431f..1d4305ab 100644
--- a/lib/sisu/v6/xhtml_epub2.rb
+++ b/lib/sisu/v6/xhtml_epub2.rb
@@ -61,7 +61,11 @@
=end
module SiSU_XHTML_EPUB2
- require 'pstore'
+ begin
+ require 'pstore'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pstore NOT FOUND (LoadError)')
+ end
require_relative 'particulars' # particulars.rb
include SiSU_Particulars
require_relative 'defaults' # defaults.rb
diff --git a/lib/sisu/v6/xml_fictionbook2.rb b/lib/sisu/v6/xml_fictionbook2.rb
index 9cd7909e..0498a7f0 100644
--- a/lib/sisu/v6/xml_fictionbook2.rb
+++ b/lib/sisu/v6/xml_fictionbook2.rb
@@ -227,7 +227,11 @@ module SiSU_XML_Fictionbook
endnotes
end
def extract_images #work on
- require "base64"
+ begin
+ require 'base64'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('base64 NOT FOUND (LoadError)')
+ end
images_raw,images_base64_fb2=[],[]
images_base64={}
if defined? @md.make.cover_image[:cover]
diff --git a/lib/sisu/v6/xml_odf_odt.rb b/lib/sisu/v6/xml_odf_odt.rb
index bf9d8df8..b478805f 100644
--- a/lib/sisu/v6/xml_odf_odt.rb
+++ b/lib/sisu/v6/xml_odf_odt.rb
@@ -73,8 +73,12 @@ module SiSU_XML_ODF_ODT
require_relative 'txt_shared' # txt_shared.rb
@@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0
class Source
- require 'zlib'
- require 'find'
+ begin
+ require 'zlib'
+ require 'find'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('zlib or find NOT FOUND (LoadError)')
+ end
def initialize(opt)
@opt=opt
@particulars=SiSU_Particulars::CombinedSingleton.instance.get_all(opt)
--
cgit v1.2.3
From 62e27667a98e1daeb7b6dbbb788af58be6871a25 Mon Sep 17 00:00:00 2001
From: Ralph Amissah
'
- %{#{linkname}}
+ %{#{linkname}}
end
txt_obj={ txt: title }
format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj)
@@ -398,7 +399,7 @@ WOK
end
else
@@toc[:scr] << '
'
- %{#{linkname}}
+ %{#{linkname}}
end
txt_obj={ txt: title }
format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj)
@@ -515,7 +516,7 @@ WOK
}
f=@md.file.base_filename.html_seg(fnh)
p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)
- lnk_n_txt=%{
+ lnk_n_txt=%{
#{linkname}
}
txt_obj={ txt: lnk_n_txt }
@@ -540,7 +541,7 @@ WOK
}
f=@md.file.base_filename.html_seg(fnh)
p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)
- lnk_n_txt=%{
+ lnk_n_txt=%{
#{linkname}
}
txt_obj={ txt: lnk_n_txt }
diff --git a/lib/sisu/v5/html_format.rb b/lib/sisu/v5/html_format.rb
index 0dc65a06..e0be4f8a 100644
--- a/lib/sisu/v5/html_format.rb
+++ b/lib/sisu/v5/html_format.rb
@@ -66,30 +66,36 @@ module SiSU_HTML_Format
def initialize(md,ocn)
@md,@ocn=md,ocn.to_s
@ocn ||=''
+ @ocn_html_identifier=SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier
+ @make=SiSU_Env::ProcessingSettings.new(@md)
end
def ocn_display
- make=SiSU_Env::ProcessingSettings.new(@md)
- if make.build.ocn?
- ocn_class='ocn'
+ if @make.build.ocn?
if @ocn.to_i==0 \
or @ocn.empty?
- %{}
+ ''
else
+ name=(@make.build.html_strict?) ? '' : %{ name="#{@ocn}"}
@ocn.gsub(/^(\d+|)$/,
- %{})
+ %{})
end
else
- %{}
+ ''
end
end
def name
- (@ocn==nil || @ocn.empty?) ? '' : %{}
+ if @make.build.html_strict? \
+ or @ocn==(nil || @ocn.empty?)
+ ''
+ else
+ %{}
+ end
end
def id #w3c? "tidy" complains about numbers as identifiers ! annoying
(@ocn==nil || @ocn.empty?) ? '' : %{id="o#{@ocn}"}
end
def goto
- (@ocn==nil || @ocn.empty?) ? '' : %{}
+ (@ocn==nil || @ocn.empty?) ? '' : %{}
end
end
class HeadInformation
@@ -1233,6 +1239,7 @@ WOK
end
def subtoc_lev(tag,attrib)
@txt=clean(@txt)
+ @ocn_html_identifier=SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier
txt=if @txt \
and @txt =~/<\/?i>|/mi
@txt.gsub(/<\/?i>|/mi,'') #removes name markers from subtoc, go directly to substantive text
@@ -1246,7 +1253,7 @@ WOK
gsub(/ \d+<\/sup> /m,'')
end
%{<#{tag} class="#{attrib}">
- #{txt} #{note}
+ #{txt} #{note}
#{tag}>}
end
def subtoc_lev5
diff --git a/lib/sisu/v5/html_lite_shared.rb b/lib/sisu/v5/html_lite_shared.rb
index 8c447352..e109debc 100644
--- a/lib/sisu/v5/html_lite_shared.rb
+++ b/lib/sisu/v5/html_lite_shared.rb
@@ -83,6 +83,7 @@ module SiSU_FormatShared
end
@tab="\t"
@brace_url=SiSU_Viz::Defaults.new.url_decoration
+ @ocn_html_identifier=SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier
@@tablehead,@@tablefoot=[],[]
@vz=SiSU_Viz::Defaults.new
@env=SiSU_Env::InfoEnv.new(@md.fns)
@@ -205,7 +206,7 @@ GSUB
%{
#{h[:txt]}
\n} << "\n" end def lev_toc_hname - %{\n} #<< "\n" + %{\n} #<< "\n" end def lev_toc h={ txt: txt, class: "toc#{@lv}", type: 'toc' } @@ -309,10 +310,10 @@ GSUB def paragraph attrib=%{class="#{@attrib}" } if @ocn - id=%{id="#{@ocn}" } + id=%{id="#{Mx[:ocn_id_char]}#{@ocn}" } type=%{type="substantive" } else - id=%{id="none" } + id='' type=%{type="comment" } end header=%{header="#{@hname}" } if @hname diff --git a/lib/sisu/v6/html_minitoc.rb b/lib/sisu/v6/html_minitoc.rb index 0bb2794f..13045b0d 100644 --- a/lib/sisu/v6/html_minitoc.rb +++ b/lib/sisu/v6/html_minitoc.rb @@ -71,6 +71,7 @@ def initialize(md,data) @md,@data=md,data @pat_strip_heading_name=/(.+?)<\/a>/ + @ocn_html_identifier=SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier @tell=SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set]) if @md end def songsheet @@ -204,7 +205,7 @@ fn: @@seg_url, } f=@md.file.base_filename.html_seg(fnh) - lnk_n_txt=%{ + lnk_n_txt=%{ #{txt.obj} } txt_obj={ txt: lnk_n_txt } @@ -223,7 +224,7 @@ fn: @@seg_url, } f=@md.file.base_filename.html_seg(fnh) - lnk_n_txt=%{ + lnk_n_txt=%{ #{txt.obj} } txt_obj={ txt: lnk_n_txt } diff --git a/lib/sisu/v6/txt_plain.rb b/lib/sisu/v6/txt_plain.rb index bb97f679..1aa08f0e 100644 --- a/lib/sisu/v6/txt_plain.rb +++ b/lib/sisu/v6/txt_plain.rb @@ -400,7 +400,8 @@ WOK @@endnotes[:para]=[] end def ocn_display(dob) - if @env.plaintext_ocn? + make=SiSU_Env::ProcessingSettings.new(@md) + if make.build.plaintext_ocn? if defined? dob.ocn \ and dob.ocn.is_a?(Fixnum) (defined? dob.ocn) ? "\n#{Dx[:ocn_o]}#{dob.ocn}#{Dx[:ocn_c]}" : '' diff --git a/lib/sisu/v6/xml_odf_odt.rb b/lib/sisu/v6/xml_odf_odt.rb index 707e7a20..0457ad7d 100644 --- a/lib/sisu/v6/xml_odf_odt.rb +++ b/lib/sisu/v6/xml_odf_odt.rb @@ -121,6 +121,7 @@ module SiSU_XML_ODF_ODT @@fns=nil def initialize(particulars) @md,@env,@ao_array=particulars.md,particulars.env,particulars.ao_array + @make=SiSU_Env::ProcessingSettings.new(@md) @vz=SiSU_Viz::Defaults.new @tab="\t" @brace_url=SiSU_Viz::Defaults.new.url_decoration @@ -556,10 +557,10 @@ module SiSU_XML_ODF_ODT end p_num={ display: '', set_ref: '' } if dob.is !~/(^#{Rx[:meta]}|#{Mx[:br_eof]}|#{Mx[:br_endnotes]})/ - if @env.odt_ocn? + if @make.build.odt_ocn? if defined? dob.ocn \ and dob.ocn.is_a?(Fixnum) - p_num=SiSU_XML_ODF_ODT_Format::ParagraphNumber.new(dob.ocn).set_bookmark_and_display + p_num=SiSU_XML_ODF_ODT_Format::ParagraphNumber.new(@make,dob.ocn).set_bookmark_and_display end end end @@ -682,7 +683,7 @@ module SiSU_XML_ODF_ODT and (dob.obj =~/~metadata/ or dob =~/#{Mx[:lv_o]}1:meta#{Mx[:lv_x]}\s*Document Information/) #fix Mx[:lv_o] if dob.is !~/(^#{Rx[:meta]}|#{Mx[:br_eof]}|#{Mx[:br_endnotes]})/ #check if defined? dob.ocn and dob.ocn =~/\d+/ - @p_num=SiSU_XML_ODF_ODT_Format::ParagraphNumber.new(dob.ocn) + @p_num=SiSU_XML_ODF_ODT_Format::ParagraphNumber.new(@make,dob.ocn) end if dob.is ==:heading \ || dob.is ==:para \ diff --git a/lib/sisu/v6/xml_odf_odt_format.rb b/lib/sisu/v6/xml_odf_odt_format.rb index bc7fadea..b2539dfd 100644 --- a/lib/sisu/v6/xml_odf_odt_format.rb +++ b/lib/sisu/v6/xml_odf_odt_format.rb @@ -65,17 +65,26 @@ module SiSU_XML_ODF_ODT_Format include SiSU_Param include SiSU_Viz class ParagraphNumber - def initialize(paranum) + def initialize(make,paranum) + @make=make @paranum=/(\d+)/m.match(paranum.to_s)[1] end def set_ref_and_display - set_ref=@paranum.gsub(/(\d+)/,'Rights: #{rights}
} end @@ -977,7 +978,9 @@ WOK end def para_form_css(tag,attrib) # regular paragraphs shaped here ul=ulc='' - ul,ulc="Rights: #{rights}
} end @@ -977,7 +978,9 @@ WOK end def para_form_css(tag,attrib) # regular paragraphs shaped here ul=ulc='' - ul,ulc="