aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-04-19 21:37:52 -0400
committerRalph Amissah <ralph@amissah.com>2011-04-19 21:37:52 -0400
commit44464e284ee840ee0ef7eae2d3f8d589680b18ca (patch)
tree7967e499e253737a4d8573e9c903ee714be1e762
parentv3: options, hub, introduce opt.act booleans, more setting in options (diff)
v3: param, md remove md.cmd and md.mod shortcut methods, use use md.opt
* affects many files that now use @md.opt.cmd & @md.opt.mod (instead of @md.cmd & @md.mod)
-rw-r--r--data/doc/sisu/CHANGELOG_v35
-rw-r--r--lib/sisu/v3/concordance.rb22
-rw-r--r--lib/sisu/v3/dal.rb6
-rw-r--r--lib/sisu/v3/dal_doc_str.rb16
-rw-r--r--lib/sisu/v3/dal_endnotes.rb4
-rw-r--r--lib/sisu/v3/dal_idx.rb14
-rw-r--r--lib/sisu/v3/dal_images.rb10
-rw-r--r--lib/sisu/v3/dal_numbering.rb10
-rw-r--r--lib/sisu/v3/db_columns.rb8
-rw-r--r--lib/sisu/v3/db_load_tuple.rb6
-rw-r--r--lib/sisu/v3/db_sqltxt.rb4
-rw-r--r--lib/sisu/v3/digests.rb12
-rw-r--r--lib/sisu/v3/embedded.rb12
-rw-r--r--lib/sisu/v3/epub.rb22
-rw-r--r--lib/sisu/v3/epub_concordance.rb14
-rw-r--r--lib/sisu/v3/epub_format.rb4
-rw-r--r--lib/sisu/v3/epub_segments.rb4
-rw-r--r--lib/sisu/v3/epub_tune.rb10
-rw-r--r--lib/sisu/v3/html.rb20
-rw-r--r--lib/sisu/v3/html_format.rb4
-rw-r--r--lib/sisu/v3/html_minitoc.rb4
-rw-r--r--lib/sisu/v3/html_promo.rb2
-rw-r--r--lib/sisu/v3/html_scroll.rb2
-rw-r--r--lib/sisu/v3/html_segments.rb8
-rw-r--r--lib/sisu/v3/html_tune.rb12
-rw-r--r--lib/sisu/v3/manifest.rb12
-rw-r--r--lib/sisu/v3/odf.rb12
-rw-r--r--lib/sisu/v3/param.rb52
-rw-r--r--lib/sisu/v3/plaintext.rb4
-rw-r--r--lib/sisu/v3/po4a.rb34
-rw-r--r--lib/sisu/v3/rexml.rb10
-rw-r--r--lib/sisu/v3/shared_markup_alt.rb2
-rw-r--r--lib/sisu/v3/sst_do_inline_footnotes.rb14
-rw-r--r--lib/sisu/v3/sst_to_s_xml_sax.rb16
-rw-r--r--lib/sisu/v3/sysenv.rb66
-rw-r--r--lib/sisu/v3/texinfo.rb6
-rw-r--r--lib/sisu/v3/texpdf.rb50
-rw-r--r--lib/sisu/v3/texpdf_format.rb12
-rw-r--r--lib/sisu/v3/update.rb4
-rw-r--r--lib/sisu/v3/xhtml.rb16
-rw-r--r--lib/sisu/v3/xml.rb16
-rw-r--r--lib/sisu/v3/xml_dom.rb16
-rw-r--r--lib/sisu/v3/xml_fictionbook.rb6
-rw-r--r--lib/sisu/v3/xml_format.rb4
-rw-r--r--lib/sisu/v3/xml_scaffold.rb4
45 files changed, 298 insertions, 293 deletions
diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3
index b584eee7..9f06f48b 100644
--- a/data/doc/sisu/CHANGELOG_v3
+++ b/data/doc/sisu/CHANGELOG_v3
@@ -20,6 +20,11 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.0.7.orig.tar.gz
sisu_3.0.7-1.dsc
sisu_3.0.7-1.debian.tar.gz
+ * param, md remove md.cmd and md.mod shortcut methods, use use md.opt
+ (md.opt.cmd md.opt.mod)
+ * affects many files that now use @md.opt.cmd & @md.opt.mod
+ (instead of @md.cmd & @md.mod)
+
* options
* new alias (for -M / --maintenance) --keep-processing-files (see Bug#622902)
* introduce opt.act booleans made up of opt.cmd and opt.mod, more flexible
diff --git a/lib/sisu/v3/concordance.rb b/lib/sisu/v3/concordance.rb
index d979a6c9..8b70fdc5 100644
--- a/lib/sisu/v3/concordance.rb
+++ b/lib/sisu/v3/concordance.rb
@@ -76,24 +76,24 @@ module SiSU_Concordance
begin
@env,@md=@particulars.env,@particulars.md
loc=@env.url.output_tell
- unless @md.cmd =~/q/
- tool=(@md.cmd =~/[MVv]/) ? "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:concordance]}" : @md.fns
- @md.cmd=~/[MVvz]/ \
- ? SiSU_Screen::Ansi.new(@md.cmd,"Concordance",tool).grey_title_hi \
- : SiSU_Screen::Ansi.new(@md.cmd,'Concordance',tool).green_title_hi
+ unless @md.opt.cmd =~/q/
+ tool=(@md.opt.cmd =~/[MVv]/) ? "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:concordance]}" : @md.fns
+ @md.opt.cmd=~/[MVvz]/ \
+ ? SiSU_Screen::Ansi.new(@md.opt.cmd,"Concordance",tool).grey_title_hi \
+ : SiSU_Screen::Ansi.new(@md.opt.cmd,'Concordance',tool).green_title_hi
end
wordmax=@env.concord_max
unless @md.wc_words.nil?
if @md.wc_words < wordmax
SiSU_Concordance::Source::Words.new(@particulars).songsheet
else
- SiSU_Screen::Ansi.new(@md.cmd,"concordance skipped, large document has over #{wordmax} words (#{@md.wc_words})").warn unless @md.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"concordance skipped, large document has over #{wordmax} words (#{@md.wc_words})").warn unless @md.opt.cmd =~/q/
end
else
- SiSU_Screen::Ansi.new(@md.cmd,"wc (word count) is off, concordance will be processed for all files including those over the max set size of: #{wordmax} words").warn unless @md.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"wc (word count) is off, concordance will be processed for all files including those over the max set size of: #{wordmax} words").warn unless @md.opt.cmd =~/q/
SiSU_Concordance::Source::Words.new(@particulars).songsheet
end
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
end
end
@@ -197,7 +197,7 @@ WOK
@rxp_excluded0=/^(?:#{Mx[:fa_bold_o]}|#{Mx[:fa_italics_o]})?(?:to\d+|\d+|&nbsp;|#{Mx[:br_endnotes]}|EOF|#{Mx[:br_eof]}|thumb_\S+|snap_\S+|_+|-+|[(]?(?:ii+|iv|vi+|ix|xi+|xiv|xv|xvi+|xix|xx)[).]?|\S+?_\S+|[\d_]+\w\S+|[\w\d]{1,2}|\d{1,3}\w?|#{@dp}|[0-9a-f]{16,64}|\d{2,3}x\d{2,3}|\S{0,2}sha\d|\S{0,3}\d{4}w\d\d|\b\w\d+|\d_all\b|e\.?g\.?)(?:#{Mx[:fa_bold_c]}|#{Mx[:fa_italics_c]})?$/mi #this regex causes and cures a stack dump in ruby 1.9 !!!
@rgx_splitlist=%r{[—.,;:#{Mx[:nbsp]}-]}mi
@rgx_scanlist=%r{#{Mx[:fa_italics_o]}[a-zA-Z0-9"\s]{2,12}#{Mx[:fa_italics_c]}|#{Mx[:fa_bold_o]}[a-zA-Z0-9"\s]{2,12}#{Mx[:fa_bold_c]}|(?:https?|file)://\S+|<\S+?>|\w+|[a-zA-Z]+}mi
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
end
end
def songsheet
@@ -205,7 +205,7 @@ WOK
mkdir_p(@file.output_path.html_concordance) unless FileTest.directory?(@file.output_path.html_concordance)
@file_concordance=File.open(@file.place_file.html_concordance,'w')
map_para
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
@file_concordance.close
end
@@ -337,7 +337,7 @@ WOK
end
credits=@vz.credits_sisu
@file_concordance << %{</div></body>\n</html>} # footer
- SiSU_Screen::Ansi.new(@md.cmd,@md.fns,"#{@env.path.output_tell}/#{@md.fn[:concordance]}").flow if @md.cmd =~/[MV]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,@md.fns,"#{@env.path.output_tell}/#{@md.fn[:concordance]}").flow if @md.opt.cmd =~/[MV]/
end
end
end
diff --git a/lib/sisu/v3/dal.rb b/lib/sisu/v3/dal.rb
index 13414826..a25f0f99 100644
--- a/lib/sisu/v3/dal.rb
+++ b/lib/sisu/v3/dal.rb
@@ -379,7 +379,7 @@ module SiSU_DAL
end
end
def hard_output
- if @md.cmd =~/M/
+ if @md.opt.cmd =~/M/
filename_meta=@cf.metaverse.file_meta
@data.each {|o| filename_meta.puts o.inspect.sub(/:0x[0-9a-f]{8}\s/,': ')} #to make diffing easier
filename_txt=@cf.metaverse.file_txt
@@ -426,7 +426,7 @@ module SiSU_DAL
end
def idx_html_hard_output
if @md.book_idx \
- and @md.cmd =~/M/
+ and @md.opt.cmd =~/M/
filename_meta=@cf.file_meta_idx_html
unless @data.nil? #REMOVE earliest possible
@data.each {|s| p s.inspect + "\n" unless s.class==String}
@@ -485,7 +485,7 @@ module SiSU_DAL
data,book_index_rel,book_index_rel_html_seg,html_idx,xhtml_idx=SiSU_book_index::Book_index.new(@md,data,@env).indexing_song if @md.book_idx # dal_idx.rb
data=SiSU_endnotes::Endnotes.new(@md,data,endnote_array).endnotes # dal_endnotes.rb
outputdata=data
- if @md.cmd =~/[mM]/
+ if @md.opt.cmd =~/[mM]/
SiSU_DAL::Output.new(@fn,@md,outputdata).hard_output
SiSU_DAL::Output.new(@fn,@md,outputdata).make_marshal_content
SiSU_DAL::Output.new(@fn,@md,metadata).make_marshal_metadata
diff --git a/lib/sisu/v3/dal_doc_str.rb b/lib/sisu/v3/dal_doc_str.rb
index 09635066..61348d28 100644
--- a/lib/sisu/v3/dal_doc_str.rb
+++ b/lib/sisu/v3/dal_doc_str.rb
@@ -948,7 +948,7 @@ module SiSU_document_structure_extract
hs=[0,false,false,false]
t={ lv: @s[0], status: 'open' }
tuned_file << tags(t)
- if @md.cmd =~/V/
+ if @md.opt.cmd =~/V/
puts "\nXML sisu structure outline --->\n"
puts "<#{@s[0]}>"
end
@@ -958,7 +958,7 @@ module SiSU_document_structure_extract
when 1
tuned_file << tag_close(o.ln,hs)
tuned_file << tag_open(o,@s)
- if @md.cmd =~/V/
+ if @md.opt.cmd =~/V/
puts_tag_close(o.ln,hs)
puts_tag_open(o,@s)
end
@@ -966,7 +966,7 @@ module SiSU_document_structure_extract
when 2
tuned_file << tag_close(o.ln,hs)
tuned_file << tag_open(o,@s)
- if @md.cmd =~/V/
+ if @md.opt.cmd =~/V/
puts_tag_close(o.ln,hs)
puts_tag_open(o,@s)
end
@@ -974,7 +974,7 @@ module SiSU_document_structure_extract
when 3
tuned_file << tag_close(o.ln,hs)
tuned_file << tag_open(o,@s)
- if @md.cmd =~/V/
+ if @md.opt.cmd =~/V/
puts_tag_close(o.ln,hs)
puts_tag_open(o,@s)
end
@@ -982,7 +982,7 @@ module SiSU_document_structure_extract
when 4
tuned_file << tag_close(o.ln,hs)
tuned_file << tag_open(o,@s)
- if @md.cmd =~/V/
+ if @md.opt.cmd =~/V/
puts_tag_close(o.ln,hs)
puts_tag_open(o,@s)
end
@@ -990,7 +990,7 @@ module SiSU_document_structure_extract
when 5
tuned_file << tag_close(o.ln,hs)
tuned_file << tag_open(o,@s)
- if @md.cmd =~/V/
+ if @md.opt.cmd =~/V/
puts_tag_close(o.ln,hs)
puts_tag_open(o,@s)
end
@@ -998,7 +998,7 @@ module SiSU_document_structure_extract
when 6
tuned_file << tag_close(o.ln,hs)
tuned_file << tag_open(o,@s)
- if @md.cmd =~/V/
+ if @md.opt.cmd =~/V/
puts_tag_close(o.ln,hs)
puts_tag_open(o,@s)
end
@@ -1007,7 +1007,7 @@ module SiSU_document_structure_extract
end
tuned_file << o
end
- puts_tag_close(0,hs) if @md.cmd =~/V/
+ puts_tag_close(0,hs) if @md.opt.cmd =~/V/
tuned_file << tag_close(0,hs)
tuned_file.flatten!
tuned_file
diff --git a/lib/sisu/v3/dal_endnotes.rb b/lib/sisu/v3/dal_endnotes.rb
index e0b4a57d..58ac8d0c 100644
--- a/lib/sisu/v3/dal_endnotes.rb
+++ b/lib/sisu/v3/dal_endnotes.rb
@@ -68,10 +68,10 @@ module SiSU_endnotes
endnote_no,endnote_ref=1,1
data.each do |dob|
# manually numbered endnotes <!e(\d)!> <!e_(\d)!> -->
- if @md.mod.inspect =~/--no-asterisk|--no-annotate/
+ if @md.opt.mod.inspect =~/--no-asterisk|--no-annotate/
dob.obj.gsub!(/#{Mx[:en_b_o]}\s.+?#{Mx[:en_b_c]}/,'')
end
- if @md.mod.inspect =~/--no-dagger|--no-annotate/
+ if @md.opt.mod.inspect =~/--no-dagger|--no-annotate/
dob.obj.gsub!(/#{Mx[:en_b_o]}[+]\s.+?#{Mx[:en_b_c]}/,'')
end
if defined? dob.obj \
diff --git a/lib/sisu/v3/dal_idx.rb b/lib/sisu/v3/dal_idx.rb
index dd2b1331..ad1b5efb 100644
--- a/lib/sisu/v3/dal_idx.rb
+++ b/lib/sisu/v3/dal_idx.rb
@@ -216,7 +216,7 @@ module SiSU_book_index
@t=idx[:sst_rel].index(idx[:sst_rel].last)
@q=idx[:html].index(idx[:html].last)
@r=idx[:xhtml].index(idx[:xhtml].last)
- print "\n" + x + ', ' if @md.cmd =~/V/
+ print "\n" + x + ', ' if @md.opt.cmd =~/V/
elsif x.class==Array
p 'array error? -->'
print x
@@ -228,13 +228,13 @@ module SiSU_book_index
idx[:sst_rel][@t]=idx[:sst_rel][@t] + %{#{Mx[:lnk_o]}#{a[:range]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{a[:ocn]}#{Mx[:rel_c]}, }
idx[:html][@q]=idx[:html][@q] + %{<a href="#{a[:seg]}.html##{a[:ocn]}">#{a[:range]}</a>, }
idx[:xhtml][@q]=idx[:xhtml][@q] + %{<a href="#{a[:seg]}.xhtml#o#{a[:ocn]}">#{a[:range]}</a>, }
- print a[:range] + ', ' if @md.cmd =~/V/
+ print a[:range] + ', ' if @md.opt.cmd =~/V/
elsif a[:ocn]
idx[:sst_rel_html_seg][@o]=idx[:sst_rel_html_seg][@o] + %{#{Mx[:lnk_o]}#{a[:ocn]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{a[:seg]}.html##{a[:ocn]}#{Mx[:rel_c]}, }
idx[:sst_rel][@t]=idx[:sst_rel][@t] + %{#{Mx[:lnk_o]}#{a[:ocn]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{a[:ocn]}#{Mx[:rel_c]}, }
idx[:html][@q]=idx[:html][@q] + %{<a href="#{a[:seg]}.html##{a[:ocn]}">#{a[:ocn]}</a>, }
idx[:xhtml][@q]=idx[:xhtml][@q] + %{<a href="#{a[:seg]}.xhtml#o#{a[:ocn]}">#{a[:ocn]}</a>, }
- print a[:ocn] + ', ' if @md.cmd =~/V/
+ print a[:ocn] + ', ' if @md.opt.cmd =~/V/
else p 'error'
end
end
@@ -251,20 +251,20 @@ module SiSU_book_index
idx[:html][@q]=idx[:html][@q] + %{\n<p class="book_index_lev2">#{k}, }
c=clean_xml(k.dup)
idx[:xhtml][@r]=idx[:xhtml][@r] + %{\n<p class="book_index_lev2">#{c}, }
- print "\n\t" + k + ', ' if @md.cmd =~/V/
+ print "\n\t" + k + ', ' if @md.opt.cmd =~/V/
y.each do |z|
if z[:range]
idx[:sst_rel_html_seg][@o]=idx[:sst_rel_html_seg][@o] + %{#{Mx[:lnk_o]}#{z[:range]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{z[:seg]}.html##{z[:ocn]}#{Mx[:rel_c]}, }
idx[:sst_rel][@t]=idx[:sst_rel][@t] + %{#{Mx[:lnk_o]}#{z[:range]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{z[:ocn]}#{Mx[:rel_c]}, }
idx[:html][@q]=idx[:html][@q] + %{<a href="#{z[:seg]}.html##{z[:ocn]}">#{z[:range]}</a>, }
idx[:xhtml][@q]=idx[:xhtml][@q] + %{<a href="#{z[:seg]}.xhtml#o#{z[:ocn]}">#{z[:range]}</a>, }
- print z[:range] + ', ' if @md.cmd =~/V/
+ print z[:range] + ', ' if @md.opt.cmd =~/V/
elsif z[:ocn]
idx[:sst_rel_html_seg][@o]=idx[:sst_rel_html_seg][@o] + %{#{Mx[:lnk_o]}#{z[:ocn]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{z[:seg]}.html##{z[:ocn]}#{Mx[:rel_c]}, }
idx[:sst_rel][@t]=idx[:sst_rel][@t] + %{#{Mx[:lnk_o]}#{z[:ocn]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{z[:ocn]}#{Mx[:rel_c]}, }
idx[:html][@q]=idx[:html][@q] + %{<a href="#{z[:seg]}.html##{z[:ocn]}">#{z[:ocn]}</a>, }
idx[:xhtml][@q]=idx[:xhtml][@q] + %{<a href="#{z[:seg]}.xhtml#o#{z[:ocn]}">#{z[:ocn]}</a>, }
- print z[:ocn] + ', ' if @md.cmd =~/V/
+ print z[:ocn] + ', ' if @md.opt.cmd =~/V/
else p 'error'
end
end
@@ -278,7 +278,7 @@ module SiSU_book_index
end
end
end
- print "\n" if @md.cmd =~/V/
+ print "\n" if @md.opt.cmd =~/V/
idx
end
def screen_print(the_idx)
diff --git a/lib/sisu/v3/dal_images.rb b/lib/sisu/v3/dal_images.rb
index 8c7e9f94..c2088874 100644
--- a/lib/sisu/v3/dal_images.rb
+++ b/lib/sisu/v3/dal_images.rb
@@ -75,8 +75,8 @@ module SiSU_images
@rmgk=false
end
else
- if @md.cmd =~/[vVM]/
- SiSU_Screen::Ansi.new(@md.cmd,'use of RMagick is not enabled in sisurc.yml').warn
+ if @md.opt.cmd =~/[vVM]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'use of RMagick is not enabled in sisurc.yml').warn
end
end
data.each do |dob|
@@ -101,8 +101,8 @@ module SiSU_images
img=Magick::ImageList.new("#{image_path}/#{image}")
img_col,img_row=img.columns,img.rows
else
- if @md.cmd =~/[vVM]/
- SiSU_Screen::Ansi.new(@md.cmd,'RMagick not present, will attempt to use imagemagick (identify) directly').warn
+ if @md.opt.cmd =~/[vVM]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'RMagick not present, will attempt to use imagemagick (identify) directly').warn
end
imgk=SiSU_Env::System_call.new.imagemagick
gmgk=SiSU_Env::System_call.new.graphicksmagick
@@ -139,7 +139,7 @@ module SiSU_images
end
else
images=dob.obj.scan(m) do |image|
- SiSU_Screen::Ansi.new(@md.cmd,'where image dimensions have not been provided RMagick or imagemagick is required',image).warn #unless @opt.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'where image dimensions have not been provided RMagick or imagemagick is required',image).warn #unless @opt.cmd =~/q/
end
end
end
diff --git a/lib/sisu/v3/dal_numbering.rb b/lib/sisu/v3/dal_numbering.rb
index 7a0c4365..0a49c3da 100644
--- a/lib/sisu/v3/dal_numbering.rb
+++ b/lib/sisu/v3/dal_numbering.rb
@@ -282,7 +282,7 @@ module SiSU_numbering
tags={}
art_filename_auto=1
@counter=1
- if not @md.seg_autoname_safe and @md.cmd =~/[MV]/
+ if not @md.seg_autoname_safe and @md.opt.cmd =~/[MV]/
puts 'manual segment names, numbers used as names, risk warning (segmented html)'
end
ocn_html_seg=[]
@@ -305,7 +305,7 @@ module SiSU_numbering
dob.name=possible_seg_name
dob.tags=[dob.name,dob.tags].flatten if dob.name !~/^\d+$/
@md.seg_names << possible_seg_name
- else puts 'warn, there may be a conflicting numbering scheme' if @md.cmd =~/[VM]/
+ else puts 'warn, there may be a conflicting numbering scheme' if @md.opt.cmd =~/[VM]/
end
end
if dob.ln==4 \
@@ -399,7 +399,7 @@ module SiSU_numbering
end
def set_heading_top(data) #% make sure no false positives
unless @md.set_heading_top
- puts "\tdocument contains no top level heading, (will have to manufacture one)" if @md.cmd =~/[MV]/
+ puts "\tdocument contains no top level heading, (will have to manufacture one)" if @md.opt.cmd =~/[MV]/
@tuned_file=[]
data.each do |t_o|
unless @md.set_heading_top
@@ -423,7 +423,7 @@ module SiSU_numbering
end
def set_heading_seg(data) #% make sure no false positives
unless @md.set_heading_seg
- puts "\tdocument contains no segment level, (will have to manufacture one)" if @md.cmd =~/[MV]/
+ puts "\tdocument contains no segment level, (will have to manufacture one)" if @md.opt.cmd =~/[MV]/
@tuned_file=[]
data.each do |dob|
unless @md.set_heading_seg
@@ -444,7 +444,7 @@ module SiSU_numbering
end
def set_header_title(data) #% make sure no false positives
unless @md.set_header_title
- puts "\t no document title provided, (will have to manufacture one)" if @md.cmd =~/[MV]/
+ puts "\t no document title provided, (will have to manufacture one)" if @md.opt.cmd =~/[MV]/
@tuned_file=[]
data.each do |t_o|
unless @md.set_header_title
diff --git a/lib/sisu/v3/db_columns.rb b/lib/sisu/v3/db_columns.rb
index 268463e2..8b669b12 100644
--- a/lib/sisu/v3/db_columns.rb
+++ b/lib/sisu/v3/db_columns.rb
@@ -64,8 +64,8 @@ module SiSU_DB_columns
def initialize(md=nil)
@md=md
@db=SiSU_Env::Info_db.new #watch
- if defined? md.mod \
- and md.mod.inspect=~/import|update/ \
+ if defined? md.opt.mod \
+ and md.opt.mod.inspect=~/import|update/ \
and FileTest.exist?(md.fns)
txt_arr=IO.readlines(md.fns,'')
src=txt_arr.join("\n")
@@ -1928,7 +1928,7 @@ module SiSU_DB_columns
IS 'sisu markup source text (if shared)';}
end
def tuple
- t=if @md.mod.inspect=~/import|update/ \
+ t=if @md.opt.mod.inspect=~/import|update/ \
and FileTest.exist?(@md.fns)
["#{name}, ","'#{@sisutxt}', "]
else ['','']
@@ -1954,7 +1954,7 @@ module SiSU_DB_columns
IS 'document full text clean, searchable';}
end
def tuple
- t=if @md.mod.inspect=~/import|update/ \
+ t=if @md.opt.mod.inspect=~/import|update/ \
and FileTest.exist?(@md.fns)
["#{name}, ","'#{@fulltext}', "]
else ['','']
diff --git a/lib/sisu/v3/db_load_tuple.rb b/lib/sisu/v3/db_load_tuple.rb
index 183f8fc4..b8408f22 100644
--- a/lib/sisu/v3/db_load_tuple.rb
+++ b/lib/sisu/v3/db_load_tuple.rb
@@ -116,7 +116,7 @@ module SiSU_DB_tuple
end
class Load_metadata #< SiSU_DB_columns::Columns
def initialize(conn,id,md,file)
- @conn,@id,@opt,@file=conn,id,md,file
+ @conn,@id,@md,@file=conn,id,md,file
@tp=SiSU_DB_columns::Columns.new(md)
end
def tuple
@@ -288,11 +288,11 @@ tid)
#{@tp.column.links.tuple[1]}
#{@id}
);"
- if @opt.cmd =~/M/
+ if @md.opt.cmd =~/M/
puts "maintenance mode on: creating sql transaction file (for last transaction set (document) only):\n\t#{@file.inspect}"
@file.puts sql_entry
else
- @file.puts sql_entry if @opt.cmd =~/V/
+ @file.puts sql_entry if @md.opt.cmd =~/V/
end
sql_entry
end
diff --git a/lib/sisu/v3/db_sqltxt.rb b/lib/sisu/v3/db_sqltxt.rb
index c5a2b79c..f4acb2c5 100644
--- a/lib/sisu/v3/db_sqltxt.rb
+++ b/lib/sisu/v3/db_sqltxt.rb
@@ -83,14 +83,14 @@ module SiSU_DB_text
and not @md.creator.author.empty?
s.gsub!(/@author/,@md.creator.author)
else
- SiSU_Screen::Ansi.new('v','WARNING Document Author information missing; provide @creator: :author:',@md.fnb).warn unless @md.cmd.inspect =~/q/
+ SiSU_Screen::Ansi.new('v','WARNING Document Author information missing; provide @creator: :author:',@md.fnb).warn unless @md.opt.cmd.inspect =~/q/
end
if defined? @md.title \
and defined? @md.title.full \
and not @md.title.full.empty?
s.gsub!(/@title/,@md.title.full)
else
- SiSU_Screen::Ansi.new('v','WARNING Document Title missing; provide @title:',@md.fnb).warn unless @md.cmd.inspect =~/q/
+ SiSU_Screen::Ansi.new('v','WARNING Document Title missing; provide @title:',@md.fnb).warn unless @md.opt.cmd.inspect =~/q/
end
end
s.gsub!(/^(?:_[1-9]\*?|_\*)\s+/m,'')
diff --git a/lib/sisu/v3/digests.rb b/lib/sisu/v3/digests.rb
index 3d35fbd7..e11ac945 100644
--- a/lib/sisu/v3/digests.rb
+++ b/lib/sisu/v3/digests.rb
@@ -114,23 +114,23 @@ module SiSU_Digest_view
output
end
def description(f,e='')
- puts f + e.to_s if @md.cmd =~/V/
+ puts f + e.to_s if @md.opt.cmd =~/V/
@@description << f << e
end
def digests(f,e='')
- puts f if @md.cmd =~/V/
+ puts f if @md.opt.cmd =~/V/
@@ds[:digests] << f + "\n"
end
def dal_structure_tree(f,e='')
- puts f + e.to_s if @md.cmd =~/V/
+ puts f + e.to_s if @md.opt.cmd =~/V/
@@ds[:tree] << f << e
end
def dal_structure_summary(f,e='')
- puts f + e.to_s if @md.cmd =~/V/
+ puts f + e.to_s if @md.opt.cmd =~/V/
@@ds[:summary] << f << e
end
def rcinfo(f,e='')
- puts f + e.to_s if @md.cmd =~/V/
+ puts f + e.to_s if @md.opt.cmd =~/V/
@@sc_info << f << e
end
def output
@@ -198,7 +198,7 @@ module SiSU_Digest_view
elsif FileTest.file?("#{@env.path.image_source_include}/#{i}")
@env.path.image_source_include
else
- SiSU_Screen::Ansi.new(@md.cmd,"ERROR - image:", %{"#{i}" missing}, "search locations: #{@env.path.image_source_include_local}, #{@env.path.image_source_include_remote} and #{@env.path.image_source_include}").error2 unless @md.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"ERROR - image:", %{"#{i}" missing}, "search locations: #{@env.path.image_source_include_local}, #{@env.path.image_source_include_remote} and #{@env.path.image_source_include}").error2 unless @md.opt.cmd =~/q/
nil
end
@img << /\S+\.(png|jpg|gif)/.match(i)[1]
diff --git a/lib/sisu/v3/embedded.rb b/lib/sisu/v3/embedded.rb
index 29a71f6b..f60ed85f 100644
--- a/lib/sisu/v3/embedded.rb
+++ b/lib/sisu/v3/embedded.rb
@@ -87,13 +87,13 @@ module SiSU_Embedded
ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image"
@rhost.each do |remote_conn|
rdest="#{remote_conn[:name]}/#{@env.path.stub_pwd}/_sisu/image"
- if @md.cmd.inspect =~/[vVMR]/ \
+ if @md.opt.cmd.inspect =~/[vVMR]/ \
and FileTest.directory?(src)
mkdir_p(ldest) unless FileTest.directory?(ldest)
src_ec="#{src}/" + @md.ec[:image].join(" #{src}/")
unless @opt.fns =~/\.-sst$/
SiSU_Env::System_call.new(src_ec,"#{ldest}/.",'q').rsync
- if @md.cmd.inspect =~/R/ #rsync to remote image directory
+ if @md.opt.cmd.inspect =~/R/ #rsync to remote image directory
SiSU_Env::System_call.new(src_ec,"#{rdest}/.",'q').rsync
end
end
@@ -106,12 +106,12 @@ module SiSU_Embedded
ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/mm/audio"
@rhost.each do |remote_conn|
rdest="#{remote_conn[:name]}/#{@env.path.stub_pwd}/_sisu/mm/audio"
- if @md.cmd.inspect =~/[vVMR]/ \
+ if @md.opt.cmd.inspect =~/[vVMR]/ \
and FileTest.directory?(src)
mkdir_p(ldest) unless FileTest.directory?(ldest)
src_ec="#{src}/" + @md.ec[:audio].join(" #{src}/")
SiSU_Env::System_call.new(src_ec,"#{ldest}/.",'q').rsync
- if @md.cmd.inspect =~/R/ #rsync to remote audio directory
+ if @md.opt.cmd.inspect =~/R/ #rsync to remote audio directory
SiSU_Env::System_call.new(src_ec,"#{rdest}/.",'q').rsync
end
end
@@ -123,12 +123,12 @@ module SiSU_Embedded
ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/mm/video"
@rhost.each do |remote_conn|
rdest="#{remote_conn[:name]}/#{@env.path.stub_pwd}/_sisu/mm/video"
- if @md.cmd.inspect =~/[vVMR]/ \
+ if @md.opt.cmd.inspect =~/[vVMR]/ \
and FileTest.directory?(src)
mkdir_p(ldest) unless FileTest.directory?(ldest)
src_ec="#{src}/" + @md.ec[:multimedia].join(" #{src}/")
SiSU_Env::System_call.new(src_ec,"#{ldest}/.",'q').rsync
- if @md.cmd.inspect =~/R/ #rsync to remote video directory
+ if @md.opt.cmd.inspect =~/R/ #rsync to remote video directory
SiSU_Env::System_call.new(src_ec,"#{rdest}/.",'q').rsync
end
end
diff --git a/lib/sisu/v3/epub.rb b/lib/sisu/v3/epub.rb
index b76beb17..8b2b2d1d 100644
--- a/lib/sisu/v3/epub.rb
+++ b/lib/sisu/v3/epub.rb
@@ -141,9 +141,9 @@ module SiSU_EPUB
SiSU_Env::SiSU_file.new(@md).mkdir.output.epub
end
def tuned_file_instructions
- @tell=SiSU_Screen::Ansi.new(@md.cmd)
- @md.cmd=@md.cmd.gsub(/H/,'h')
- @md.file_type='html' if @md.cmd =~/[hon]/
+ @tell=SiSU_Screen::Ansi.new(@md.opt.cmd)
+ @md.opt.cmd=@md.opt.cmd.gsub(/H/,'h')
+ @md.file_type='html' if @md.opt.cmd =~/[hon]/
directories
dal_array=@particulars.dal_array # dal file drawn here
@tuned_file_array=SiSU_EPUB_Tune::Tune.new(dal_array,@md).songsheet
@@ -191,10 +191,10 @@ module SiSU_EPUB
@md,@data=md,data
@vz=SiSU_Env::Get_init.instance.skin
@epub=SiSU_EPUB_Format::Head_information.new(@md)
- @tell=SiSU_Screen::Ansi.new(@md.cmd) if @md
+ @tell=SiSU_Screen::Ansi.new(@md.opt.cmd) if @md
end
def songsheet #extracts toc for scroll & seg
- SiSU_Screen::Ansi.new(@md.cmd,'Toc').txt_grey if @md.cmd =~/[MVv]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'Toc').txt_grey if @md.opt.cmd =~/[MVv]/
toc=nil
@@firstseg=nil
@@toc={ seg: [], seg_mini: [], scr: [], ncx: [], opf: [] }
@@ -272,7 +272,7 @@ module SiSU_EPUB
@@toc[:seg] << toc[:seg]
@@toc[:scr] << toc[:seg]
@@toc[:seg_mini] << toc[:seg_mini] if toc[:seg_mini]
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
end
end
end
@@ -490,7 +490,7 @@ module SiSU_EPUB
def in_common
toc_shared=[]
segtoc=[]
- SiSU_Screen::Ansi.new(@md.cmd,'Scroll & Segtoc').txt_grey if @md.cmd =~/[MVv]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'Scroll & Segtoc').txt_grey if @md.opt.cmd =~/[MVv]/
format_head_toc=SiSU_EPUB_Format::Head_toc.new(@md)
dochead=format_head_toc.head
dochead.gsub!(/toc\.(html)/,'doc.\1') #kludge
@@ -611,7 +611,7 @@ module SiSU_EPUB
end
end
out.close
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
end
end
def epub_metadata_opf
@@ -623,7 +623,7 @@ module SiSU_EPUB
end
end
out.close
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
end
end
def images
@@ -646,7 +646,7 @@ module SiSU_EPUB
mv #{@epub_doc} #{@md.file.place_file.epub}
cd #{Dir.pwd}
")
- unless @md.cmd.inspect =~/M/
+ unless @md.opt.cmd.inspect =~/M/
system("rm -r #{@md.env.processing_path.epub}")
end
end
@@ -663,7 +663,7 @@ module SiSU_EPUB
end
filename_html_segtoc.close
filename_html_index.close
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
end
end
end
diff --git a/lib/sisu/v3/epub_concordance.rb b/lib/sisu/v3/epub_concordance.rb
index e03034dc..205f4f22 100644
--- a/lib/sisu/v3/epub_concordance.rb
+++ b/lib/sisu/v3/epub_concordance.rb
@@ -75,20 +75,20 @@ module SiSU_EPUB_Concordance
begin
@env,@md=@particulars.env,@particulars.md
loc=@env.url.output_tell
- tool=((@md.cmd =~/[MVv]/) ? "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:concordance]}" : '')
- SiSU_Screen::Ansi.new(@md.cmd,"Concordance",tool).grey_title_hi unless @md.cmd =~/q/
+ tool=((@md.opt.cmd =~/[MVv]/) ? "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:concordance]}" : '')
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"Concordance",tool).grey_title_hi unless @md.opt.cmd =~/q/
wordmax=@env.concord_max
unless @md.wc_words.nil?
if @md.wc_words < wordmax
SiSU_EPUB_Concordance::Source::Words.new(@particulars).songsheet
else
- SiSU_Screen::Ansi.new(@md.cmd,"concordance skipped, large document has over #{wordmax} words (#{@md.wc_words})").warn unless @md.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"concordance skipped, large document has over #{wordmax} words (#{@md.wc_words})").warn unless @md.opt.cmd =~/q/
end
else
- SiSU_Screen::Ansi.new(@md.cmd,"wc (word count) is off, concordance will be processed for all files including those over the max set size of: #{wordmax} words").warn unless @md.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"wc (word count) is off, concordance will be processed for all files including those over the max set size of: #{wordmax} words").warn unless @md.opt.cmd =~/q/
SiSU_EPUB_Concordance::Source::Words.new(@particulars).songsheet
end
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
end
end
@@ -170,14 +170,14 @@ WOK
@rxp_excluded0=/^(?:#{Mx[:fa_bold_o]}|#{Mx[:fa_italics_o]})?(?:to\d+|\d+|&nbsp;|#{Mx[:br_endnotes]}|EOF|#{Mx[:br_eof]}|thumb_\S+|snap_\S+|_+|-+|[(]?(?:ii+|iv|vi+|ix|xi+|xiv|xv|xvi+|xix|xx)[).]?|\S+?_\S+|[\d_]+\w\S+|[\w\d]{1,2}|\d{1,3}\w?|[0-9a-f]{16,64}|\d{2,3}x\d{2,3}|\S{0,2}sha\d|\S{0,3}\d{4}w\d\d|\b\w\d+|\d_all\b|e\.?g\.?)(?:#{Mx[:fa_bold_c]}|#{Mx[:fa_italics_c]})?$/mi #this regex causes and cures a stack dump in ruby 1.9 !!!
@rgx_splitlist=%r{[—.,;:-]+|#{Mx[:nbsp]}+}mi
@rgx_scanlist=%r{#{Mx[:fa_italics_o]}[a-zA-Z0-9"\s]{2,12}#{Mx[:fa_italics_c]}|#{Mx[:fa_bold_o]}[a-zA-Z0-9"\s]{2,12}#{Mx[:fa_bold_c]}|#{Mx[:url_o]}https?://\S+?#{Mx[:url_c]}|file://\S+|<\S+?>|\w+|[a-zA-Z]+}mi
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
end
end
def songsheet
begin
@file_concordance=File.open("#{@path}/content/#{@md.fn[:epub_concord]}",'w')
map_para
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
@file_concordance.close
end
diff --git a/lib/sisu/v3/epub_format.rb b/lib/sisu/v3/epub_format.rb
index 519ba16b..5af5c0b4 100644
--- a/lib/sisu/v3/epub_format.rb
+++ b/lib/sisu/v3/epub_format.rb
@@ -71,7 +71,7 @@ module SiSU_EPUB_Format
end
def ocn_display
if @md.markup.inspect =~/no_ocn/ \
- or @md.mod.inspect =~/--no-ocn/ \
+ or @md.opt.mod.inspect =~/--no-ocn/ \
or @skin_no_ocn
ocn_class='ocn_off'
@ocn.gsub(/^(\d+|)$/,
@@ -1598,7 +1598,7 @@ WOK
@ocn=((defined? t_o.ocn) ? t_o.ocn.to_s : nil)
@headname=((t_o.is=='heading' and defined? t_o.name) ? t_o.name : nil)
else
- if @md.cmd =~/M/
+ if @md.opt.cmd =~/M/
p __FILE__ +':'+ __LINE__.to_s
p t_o.class
p caller
diff --git a/lib/sisu/v3/epub_segments.rb b/lib/sisu/v3/epub_segments.rb
index c06f11f2..a21a64a7 100644
--- a/lib/sisu/v3/epub_segments.rb
+++ b/lib/sisu/v3/epub_segments.rb
@@ -151,7 +151,7 @@ WOK
data=articles(data)
Seg.new.cleanup # (((( added ))))
#### (((( END )))) ####
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
@@seg_name=[]
end
@@ -177,7 +177,7 @@ WOK
@@seg_name_xhtml=@@seg_name
@@seg_total=@@seg_name.length
testforartnum=@@seg_name_xhtml
- SiSU_Screen::Ansi.new(@md.cmd,@@seg_name.length) if @md.cmd =~/[MVv]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,@@seg_name.length) if @md.opt.cmd =~/[MVv]/
map_nametags=SiSU_Particulars::Combined_singleton.instance.get_map_nametags(@md).nametags_map #p map_nametags
data.each do |dob|
#if defined? dob.obj \
diff --git a/lib/sisu/v3/epub_tune.rb b/lib/sisu/v3/epub_tune.rb
index 19453fc8..d691361b 100644
--- a/lib/sisu/v3/epub_tune.rb
+++ b/lib/sisu/v3/epub_tune.rb
@@ -77,7 +77,7 @@ module SiSU_EPUB_Tune
def initialize(data,md)
@data,@md=data,md
@file=SiSU_Env::SiSU_file.new(@md)
- @cX=SiSU_Screen::Ansi.new(@md.cmd).cX
+ @cX=SiSU_Screen::Ansi.new(@md.opt.cmd).cX
end
def hard_output
@filename_tune=@file.write_file_processing.html_tune
@@ -206,18 +206,18 @@ module SiSU_EPUB_Tune
end
def songsheet
begin
- @cX=SiSU_Screen::Ansi.new(@md.cmd).cX
- SiSU_Screen::Ansi.new(@md.cmd,'Tune').txt_grey if @md.cmd =~/[MVv]/
+ @cX=SiSU_Screen::Ansi.new(@md.opt.cmd).cX
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'Tune').txt_grey if @md.opt.cmd =~/[MVv]/
data=Tune.new(@data,@md).amp_html
data=Tune.new(data,@md).endnotes_html
data=Tune.new(data,@md).url_markup
data=Tune.new(data,@md).markup
- if @md.cmd =~/M/ #Hard Output Tune Optional on/off here
+ if @md.opt.cmd =~/M/ #Hard Output Tune Optional on/off here
data=Output.new(data,@md).hard_output
Output.new(data,@md).marshal
end
tuned=Tune.new(@data,@md).output
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
end
end
diff --git a/lib/sisu/v3/html.rb b/lib/sisu/v3/html.rb
index 47988cba..5c044594 100644
--- a/lib/sisu/v3/html.rb
+++ b/lib/sisu/v3/html.rb
@@ -142,9 +142,9 @@ module SiSU_HTML
title=File.basename(@md.fns,'.rb')
end
def tuned_file_instructions
- @tell=SiSU_Screen::Ansi.new(@md.cmd)
- @md.cmd=@md.cmd.gsub(/H/,'h')
- @md.file_type='html' if @md.cmd =~/[hon]/
+ @tell=SiSU_Screen::Ansi.new(@md.opt.cmd)
+ @md.opt.cmd=@md.opt.cmd.gsub(/H/,'h')
+ @md.file_type='html' if @md.opt.cmd =~/[hon]/
directories
newfilename=%{#{@env.path.output}/#{@md.fnb}/#{@md.fn[:index]}} if @md.file_type =~/html/
dal_array=@particulars.dal_array # dal file drawn here
@@ -156,7 +156,7 @@ module SiSU_HTML
@links_guide_toc=[]
def initialize(data,md)
@data,@md=data,md
- @links_guide_=SiSU_Env::Create_site.new(@md.cmd).html_quick_ref?
+ @links_guide_=SiSU_Env::Create_site.new(@md.opt.cmd).html_quick_ref?
end
def toc
@links_guide_toc=[]
@@ -225,10 +225,10 @@ module SiSU_HTML
def initialize(md=nil,data='')
@data,@md=data,md
@vz=SiSU_Env::Get_init.instance.skin
- @tell=SiSU_Screen::Ansi.new(@md.cmd) if @md
+ @tell=SiSU_Screen::Ansi.new(@md.opt.cmd) if @md
end
def songsheet #extracts toc for scroll & seg
- SiSU_Screen::Ansi.new(@md.cmd,'Toc').txt_grey if @md.cmd =~/[MVv]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'Toc').txt_grey if @md.opt.cmd =~/[MVv]/
toc=nil
@@firstseg=nil
@@toc={ seg: [], seg_mini: [], scr: [] }
@@ -261,7 +261,7 @@ module SiSU_HTML
@@toc[:seg] << toc[:seg] if toc[:seg]
@@toc[:seg_mini] << toc[:seg_mini] if toc[:seg_mini]
@@toc[:scr] << toc[:scr] if toc[:scr]
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
end
end
end
@@ -518,7 +518,7 @@ WOK
def in_common
toc_shared=[]
@segtoc=[]
- SiSU_Screen::Ansi.new(@md.cmd,'Scroll & Segtoc').txt_grey if @md.cmd =~/[MVv]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'Scroll & Segtoc').txt_grey if @md.opt.cmd =~/[MVv]/
format_head_toc=SiSU_HTML_Format::Head_toc.new(@md)
dochead=format_head_toc.head
dochead.gsub!(/toc\.(html)/,'doc.\1') #kludge
@@ -627,7 +627,7 @@ WOK
@filename_html_scroll.puts para,"\n"
end
end
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
end
end
def segtoc
@@ -644,7 +644,7 @@ WOK
@filename_html_index.puts para,"\n"
end
end
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
end
end
end
diff --git a/lib/sisu/v3/html_format.rb b/lib/sisu/v3/html_format.rb
index 7f13aab3..a4a05293 100644
--- a/lib/sisu/v3/html_format.rb
+++ b/lib/sisu/v3/html_format.rb
@@ -71,7 +71,7 @@ module SiSU_HTML_Format
end
def ocn_display
if @md.markup.inspect =~/no_ocn/ \
- or @md.mod.inspect =~/--no-ocn/ \
+ or @md.opt.mod.inspect =~/--no-ocn/ \
or @skin_no_ocn
ocn_class='ocn_off'
@ocn.gsub(/^(\d+|)$/,
@@ -967,7 +967,7 @@ WOK
@ocn=((defined? t_o.ocn) ? t_o.ocn.to_s : nil)
@headname=((t_o.is=='heading' and defined? t_o.name) ? t_o.name : nil)
else
- if @md.cmd =~/M/
+ if @md.opt.cmd =~/M/
p t_o.class
p caller
end
diff --git a/lib/sisu/v3/html_minitoc.rb b/lib/sisu/v3/html_minitoc.rb
index 160881dd..7390ee7c 100644
--- a/lib/sisu/v3/html_minitoc.rb
+++ b/lib/sisu/v3/html_minitoc.rb
@@ -67,10 +67,10 @@
def initialize(md,data)
@md,@data=md,data
@pat_strip_heading_name=/<a name="h?\d.*?">(.+?)<\/a>/
- @tell=SiSU_Screen::Ansi.new(@md.cmd) if @md
+ @tell=SiSU_Screen::Ansi.new(@md.opt.cmd) if @md
end
def songsheet
- SiSU_Screen::Ansi.new(@md.cmd,'Toc').txt_grey if @md.cmd =~/[MVv]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'Toc').txt_grey if @md.opt.cmd =~/[MVv]/
toc=nil
@toc=[]
@data.each do |txt|
diff --git a/lib/sisu/v3/html_promo.rb b/lib/sisu/v3/html_promo.rb
index 92d184c5..91f63ac1 100644
--- a/lib/sisu/v3/html_promo.rb
+++ b/lib/sisu/v3/html_promo.rb
@@ -405,7 +405,7 @@ WOK
end
end
else
- SiSU_Screen::Ansi.new(@md.cmd,"category not found: #{category}").warn unless @md.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"category not found: #{category}").warn unless @md.opt.cmd =~/q/
end
adverts.join
end
diff --git a/lib/sisu/v3/html_scroll.rb b/lib/sisu/v3/html_scroll.rb
index a6a1a763..d58dd502 100644
--- a/lib/sisu/v3/html_scroll.rb
+++ b/lib/sisu/v3/html_scroll.rb
@@ -71,7 +71,7 @@ module SiSU_HTML_scroll
scr=Scroll.new(@md,@data,@endnotes).markup
scr[:tails]=Scroll.new(@md).tails
scr
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
end
end
diff --git a/lib/sisu/v3/html_segments.rb b/lib/sisu/v3/html_segments.rb
index 5fcb6cf0..2ac89805 100644
--- a/lib/sisu/v3/html_segments.rb
+++ b/lib/sisu/v3/html_segments.rb
@@ -64,7 +64,7 @@ module SiSU_HTML_seg
class Seg_output
def initialize(md,outputfile,seg,minitoc,type='')
@md,@output_seg_file,@seg,@minitoc,@type=md,outputfile,seg,minitoc,type
- @title_banner_=SiSU_Env::Create_site.new(@md.cmd).html_seg_title_banner?
+ @title_banner_=SiSU_Env::Create_site.new(@md.opt.cmd).html_seg_title_banner?
@file=SiSU_Env::SiSU_file.new(@md)
end
def output
@@ -141,7 +141,7 @@ module SiSU_HTML_seg
@seg_name_html_tracker=@@tracker || nil
@env=SiSU_Env::Info_env.new(@md.fns) if @md
if @md
- @title_banner_=SiSU_Env::Create_site.new(@md.cmd).html_seg_title_banner?
+ @title_banner_=SiSU_Env::Create_site.new(@md.opt.cmd).html_seg_title_banner?
end
end
def songsheet
@@ -151,7 +151,7 @@ module SiSU_HTML_seg
data=articles(data)
Seg.new.cleanup # (((( added ))))
#### (((( END )))) ####
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
@@seg_name=[]
end
@@ -178,7 +178,7 @@ module SiSU_HTML_seg
@@seg_name_html=@@seg_name
@@seg_total=@@seg_name.length
testforartnum=@@seg_name_html
- SiSU_Screen::Ansi.new(@md.cmd,@@seg_name.length).segmented if @md.cmd =~/[MVv]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,@@seg_name.length).segmented if @md.opt.cmd =~/[MVv]/
map_nametags=SiSU_Particulars::Combined_singleton.instance.get_map_nametags(@md).nametags_map #p map_nametags
data.each do |dob|
if defined? dob.obj \
diff --git a/lib/sisu/v3/html_tune.rb b/lib/sisu/v3/html_tune.rb
index 5bbcdf6c..26072704 100644
--- a/lib/sisu/v3/html_tune.rb
+++ b/lib/sisu/v3/html_tune.rb
@@ -76,8 +76,8 @@ module SiSU_HTML_Tune
class Output
def initialize(data,md)
@data,@md=data,md
- @file=SiSU_Env::SiSU_file.new(@md)
- @cX=SiSU_Screen::Ansi.new(@md.cmd).cX
+ @file=SiSU_Env::Info_file.new(@md.fns)
+ @cX=SiSU_Screen::Ansi.new(@md.opt.cmd).cX
end
def hard_output
@filename_tune=@file.write_file_processing.html_tune
@@ -202,17 +202,17 @@ module SiSU_HTML_Tune
end
def songsheet
begin
- @cX=SiSU_Screen::Ansi.new(@md.cmd).cX
- SiSU_Screen::Ansi.new(@md.cmd,'Tune').txt_grey if @md.cmd =~/[MVv]/
+ @cX=SiSU_Screen::Ansi.new(@md.opt.cmd).cX
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'Tune').txt_grey if @md.opt.cmd =~/[MVv]/
data=Tune.new(@data,@md).endnotes_html
data=Tune.new(data,@md).url_markup
data=Tune.new(data,@md).markup
- if @md.cmd =~/M/ #Hard Output Tune Optional on/off here
+ if @md.opt.cmd =~/M/ #Hard Output Tune Optional on/off here
data=Output.new(data,@md).hard_output
Output.new(data,@md).marshal
end
tuned=Tune.new(@data,@md).output
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
end
end
diff --git a/lib/sisu/v3/manifest.rb b/lib/sisu/v3/manifest.rb
index c496c8a6..38dc994c 100644
--- a/lib/sisu/v3/manifest.rb
+++ b/lib/sisu/v3/manifest.rb
@@ -138,7 +138,7 @@ module SiSU_Manifest
dgst =if @dg =~/^sha(?:2|256)$/; sys.sha256("#{pth}/#{file}")
else sys.md5("#{pth}/#{file}")
end
- SiSU_Screen::Ansi.new(@md.cmd,"#{dgst[1]} #{file}").warn if @md.cmd =~/[vVM]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"#{dgst[1]} #{file}").warn if @md.opt.cmd =~/[vVM]/
size=(File.size("#{pth}/#{file}")/1024.00).to_s
kb=/([0-9]+\.[0-9]{0,1})/m.match(size)[1]
@manifest[:txt] << "#{file} #{id} #{kb}\n"
@@ -285,10 +285,10 @@ module SiSU_Manifest
summarize(id,file,pth)
end
if FileTest.file?(@md.file.place_file.txt)==true
- if @md.cmd =~/a/; id='Plaintext (Unix (UTF-8) with footnotes)'
- elsif @md.cmd =~/e/; id='Plaintext (Unix (UTF-8) with endnotes)'
- elsif @md.cmd =~/A/; id='Plaintext (dos (UTF-8) with footnotes)'
- elsif @md.cmd =~/E/; id='Plaintext (dos (UTF-8) with endnotes)'
+ if @md.opt.cmd =~/a/; id='Plaintext (Unix (UTF-8) with footnotes)'
+ elsif @md.opt.cmd =~/e/; id='Plaintext (Unix (UTF-8) with endnotes)'
+ elsif @md.opt.cmd =~/A/; id='Plaintext (dos (UTF-8) with footnotes)'
+ elsif @md.opt.cmd =~/E/; id='Plaintext (dos (UTF-8) with endnotes)'
else id='Plaintext (UTF-8)'
end
pth=@md.file.output_path.txt
@@ -728,7 +728,7 @@ WOK
</html>
WOK
output
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
end
end
diff --git a/lib/sisu/v3/odf.rb b/lib/sisu/v3/odf.rb
index 894052d6..81344d4c 100644
--- a/lib/sisu/v3/odf.rb
+++ b/lib/sisu/v3/odf.rb
@@ -110,8 +110,8 @@ module SiSU_ODF
@vz=SiSU_Env::Get_init.instance.skin
@tab="\t"
@brace_url=SiSU_Viz::Skin.new.url_decoration
- @br=(@md.cmd =~/M/) ? '' : ''
- #@br=(@md.cmd =~/M/) ? "\n" : ''
+ @br=(@md.opt.cmd =~/M/) ? '' : ''
+ #@br=(@md.opt.cmd =~/M/) ? "\n" : ''
end
def songsheet
begin
@@ -120,9 +120,9 @@ module SiSU_ODF
post
publish
ensure
- unless @md.cmd =~/[MV]/ #check maintenance flag
+ unless @md.opt.cmd =~/[MV]/ #check maintenance flag
if @env.processing_path.odt =~/od[ft]/
- #p "rm -r #{@env.processing_path.odt}" if @md.cmd =~/v/
+ #p "rm -r #{@env.processing_path.odt}" if @md.opt.cmd =~/v/
system("rm -r #{@env.processing_path.odf_pth}")
#system("rm -r #{@env.processing_path.odt}")
end
@@ -198,7 +198,7 @@ module SiSU_ODF
and FileTest.file?("#{@env.path.image_source_include_remote}/#{i}")
@env.path.image_source_include_remote
else
- SiSU_Screen::Ansi.new(@md.cmd,"ERROR - image:",%{"#{i}" missing},"search locations: #{@env.path.image_source_include_local},#{@env.path.image_source_include_remote} and #{@env.path.image_source_include}").error2 unless @md.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"ERROR - image:",%{"#{i}" missing},"search locations: #{@env.path.image_source_include_local},#{@env.path.image_source_include_remote} and #{@env.path.image_source_include}").error2 unless @md.opt.cmd =~/q/
nil
end
end
@@ -521,7 +521,7 @@ module SiSU_ODF
end
odf_metadata
data.each do |dob|
- #p dob.obj if dob.obj =~safe_characters and @md.cmd =~/V/ #KEEP
+ #p dob.obj if dob.obj =~safe_characters and @md.opt.cmd =~/V/ #KEEP
dob.obj='' if dob.obj =~/#{Mx[:lv_o]}\d+:.*?#{Mx[:lv_c]}.+?#{Mx[:pa_non_object_dummy_heading]}/ #fix Mx[:lv_o]
para_array=[]
dob.obj.gsub!(/</,'&lt;'); dob.obj.gsub!(/>/,'&gt;')
diff --git a/lib/sisu/v3/param.rb b/lib/sisu/v3/param.rb
index 9a11da8c..c2968564 100644
--- a/lib/sisu/v3/param.rb
+++ b/lib/sisu/v3/param.rb
@@ -101,7 +101,7 @@ module SiSU_Param
@@md=nil
end
if @@md.nil? \
- or @cmd =~/M/ #not particularly helpful, as current cycle is through output types, with files changing, only helpful if deal with a file all output types before going to next file
+ or @opt.cmd =~/M/ #not particularly helpful, as current cycle is through output types, with files changing, only helpful if deal with a file all output types before going to next file
if File.exist?(@pstorefile)
param_msg='Parameters from pstore'
store=PStore.new(@pstorefile)
@@ -117,12 +117,12 @@ module SiSU_Param
@md
end
if defined? @md.title.main # on removal check problems with -U
- SiSU_Screen::Ansi.new(@cmd,param_msg,@md.title.main).txt_grey if @cmd =~/[MVv]/
+ SiSU_Screen::Ansi.new(@opt.cmd,param_msg,@md.title.main).txt_grey if @opt.cmd =~/[MVv]/
end
@@md=@md
else @@md
end
- @@md.cmd=@cmd
+ @@md.opt=@opt
@@md
end
class Md_default
@@ -400,7 +400,7 @@ module SiSU_Param
elsif @h['main']
@h['main']
else
- SiSU_Screen::Ansi.new(@cmd,'WARNING Document Copyright missing; provide @rights: :copyright:').warn unless @opt.cmd =~/q/
+ SiSU_Screen::Ansi.new(@opt.cmd,'WARNING Document Copyright missing; provide @rights: :copyright:').warn unless @opt.cmd =~/q/
''
end
l,n=Db[:col_info_note],'rights.copyright.text'
@@ -487,7 +487,7 @@ module SiSU_Param
s +='<br> License: ' + copyright.license
end
if s.empty?
- SiSU_Screen::Ansi.new(@cmd,'WARNING Document Rights information missing; provide @rights: :copyright:').warn unless @opt.cmd =~/q/
+ SiSU_Screen::Ansi.new(@opt.cmd,'WARNING Document Rights information missing; provide @rights: :copyright:').warn unless @opt.cmd =~/q/
else
l,n=Db[:col_info_note],'rights.all'
validate_length(s,l,n)
@@ -828,10 +828,10 @@ module SiSU_Param
@doc={ lv: [] }
@doc[:fns],@doc[:fnb],@doc[:scr_suffix]='','',''
@@publisher='SiSU scribe'
- attr_accessor :cmd,:make,:mod,:env,:path,:file,:fn,:fns,:fnb,:fnn,:fnt,:fnl,:flv,:fnz,:fnstex,:ocn,:sfx_src,:pdf,:file_type,:dir_out,:dir_tex,:dir_lout,:txt_path,:site_skin,:sisu,:sisu_version,:ruby_version,:title,:subtitle,:full_title,:html_title,:subtitle_tex,:creator,:classify,:author_home,:author,:author_title,:author_nationality,:authors,:authorship,:translator,:illustrator,:prepared_by,:digitized_by,:subject,:description,:publisher,:current_publisher,:contributor,:date,:date_created,:date_issued,:date_available,:date_valid,:date_modified,:date_translated,:date_added_to_site,:date_scheme,:date_created_scheme,:date_issued_scheme,:date_available_scheme,:date_valid_scheme,:date_modified_scheme,:type,:format,:identifier,:source,:language,:language_original,:relation,:coverage,:rights,:keywords,:comments,:abstract,:cls_loc,:cls_dewey,:cls_pg,:cls_isbn,:papersize,:papersize_array,:toc,:lv1,:lv2,:lv3,:lv4,:lv5,:lv6,:lvs,:pagenew,:pagebreak,:num_top,:toc_lev_limit,:flag_endnotes,:flag_auto_endnotes,:flag_separate_endnotes,:flag_separate_endnotes_make,:markup,:markup_instruction,:markup_version,:markup_declared,:flag_tables,:vocabulary,:doc_skin,:doc_css,:yaml,:lnk,:links,:prefix_a,:prefix_b,:suffix,:information,:contact,:icon,:image,:ad_url,:ad_png,:ad_alt,:ad_began,:flag_promo,:promo,:ad_home,:stmp,:stmpd,:sc_filename,:sc_number,:sc_date,:sc_time,:sc_info,:yamladdr,:locale,:wc_lines,:wc_words,:wc_bytes,:file_encoding,:filesize,:user,:home,:hostname,:pwd,:firstseg,:programs,:author_copymark,:i18n,:lang,:en,:notes,:dgst,:dgst_skin,:generated,:tags,:tag_array,:concord_make,:seg_names,:seg_autoname_safe,:set_header_title,:set_heading_top,:set_heading_seg,:heading_seg_first,:heading_seg_first_flag,:base_program,:ec,:opt,:sem_tag,:book_idx,:topic_register,:topic_register_array,:original,:writing_focus,:audio,:daisy
+ attr_accessor :make,:env,:path,:file,:fn,:fns,:fnb,:fnn,:fnt,:fnl,:flv,:fnz,:fnstex,:ocn,:sfx_src,:pdf,:file_type,:dir_out,:dir_tex,:dir_lout,:txt_path,:site_skin,:sisu,:sisu_version,:ruby_version,:title,:subtitle,:full_title,:html_title,:subtitle_tex,:creator,:classify,:author_home,:author,:author_title,:author_nationality,:authors,:authorship,:translator,:illustrator,:prepared_by,:digitized_by,:subject,:description,:publisher,:current_publisher,:contributor,:date,:date_created,:date_issued,:date_available,:date_valid,:date_modified,:date_translated,:date_added_to_site,:date_scheme,:date_created_scheme,:date_issued_scheme,:date_available_scheme,:date_valid_scheme,:date_modified_scheme,:type,:format,:identifier,:source,:language,:language_original,:relation,:coverage,:rights,:keywords,:comments,:abstract,:cls_loc,:cls_dewey,:cls_pg,:cls_isbn,:papersize,:papersize_array,:toc,:lv1,:lv2,:lv3,:lv4,:lv5,:lv6,:lvs,:pagenew,:pagebreak,:num_top,:toc_lev_limit,:flag_endnotes,:flag_auto_endnotes,:flag_separate_endnotes,:flag_separate_endnotes_make,:markup,:markup_instruction,:markup_version,:markup_declared,:flag_tables,:vocabulary,:doc_skin,:doc_css,:yaml,:lnk,:links,:prefix_a,:prefix_b,:suffix,:information,:contact,:icon,:image,:ad_url,:ad_png,:ad_alt,:ad_began,:flag_promo,:promo,:ad_home,:stmp,:stmpd,:sc_filename,:sc_number,:sc_date,:sc_time,:sc_info,:yamladdr,:locale,:wc_lines,:wc_words,:wc_bytes,:file_encoding,:filesize,:user,:home,:hostname,:pwd,:firstseg,:programs,:author_copymark,:i18n,:lang,:en,:notes,:dgst,:dgst_skin,:generated,:tags,:tag_array,:concord_make,:seg_names,:seg_autoname_safe,:set_header_title,:set_heading_top,:set_heading_seg,:heading_seg_first,:heading_seg_first_flag,:base_program,:ec,:opt,:sem_tag,:book_idx,:topic_register,:topic_register_array,:original,:writing_focus,:audio,:daisy
def initialize(fns_array,opt)
@env=@path,@file=@fn=@fns=@fnb=@fnn=@fnt=@fnl=@flv=@fnz=@fnstex=@ocn=@sfx_src=@pdf=@file_type=@dir_out=@dir_tex=@dir_lout=@txt_path=@make=@flag_endnotes=@flag_auto_endnotes=@flag_separate_endnotes=@flag_separate_endnotes_make=@site_skin=@sisu=@sisu_version=@ruby_version=@title=@subtitle=@full_title=@html_title=@subtitle_tex=@creator=@classify=@author_home=@author=@author_title=@author_nationality=@translator=@illustrator=@prepared_by=@digitized_by=@subject=@description=@publisher=@current_publisher=@contributor=@date=@date_created=@date_issued=@date_available=@date_valid=@date_modified=@date_translated=@date_added_to_site=@date_scheme=@date_created_scheme=@date_issued_scheme=@date_available_scheme=@date_valid_scheme=@date_modified_scheme=@type=@format=@identifier=@source=@language=@language_original=@relation=@coverage=@rights=@keywords=@comments=@abstract=@cls_loc=@cls_dewey=@cls_pg=@cls_isbn=@papersize=@toc=@lv1=@lv2=@lv3=@lv4=@lv5=@lv6=@pagenew=@pagebreak=@num_top=@toc_lev_limit=@flag_tables=@vocabulary=@doc_skin=@doc_css=@yaml=@lnk=@links=@prefix_a=@prefix_b=@suffix=@information=@contact=@icon=@ad_url=@ad_png=@ad_alt=@ad_began=@promo=@ad_home=@stmp=@stmpd=@sc_filename=@sc_number=@sc_date=@sc_time=@sc_info=@yamladdr=@locale=@wc_lines=@wc_words=@wc_bytes=@file_encoding=@filesize=@firstseg=@programs=@author_copymark=@i18n=@lang=@en=@notes=@dgst=@dgst_skin=@generated=@heading_seg_first=@base_program=@topic_register=@original=@writing_focus=@audio=nil
- @data,@path,@fns,@cmd,@mod,@opt=fns_array,opt.pth,opt.fns,opt.cmd,opt.mod,opt #@data used as data
+ @data,@path,@fns,@opt=fns_array,opt.pth,opt.fns,opt #@data used as data
@flag_tables,@set_header_title,@set_heading_top,@set_heading_seg,@heading_seg_first_flag,@flag_promo,@book_idx=false,false,false,false,false,false,false
@seg_autoname_safe=true
@daisy,@sem_tag=false,false
@@ -845,7 +845,7 @@ module SiSU_Param
@rgx_audio=/\{\s*(\S+?\.(?:mp3|ogg))/
@rgx_mm=/\{\s*(\S+?\.(?:ogg|mpeg))/ #expand and distinguish ogg
begin
- rescue; SiSU_Errors::Info_error.new($!,$@,@cmd,@fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@fns).error
ensure
end
end
@@ -882,7 +882,7 @@ module SiSU_Param
end
@concord_make=(@wc_words > @env.concord_max) ? false : true
@locale=@sys.locale
- @file_encoding=@sys.file_encoding(fns,@cmd)
+ @file_encoding=@sys.file_encoding(fns,@opt.cmd)
# programs set here for things that affect output appearance only
@programs[:pdf]=SiSU_Env::System_call.new.program_found?('pdflatex')
if @opt.cmd =~/P/ #if @env.multilingual?
@@ -925,11 +925,11 @@ module SiSU_Param
@markup_version_declared=fns_array[0].match(/^(?:%\s+)?(?:SiSU\s+(?:master\s+)?|sisu-)([\d.]+)$/)[1]
sm_a,sm_b,sm_c=fns_array[0].match(/^(?:%\s+)?(?:SiSU\s+(?:master\s+)?|sisu-)([0-9]+)?(?:\.([0-9]+))?(?:\.([0-9]+))?$/)[1..3]
sm_c ||=0
- sv=(@cmd =~/[VMv]/) ? ("SiSU version (#{@sisu_version[:version]})") : ''
+ sv=(@opt.cmd =~/[VMv]/) ? ("SiSU version (#{@sisu_version[:version]})") : ''
s_a,s_b,s_c=@sisu_version[:version].match(/^([0-9]+)?(?:\.([0-9]+))?(?:\.([0-9]+))?(?:\-\S+)?$/)[1..3]
tell=(@markup_version_declared.to_f==@markup_version.determined) \
- ? SiSU_Screen::Ansi.new(@cmd,"Markup version (#{@markup_version.series} version #{@markup_version.determined})",sv) \
- : SiSU_Screen::Ansi.new(@cmd,"Markup version declared (#{@markup_version_declared}), determined (#{@markup_version.series} version #{@markup_version.determined})",sv)
+ ? SiSU_Screen::Ansi.new(@opt.cmd,"Markup version (#{@markup_version.series} version #{@markup_version.determined})",sv) \
+ : SiSU_Screen::Ansi.new(@opt.cmd,"Markup version declared (#{@markup_version_declared}), determined (#{@markup_version.series} version #{@markup_version.determined})",sv)
ok=if s_a.to_i > sm_a.to_i
true
elsif s_a.to_i == sm_a.to_i \
@@ -942,12 +942,12 @@ module SiSU_Param
else false
end
if ok
- tell.txt_green if @cmd =~/[vVM]/
+ tell.txt_green if @opt.cmd =~/[vVM]/
else
- SiSU_Screen::Ansi.new(@cmd,"Warning: markup version determined (#{@markup_version.determined}) or markup version declared (#{@markup_version_declared}) is newer than SiSU version (#{@sisu_version[:version]})").warn unless @cmd =~/q/
+ SiSU_Screen::Ansi.new(@opt.cmd,"Warning: markup version determined (#{@markup_version.determined}) or markup version declared (#{@markup_version_declared}) is newer than SiSU version (#{@sisu_version[:version]})").warn unless @opt.cmd =~/q/
end
else
- SiSU_Screen::Ansi.new(@cmd,'No SiSU markup version provided').warn if @cmd =~/[VM]/
+ SiSU_Screen::Ansi.new(@opt.cmd,'No SiSU markup version provided').warn if @opt.cmd =~/[VM]/
end
else
mv=if defined? @markup_version.determined and not @markup_version.determined.nil?
@@ -955,7 +955,7 @@ module SiSU_Param
"markup version determined #{x}"
else ''
end
- SiSU_Screen::Ansi.new(@cmd,'SiSU filetype indicator not provided',mv).warn unless @cmd =~/q/
+ SiSU_Screen::Ansi.new(@opt.cmd,'SiSU filetype indicator not provided',mv).warn unless @opt.cmd =~/q/
end
@code_flag=false
fns_array.each do |para| #% scan document
@@ -1076,7 +1076,7 @@ module SiSU_Param
@title=Md.new(tf.strip,@opt,@env).title
end
@html_title=@title.full.gsub(/(<p>|<p \/>|<br>|<br \/>)/,'')
- SiSU_Screen::Ansi.new(@cmd,'Parameters',@html_title).txt_grey if @cmd =~/v/
+ SiSU_Screen::Ansi.new(@opt.cmd,'Parameters',@html_title).txt_grey if @opt.cmd =~/v/
end
if not @book_idx \
and para =~/^=\{(.+?)\}\s*$/
@@ -1205,9 +1205,9 @@ module SiSU_Param
@markup.gsub!(/num_top\s*=\s*([\dA-C])/,"num_top=#{@num_top}")
@markup.gsub!(/toc_lev_limit\s*=\s*([\dA-C])/,"toc_lev_limit=#{@toc_lev_limit}")
end
- if @mod.inspect =~/--papersize[=-]\S+|--pdf[=-]\S+/ \
- or @mod.inspect =~/--(?:a4|letter|legal|book|a5|b5)\b/i #command line config/header override
- @papersize=determine_papersize(@mod.inspect)
+ if @opt.mod.inspect =~/--papersize[=-]\S+|--pdf[=-]\S+/ \
+ or @opt.mod.inspect =~/--(?:a4|letter|legal|book|a5|b5)\b/i #command line config/header override
+ @papersize=determine_papersize(@opt.mod.inspect)
end
@papersize_array=@papersize.scan(/(?:a4|letter|legal|book|a5|b5)/i)
fn=@fns=~/\.ssm\.sst$/ ? @fns.gsub(/.sst/,'') : @fns #decide what to do a filesize on .ssm tells very little about actual document size
@@ -1257,13 +1257,13 @@ module SiSU_Param
if @en[:note] > 0 \
and @en[:sum] > 0
if @en[:sum] > 0
- else SiSU_Screen::Ansi.new(@cmd,'both endnote styles used',"~{ #{@en[:sum]} }~ and ^~ #{@en[:mark]}").warn if @cmd !~/q/
+ else SiSU_Screen::Ansi.new(@opt.cmd,'both endnote styles used',"~{ #{@en[:sum]} }~ and ^~ #{@en[:mark]}").warn if @opt.cmd !~/q/
end
end
if @en[:mark] != @en[:note] \
and @en[:note] > 0
@en[:mismatch]=@en[:note] - @en[:mark]
- SiSU_Screen::Ansi.new(@cmd,'endnote number mismatch',"endnotes: #{@en[:note]} != endnote reference marks: #{@en[:mark]} (difference = #{@en[:mismatch]})").warn if @cmd !~/q/
+ SiSU_Screen::Ansi.new(@opt.cmd,'endnote number mismatch',"endnotes: #{@en[:note]} != endnote reference marks: #{@en[:mark]} (difference = #{@en[:mismatch]})").warn if @opt.cmd !~/q/
footnote_conversion_errors=File.new("#{Dir.pwd}/footnote_conversion_errors.txt",'a')
footnote_conversion_errors << "#{@fns}:\n\tendnotes: #{@en[:note]} != endnote reference marks: #{@en[:mark]} (difference = #{@en[:mismatch]})\n"
end
@@ -1274,7 +1274,7 @@ module SiSU_Param
and @opt.inspect =~/P/
#@title=Md.new('Text Insert',@opt,@env).title
else
- SiSU_Screen::Ansi.new(@cmd,'WARNING Document Title missing','please provide @title:').warn unless @cmd =~/q/
+ SiSU_Screen::Ansi.new(@opt.cmd,'WARNING Document Title missing','please provide @title:').warn unless @opt.cmd =~/q/
end
end
if @author !~/[\S]/
@@ -1282,7 +1282,7 @@ module SiSU_Param
and @opt.inspect =~/P/
#@creator=Md.new('Text Insert',@opt,@env).creator
else
- SiSU_Screen::Ansi.new(@cmd,'Warning Document Author missing','please provide @creator: :author:').warn unless @cmd =~/q/
+ SiSU_Screen::Ansi.new(@opt.cmd,'Warning Document Author missing','please provide @creator: :author:').warn unless @opt.cmd =~/q/
end
end
@struct={}
@@ -1349,7 +1349,7 @@ module SiSU_Param
@lv5 ||=/^5~/
@lv6 ||=/^6~/
if @doc_skin
- SiSU_Screen::Ansi.new(@cmd,"doc_skin <- #{@doc_skin}").txt_grey if @cmd =~/v/
+ SiSU_Screen::Ansi.new(@opt.cmd,"doc_skin <- #{@doc_skin}").txt_grey if @opt.cmd =~/v/
end
@data=nil #else whole file's contents are stored in md pstore & is not required to be... big waste actually
@file=SiSU_Env::SiSU_file.new(self) #watch
@@ -1364,7 +1364,7 @@ module SiSU_Param
end
def store
File.unlink(@pstorefile) if FileTest.file?(@pstorefile)
- SiSU_Screen::Ansi.new(@md.cmd,"PStore -> #{@pstorefile}").txt_grey if @md.cmd =~/[MV]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"PStore -> #{@pstorefile}").txt_grey if @md.opt.cmd =~/[MV]/
store=PStore.new(@pstorefile)
store.transaction do
store['md']=@md
diff --git a/lib/sisu/v3/plaintext.rb b/lib/sisu/v3/plaintext.rb
index 8ff64b30..74de7a0e 100644
--- a/lib/sisu/v3/plaintext.rb
+++ b/lib/sisu/v3/plaintext.rb
@@ -118,12 +118,12 @@ module SiSU_Plaintext
@env=SiSU_Env::Info_env.new(@md.fns)
@brace_url=SiSU_Viz::Skin.new.url_decoration
@tab="\t"
- @@endnotes_=case md.mod.inspect
+ @@endnotes_=case md.opt.mod.inspect
when /--footnote/; false
when /--endnote/; true
else true
end
- @br=case md.mod.inspect
+ @br=case md.opt.mod.inspect
when /--dos/; "\r\n"
when /--unix/; "\n"
else "\n"
diff --git a/lib/sisu/v3/po4a.rb b/lib/sisu/v3/po4a.rb
index ba892634..d65191e0 100644
--- a/lib/sisu/v3/po4a.rb
+++ b/lib/sisu/v3/po4a.rb
@@ -172,8 +172,8 @@ module SiSU_po4a
@brace_url=SiSU_Viz::Skin.new.url_decoration
@vz=SiSU_Env::Get_init.instance.skin
@tab="\t"
- @@endnotes_=(@md.mod.inspect =~/--endnote/) ? true : false # --footnote
- @br=(@md.mod.inspect =~/--dos/) ? "\r\n" : "\n" # --unix
+ @@endnotes_=(@md.opt.mod.inspect =~/--endnote/) ? true : false # --footnote
+ @br=(@md.opt.mod.inspect =~/--dos/) ? "\r\n" : "\n" # --unix
@pot={ body: [], open: [], close: [], head: [], metadata: [], tail: [] }
end
def songsheet
@@ -213,7 +213,7 @@ module SiSU_po4a
d="#{nt} #{@fn}"
mark="^~ "
instruct=s_mark=''
- if @md.cmd=~/M/
+ if @md.opt.cmd=~/M/
instruct=%{\n# footnotes, the preferred sisu markup for a footnote is~{this is a footnote}~ however, for translation a footnote reference marker in the text~^ with a set of notes following the paragraph starting on a newline with "^~ this is a footnote", is easier to deal with, if possible these should be converted back to~{inline notes}~}
s_mark="\n# " + %{"\\n\\n#{mark}...\\n\\n"}
end
@@ -518,7 +518,7 @@ GSUB
mark="#{dob_src.lv}~#{fn} "
d="#{dob_src.is} (level #{dob_src.lv})"
instruct=s_mark=''
- if @md.cmd=~/M/
+ if @md.opt.cmd=~/M/
instruct=%{\n# markup for headings is marker at the start of the line/object, indicating the heading level, and if provided an associated name tag, this heading is "#{mark}"}
s_mark="\n# " + %{"\\n\\n#{mark}...\\n\\n"}
end
@@ -546,7 +546,7 @@ GSUB
mark="_#{dob_src.indent}* "
d="#{dob_src.is}: indent #{dob_src.indent}, bullet"
instruct=s_mark=''
- if @md.cmd=~/M/
+ if @md.opt.cmd=~/M/
instruct=%{\n# markup for indented bullet text is at the start of the line/object, an underscore followed by the indent level and an asterisk "#{mark}"}
s_mark="\n# " + %{"\\n\\n#{mark}...\\n\\n"}
end
@@ -555,7 +555,7 @@ GSUB
mark="_#{dob_src.indent} "
d="#{dob_src.is}: indent #{dob_src.indent}"
instruct=s_mark=''
- if @md.cmd=~/M/
+ if @md.opt.cmd=~/M/
instruct=%{\n# markup for indented text is at the start of the line/object, an underscore followed by the indent level "#{mark}"}
s_mark="\n# " + %{"\\n\\n#{mark}...\\n\\n"}
end
@@ -570,7 +570,7 @@ GSUB
mark='_* '
d="#{dob_src.is}: bullet"
instruct=s_mark=''
- if @md.cmd=~/M/
+ if @md.opt.cmd=~/M/
instruct=%{\n# markup for indented text is at the start of the line/object, an underscore followed by an asterisk "#{mark}"}
s_mark="\n# " + %{"\\n\\n#{mark}...\\n\\n"}
end
@@ -581,7 +581,7 @@ GSUB
mark=''
d=dob_src.is
instruct=%{\n# regular paragraph, no special markup}
- if @md.cmd=~/M/
+ if @md.opt.cmd=~/M/
instruct="\n# "
s_mark="\n# " + %{"\\n\\n#{mark}...\\n\\n"}
end
@@ -607,7 +607,7 @@ GSUB
mark="block{\\n\\n...\\n\\n}block"
d=dob_src.is
instruct=s_mark=''
- if @md.cmd=~/M/
+ if @md.opt.cmd=~/M/
instruct="\n# block text is a text block with an opening and closing marker, the content of which may be wrapped"
s_mark="\n# " + %{"\\n\\n#{mark}\\n\\n"}
end
@@ -622,7 +622,7 @@ GSUB
mark="group{\\n\\n...\\n\\n}group"
d=dob_src.is
instruct=s_mark=''
- if @md.cmd=~/M/
+ if @md.opt.cmd=~/M/
instruct="\n# group text is a text block with an opening and closing marker, the content of which may be wrapped"
s_mark="\n# " + %{"\\n\\n#{mark}\\n\\n"}
end
@@ -637,7 +637,7 @@ GSUB
mark="poem{\n\nverse\n\nverse\n\n...\n\n}poem"
d=dob_src.is
instruct=s_mark=''
- if @md.cmd=~/M/
+ if @md.opt.cmd=~/M/
instruct="\n# verse are part of the text block described as a poem, the first verse is preceeded by an opening marker, and the last verse by a closing marker, the content of which should remain unwrapped"
s_mark="\n# " + %{"\\n\\n#{mark}\\n\\n"}
end
@@ -652,7 +652,7 @@ GSUB
mark="code{\\n\\n...\\n\\n}code"
d=dob_src.is
instruct=s_mark=''
- if @md.cmd=~/M/
+ if @md.opt.cmd=~/M/
instruct="\n# codeblocks are a text block with an opening and closing marker, the content of which should remain unwrapped"
s_mark="\n# " + %{"\\n\\n#{mark}\\n\\n"}
end
@@ -667,7 +667,7 @@ GSUB
mark="table{\\n\\n...\\n\\n}table"
d=dob_src.is
instruct=s_mark=''
- if @md.cmd=~/M/
+ if @md.opt.cmd=~/M/
instruct="\n# tables are a text block with an opening and closing marker, the content of which should remain unwrapped"
s_mark="\n# " + %{"\\n\\n#{mark}\\n\\n"}
end
@@ -683,7 +683,7 @@ GSUB
def pot_structure_idx(dob_src='',dob_trn='') #% Used to extract the structure of a document
mark="={ ... }"
instruct=s_mark=''
- if @md.cmd=~/M/
+ if @md.opt.cmd=~/M/
instruct="\n# the book index should be attached unwrapped to the preceding text block (there should be a new line, but no empty line)"
s_mark="\n# " + %{"\\n#{mark}\\n\\n"}
end
@@ -730,11 +730,11 @@ GSUB
if (data_src[s].is == 'comment' or data_trn[t].is == 'comment') \
and (data_src[s].is != data_trn[t].is)
if data_src[s].is == 'comment'
- puts "src (comment):\n\t" + data_src[s].obj if @md.cmd =~/M/
+ puts "src (comment):\n\t" + data_src[s].obj if @md.opt.cmd =~/M/
s+=1
#next if data_src[s].is == 'comment'
elsif data_trn[t].is == 'comment'
- puts "trans (comment):\n\t" + data_trn[t].obj if @md.cmd =~/M/
+ puts "trans (comment):\n\t" + data_trn[t].obj if @md.opt.cmd =~/M/
t+=1
#next if data_trn[t].is == 'comment'
end
@@ -943,7 +943,7 @@ GSUB
po4a_git
end
def po4a_git
- unless @md.cmd =~/M/
+ unless @md.opt.cmd =~/M/
require_relative 'git' # git.rb
git=SiSU_Git::Source.new(@md.opt)
git.create_file_structure_git unless FileTest.directory?(@file.output_path.pot_git)
diff --git a/lib/sisu/v3/rexml.rb b/lib/sisu/v3/rexml.rb
index d3053ee9..fd15865f 100644
--- a/lib/sisu/v3/rexml.rb
+++ b/lib/sisu/v3/rexml.rb
@@ -88,10 +88,10 @@ module SiSU_Rexml
xmlfile=IO.readlines(@fnap,'').join
begin
@xmldoc=REXML::Document.new xmlfile
- SiSU_Screen::Ansi.new(@md.cmd,'invert','REXML',"XML document #{@fnap} loaded").colorize unless @md.cmd =~/q/ #% tell
- if @md.cmd =~ /v/i #% substantive text
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'invert','REXML',"XML document #{@fnap} loaded").colorize unless @md.opt.cmd =~/q/ #% tell
+ if @md.opt.cmd =~ /v/i #% substantive text
@xmldoc.elements.each(@e_head) do |e|
- SiSU_Screen::Ansi.new(@md.cmd,'brown',e).colorize unless @md.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'brown',e).colorize unless @md.opt.cmd =~/q/
end
end
rescue REXML::ParseException
@@ -99,10 +99,10 @@ module SiSU_Rexml
end
end
else
- SiSU_Screen::Ansi.new(@md.cmd,'fuschia',"File Not Found #{xmlfile}",'requested XML processing skipped').colorize unless @md.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'fuschia',"File Not Found #{xmlfile}",'requested XML processing skipped').colorize unless @md.opt.cmd =~/q/
exit
end
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
end
end
diff --git a/lib/sisu/v3/shared_markup_alt.rb b/lib/sisu/v3/shared_markup_alt.rb
index 738ec75a..a7d08cae 100644
--- a/lib/sisu/v3/shared_markup_alt.rb
+++ b/lib/sisu/v3/shared_markup_alt.rb
@@ -261,7 +261,7 @@ module SiSU_text_representation
elsif FileTest.file?("#{@env.path.image_source_include}/#{i}")
@env.path.image_source_include
else
- SiSU_Screen::Ansi.new(@md.cmd,"ERROR - image:", %{"#{i}" missing}, "search locations: #{@env.path.image_source_include_local}, #{@env.path.image_source_include_remote} and #{@env.path.image_source_include}").error2 unless @md.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"ERROR - image:", %{"#{i}" missing}, "search locations: #{@env.path.image_source_include_local}, #{@env.path.image_source_include_remote} and #{@env.path.image_source_include}").error2 unless @md.opt.cmd =~/q/
nil
end
img_type = /\S+\.(png|jpg|gif)/.match(i)[1]
diff --git a/lib/sisu/v3/sst_do_inline_footnotes.rb b/lib/sisu/v3/sst_do_inline_footnotes.rb
index 18252515..27ccf6db 100644
--- a/lib/sisu/v3/sst_do_inline_footnotes.rb
+++ b/lib/sisu/v3/sst_do_inline_footnotes.rb
@@ -128,15 +128,15 @@ module SiSU_Convert_footnotes
meta=meta.join.split("\n\n") #check whether can be eliminated, some of these are large objects to have twice
@md=SiSU_Param::Parameters::Instructions.new(meta,@opt).extract
if @md.en[:mismatch]==0 \
- or @md.mod.inspect =~/=footnotes-force/
+ or @md.opt.mod.inspect =~/=footnotes-force/
meta=nil
dal=SiSU_Convert_footnotes::Make.new(@md,file_array).song
- SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@md.fns}.fn").output if @md.cmd =~/v/
- SiSU_Screen::Ansi.new(@opt.cmd,"#{@md.fns}.fn -> #{@md.fns}.fn").txt_red unless @md.cmd =~/q/
+ SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@md.fns}.fn").output if @md.opt.cmd =~/v/
+ SiSU_Screen::Ansi.new(@opt.cmd,"#{@md.fns}.fn -> #{@md.fns}.fn").txt_red unless @md.opt.cmd =~/q/
dal.each {|s| dal_array << "#{s.strip}\n\n" unless s.strip.empty?}
dal_array
else
- SiSU_Screen::Ansi.new(@md.cmd,'no footnote conversion done, problem with source file','to override use --convert=footnote-force (this is not advised)').warn if @cmd !~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'no footnote conversion done, problem with source file','to override use --convert=footnote-force (this is not advised)').warn if @cmd !~/q/
''
end
end
@@ -350,7 +350,7 @@ module SiSU_Convert_footnotes
end
def set_heading_top #% make sure no false positives
unless @md.set_heading_top
- puts "\tdocument contains no top level heading, (will have to manufacture one)" if @md.cmd =~/[MV]/
+ puts "\tdocument contains no top level heading, (will have to manufacture one)" if @md.opt.cmd =~/[MV]/
data=@data
@tuned_file=[]
data.each do |para|
@@ -371,7 +371,7 @@ module SiSU_Convert_footnotes
end
def set_heading_seg #% make sure no false positives
unless @md.set_heading_seg
- puts "\tdocument contains no segment level, (will have to manufacture one)" if @md.cmd =~/[MV]/
+ puts "\tdocument contains no segment level, (will have to manufacture one)" if @md.opt.cmd =~/[MV]/
data=@data
@tuned_file=[]
data.each do |para|
@@ -393,7 +393,7 @@ module SiSU_Convert_footnotes
end
def set_header_title #% make sure no false positives
unless @md.set_header_title
- puts "\t no document title provided, (will have to manufacture one)" if @md.cmd =~/[MV]/
+ puts "\t no document title provided, (will have to manufacture one)" if @md.opt.cmd =~/[MV]/
data=@data
@tuned_file=[]
data.each do |para|
diff --git a/lib/sisu/v3/sst_to_s_xml_sax.rb b/lib/sisu/v3/sst_to_s_xml_sax.rb
index e698a8f9..c9cdd241 100644
--- a/lib/sisu/v3/sst_to_s_xml_sax.rb
+++ b/lib/sisu/v3/sst_to_s_xml_sax.rb
@@ -120,9 +120,9 @@ module SiSU_simple_xml_model_sax
def songsheet
begin
SiSU_simple_xml_model_sax::Convert::Scroll.new(@data,@particulars).songsheet
- SiSU_simple_xml_model_sax::Convert::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/ # test wellformedness, comment out when not in use
- SiSU_Rexml::Rexml.new(@md,@md.fn[:sxs]).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ SiSU_simple_xml_model_sax::Convert::Tidy.new(@md,@env).xml if @md.opt.cmd =~/[vVM]/ # test wellformedness, comment out when not in use
+ SiSU_Rexml::Rexml.new(@md,@md.fn[:sxs]).xml if @md.opt.cmd =~/M/ # test rexml parsing, comment out when not in use #debug
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
end
end
@@ -436,14 +436,14 @@ WOK
end
def xml
if @prog.tidy !=false #note values can be other than true
- if @md.cmd =~/[VM]/
- SiSU_Screen::Ansi.new(@md.cmd,'invert','Using XML Tidy','check document structure').colorize unless @md.cmd =~/q/
- SiSU_Screen::Ansi.new(@md.cmd,'','','check document structure')
- tell.grey_open unless @md.cmd =~/q/
+ if @md.opt.cmd =~/[VM]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'invert','Using XML Tidy','check document structure').colorize unless @md.opt.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'','','check document structure')
+ tell.grey_open unless @md.opt.cmd =~/q/
tidyfile='/dev/null' #don't want one or screen output, check for alternative flags
tidy =SiSU_Env::System_call.new("#{Dir.pwd}/#{@md.fn[:sxs]}",tidyfile)
tidy.well_formed?
- tell.p_off unless @md.cmd =~/q/
+ tell.p_off unless @md.opt.cmd =~/q/
end
end
end
diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb
index a573a6c0..e3aee003 100644
--- a/lib/sisu/v3/sysenv.rb
+++ b/lib/sisu/v3/sysenv.rb
@@ -191,7 +191,6 @@ module SiSU_Env
PROCESSING_TUNE => 'tune',
PROCESSING_LATEX => 'tex',
PROCESSING_TEXINFO => 'texinfo',
- PROCESSING_LOUT => 'lout',
PROCESSING_SQLITE => 'sqlite',
PROCESSING_POSTGRESQL=> 'postgresql',
PROCESSING_ENCODING => 'encoding',
@@ -225,7 +224,8 @@ module SiSU_Env
: ["#{@@home}/.sisu",@@sisu_etc]
attr_accessor :user,:home,:hostname,:pwd,:host,:arch,:rbver,:dir_arch,:dir_sitearch,:dir_bin,:locale,:webserv_path,:webserv_host_cgi,:webserv_port_cgi,:default_dir,:rc_path,:yamlrc_path,:ad_path
def initialize
- @user,@home,@hostname,@pwd,@sisu_etc,@host,@arch,@rbver,@dir_arch,@dir_sitearch,@dir_bin,@locale,@default_dir,@rc_path,@yamlrc_path,@ad_path=@@user,@@home,@@hostname,@@pwd,@@sisu_etc,@@host,@@arch,@@rbver,@@dir_arch,@@dir_sitearch,@@dir_bin,@@locale,@@default_dir,@@rc_path,@@yamlrc_path,@@ad_path
+ @user,@home,@hostname,@pwd,@sisu_etc,@host,@arch,@rbver,@dir_arch,@dir_sitearch,@dir_bin,@locale,@default_dir,@rc_path,@yamlrc_path,@ad_path=\
+ @@user,@@home,@@hostname,@@pwd,@@sisu_etc,@@host,@@arch,@@rbver,@@dir_arch,@@dir_sitearch,@@dir_bin,@@locale,@@default_dir,@@rc_path,@@yamlrc_path,@@ad_path
#note rbver is duplicated in Info_version
end
end
@@ -890,7 +890,6 @@ module SiSU_Env
@fnb ||=@@fb #clean up this... used primarily for zap which is not passed normal parameters
@fixed_websev_root='' # @home
@pwd=@@pwd=Dir.pwd
-# @pwd=@@pwd||=Dir.pwd
m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m
@stub_pwd=@@pwd[m,1]
@stub_txt= @stub_pwd + '/txt'
@@ -1815,15 +1814,15 @@ WOK
end
def webrick_port
if @md \
- and @md.cmd.inspect=~/-F/ \
- and @md.mod.inspect=~/port=(\d+)/
+ and @md.opt.cmd.inspect=~/-F/ \
+ and @md.opt.mod.inspect=~/port=(\d+)/
$1
else
if defined? @rc['webserv_cgi']['port']
if @rc['webserv_cgi']['port'].nil? \
- and (defined? @md.mod \
- and not @md.mod.nil? \
- and @md.mod.inspect=~/webrick/)
+ and (defined? @md.opt.mod \
+ and not @md.opt.mod.nil? \
+ and @md.opt.mod.inspect=~/webrick/)
defaults[:webserv_port_cgi]
elsif not @rc['webserv_cgi']['port'].nil?
@rc['webserv_cgi']['port']
@@ -1835,15 +1834,16 @@ WOK
end
def webserv_port_cgi
if @md \
- and @md.cmd.inspect=~/-F/ \
- and @md.mod.inspect=~/port=(\d+)/
+ and defined? @md.opt \
+ and @md.opt.cmd.inspect=~/-F/ \
+ and @md.opt.mod.inspect=~/port=(\d+)/
$1
else
if defined? @rc['webserv_cgi']['port']
if @rc['webserv_cgi']['port'].nil? \
- and (defined? @md.mod \
- and not @md.mod.nil? \
- and @md.mod.inspect=~/webrick/)
+ and (defined? @md.opt.mod \
+ and not @md.opt.mod.nil? \
+ and @md.opt.mod.inspect=~/webrick/)
defaults[:webserv_port_cgi]
elsif not @rc['webserv_cgi']['port'].nil?
@rc['webserv_cgi']['port']
@@ -2304,44 +2304,44 @@ WOK
if @md \
and defined? @md.fn \
and @md.fn # used for by_language_code?
- if @md.cmd =~ /[hH]/
+ if @md.opt.cmd =~ /[hH]/
ft << @md.fn[:html]
end
- if @md.cmd =~ /w/ \
- and @md.cmd !~ /[hH]/
+ if @md.opt.cmd =~ /w/ \
+ and @md.opt.cmd !~ /[hH]/
ft << @md.fn[:concordance]
end
- if @md.cmd =~ /y/ \
- and @md.cmd !~ /[hH]/
+ if @md.opt.cmd =~ /y/ \
+ and @md.opt.cmd !~ /[hH]/
ft << @md.fn[:manifest]
end
- if @md.cmd =~ /[at]/; ft << @md.fn[:plain]
+ if @md.opt.cmd =~ /[at]/; ft << @md.fn[:plain]
end
- if @md.cmd =~ /b/; ft << @md.fn[:xhtml]
+ if @md.opt.cmd =~ /b/; ft << @md.fn[:xhtml]
end
- if @md.cmd =~ /e/; ft << @md.fn[:epub]
+ if @md.opt.cmd =~ /e/; ft << @md.fn[:epub]
end
- if @md.cmd =~ /g/; ft << @md.fn[:wiki]
+ if @md.opt.cmd =~ /g/; ft << @md.fn[:wiki]
end
- if @md.cmd =~ /i/; ft << @md.fn[:manpage]
+ if @md.opt.cmd =~ /i/; ft << @md.fn[:manpage]
end
- if @md.cmd =~ /N/; ft << @md.fn[:digest]
+ if @md.opt.cmd =~ /N/; ft << @md.fn[:digest]
end
- if @md.cmd =~ /o/; ft << @md.fn[:odf]
+ if @md.opt.cmd =~ /o/; ft << @md.fn[:odf]
end
- if @md.cmd =~ /O/; ft << @md.fn[:oai_pmh]
+ if @md.opt.cmd =~ /O/; ft << @md.fn[:oai_pmh]
end
- if @md.cmd =~ /p/; ft << @md.fn[:pdf_l] << @md.fn[:pdf_p]
+ if @md.opt.cmd =~ /p/; ft << @md.fn[:pdf_l] << @md.fn[:pdf_p]
end
- if @md.cmd =~ /s/; ft << @md.fns
+ if @md.opt.cmd =~ /s/; ft << @md.fns
end
- if @md.cmd =~ /S/; ft << @md.fn[:sisupod] << '.kdi'
+ if @md.opt.cmd =~ /S/; ft << @md.fn[:sisupod] << '.kdi'
end
- if @md.cmd =~ /x/; ft << @md.fn[:sax]
+ if @md.opt.cmd =~ /x/; ft << @md.fn[:sax]
end
- if @md.cmd =~ /X/; ft << @md.fn[:dom]
+ if @md.opt.cmd =~ /X/; ft << @md.fn[:dom]
end
- if @md.cmd =~ /G/; ft << @md.fn[:pot]
+ if @md.opt.cmd =~ /G/; ft << @md.fn[:pot]
end
@fnb=@md.fnb
else # still needed where/when param is not parsed
@@ -3744,7 +3744,7 @@ WOK
skin_path << "#{@env.processing_path.processing}/external_document/skin"
skin=true
if @pwd_stub =~/^sisupod$/ \
- and @md.mod.inspect !~/--trust/
+ and @md.opt.mod.inspect !~/--trust/
skin=false #security only run skins on sisupod if --trust flag is provided
end
doc_skin,dir_skin=nil,nil
diff --git a/lib/sisu/v3/texinfo.rb b/lib/sisu/v3/texinfo.rb
index 14602fb7..f7693056 100644
--- a/lib/sisu/v3/texinfo.rb
+++ b/lib/sisu/v3/texinfo.rb
@@ -138,7 +138,7 @@ module SiSU_TexInfo
@data=tail
output
makeinfo #KEEP reinstate when fixed #%
- rescue; STDERR.puts SiSU_Screen::Ansi.new(@md.cmd,$!,$@).rescue
+ rescue; STDERR.puts SiSU_Screen::Ansi.new(@md.opt.cmd,$!,$@).rescue
ensure
end
end
@@ -361,7 +361,7 @@ module SiSU_TexInfo
data.compact!
filename=%{#{@env.processing_path.texi}/#{@md.fnb}.texinfo}
filename_texinfo=File.new(filename,'w+')
- puts filename if @md.cmd =~/M/
+ puts filename if @md.opt.cmd =~/M/
data.each {|s| (filename_texinfo.puts s,"\n") if s}
filename_texinfo.close
end
@@ -372,7 +372,7 @@ module SiSU_TexInfo
pwd=Dir.pwd
case sfx
when /(?:-|ssm\.)?sst$/
- @env=SiSU_Env::Info_env.new(@md.fns,@md.cmd)
+ @env=SiSU_Env::Info_env.new(@md.fns,@md.opt.cmd)
Dir.chdir(@env.processing_path.texi)
texinfo=SiSU_Env::System_call.new("#{fnb}.texinfo")
texinfo.makeinfo
diff --git a/lib/sisu/v3/texpdf.rb b/lib/sisu/v3/texpdf.rb
index 9497d51f..42c565b7 100644
--- a/lib/sisu/v3/texpdf.rb
+++ b/lib/sisu/v3/texpdf.rb
@@ -110,7 +110,7 @@ module SiSU_TeX
SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.program.pdf_viewer} #{@md.file.output_path.pdf}/#{@md.file.base_filename.pdf_p}pdf").flow
end
@md=@particulars.md
- $flag=@md.cmd #introduced to pass 0 for no object citation numbers... to texpdf_format
+ $flag=@md.opt.cmd #introduced to pass 0 for no object citation numbers... to texpdf_format
directories
#% needed needs to be reprogrammed !!!
SiSU_Env::Info_skin.new(@md).select
@@ -153,24 +153,24 @@ module SiSU_TeX
def latex_do(texfilename,papersize)
@texfilename=texfilename
@@n_lpdf=@@n_lpdf+1
- SiSU_Screen::Ansi.new(@md.cmd,"#{papersize} portrait ->").dark_grey_title_hi if @md.cmd =~/[MVv]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"#{papersize} portrait ->").dark_grey_title_hi if @md.opt.cmd =~/[MVv]/
tex_fn_base=@texfilename.gsub(/\.tex$/,'')
- cmd=SiSU_Env::System_call.new("#{tex_fn_base}.tex",'',@md.cmd)
- tell=SiSU_Screen::Ansi.new(@md.cmd)
- tell.grey_open if @md.cmd =~/[MVv]/
+ cmd=SiSU_Env::System_call.new("#{tex_fn_base}.tex",'',@md.opt.cmd)
+ tell=SiSU_Screen::Ansi.new(@md.opt.cmd)
+ tell.grey_open if @md.opt.cmd =~/[MVv]/
if "#{tex_fn_base}" =~/\w+/ \
and "#{papersize}" =~/\w+/
2.times { |i| cmd.latex2pdf(@md,papersize) } #comment out to skip processing of latex portrait
end
- tell.p_off if @md.cmd =~/[MVv]/
- SiSU_Screen::Ansi.new(@md.cmd,"#{papersize} landscape ->").dark_grey_title_hi if @md.cmd =~/[MVv]/
- cmd=SiSU_Env::System_call.new("#{tex_fn_base}.landscape.tex",'',@md.cmd)
- tell.grey_open if @md.cmd =~/[MVv]/
+ tell.p_off if @md.opt.cmd =~/[MVv]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"#{papersize} landscape ->").dark_grey_title_hi if @md.opt.cmd =~/[MVv]/
+ cmd=SiSU_Env::System_call.new("#{tex_fn_base}.landscape.tex",'',@md.opt.cmd)
+ tell.grey_open if @md.opt.cmd =~/[MVv]/
if "#{tex_fn_base}" =~/\w+/ \
and "#{papersize}" =~/\w+/
2.times { |i| cmd.latex2pdf(@md,papersize) } #comment out to skip processing of latex landscape
end
- tell.p_off if @md.cmd =~/[MVv]/
+ tell.p_off if @md.opt.cmd =~/[MVv]/
pwd=Dir.pwd
portrait_pdf="#{pwd}/#{tex_fn_base}.pdf"
landscape_pdf="#{pwd}/#{tex_fn_base}.landscape.pdf"
@@ -186,14 +186,14 @@ module SiSU_TeX
if FileTest.file?(portrait_pdf)
cp(portrait_pdf,"#{@md.file.output_path.pdf}/#{pdf_p}")
rm(portrait_pdf)
- else p "#{__FILE__}:#{__LINE__} NOT FOUND: #{portrait_pdf}" if @md.cmd.inspect =~/M/
+ else p "#{__FILE__}:#{__LINE__} NOT FOUND: #{portrait_pdf}" if @md.opt.cmd.inspect =~/M/
end
if FileTest.file?(landscape_pdf)
cp(landscape_pdf,"#{@md.file.output_path.pdf}/#{pdf_l}")
rm(landscape_pdf)
- else p "#{__FILE__}:#{__LINE__} NOT FOUND: #{landscape_pdf}" if @md.cmd.inspect =~/M/
+ else p "#{__FILE__}:#{__LINE__} NOT FOUND: #{landscape_pdf}" if @md.opt.cmd.inspect =~/M/
end
- SiSU_Screen::Ansi.new(@md.cmd,@@n_lpdf,'processed (SiSU LaTeX to pdf - using pdfetex aka. pdftex or pdflatex)').generic_number if @md.cmd =~/[MVv]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,@@n_lpdf,'processed (SiSU LaTeX to pdf - using pdfetex aka. pdftex or pdflatex)').generic_number if @md.opt.cmd =~/[MVv]/
end
def latexrun_selective
begin
@@ -213,7 +213,7 @@ module SiSU_TeX
if File.exist?(texfile) \
and File.size(texfile) > 0
@tex_f_no+=1
- #p "#{__FILE__}:#{__LINE__} texpdf generation disabled" if @md.cmd.inspect =~/M/ #%% disable temporarily, re-enable
+ #p "#{__FILE__}:#{__LINE__} texpdf generation disabled" if @md.opt.cmd.inspect =~/M/ #%% disable temporarily, re-enable
latex_do(texfile,ps)
else
puts "\tzero file size #{@env.processing_path.tex}/#{texfile}"
@@ -255,11 +255,11 @@ module SiSU_TeX
")
end
else
- SiSU_Screen::Ansi.new(@md.cmd,"FILE NOT FOUND: << #{@md.fns} >> - requested latex system processing skipped").warn
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"FILE NOT FOUND: << #{@md.fns} >> - requested latex system processing skipped").warn
end
lst=Dir["*.{aux,log,out}"]
lst.each {|file| File.unlink(file)} if lst
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
end
end
end
@@ -295,7 +295,7 @@ module SiSU_TeX
data=@data
@@tex_footnote_array=[]
@@rights=nil
- SiSU_Screen::Ansi.new(@md.cmd,"pdfTex portrait & landscape").txt_grey if @md.cmd=~/[MVvz]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"pdfTex portrait & landscape").txt_grey if @md.opt.cmd=~/[MVvz]/
if defined? @md.rights.all \
and not @md.rights.all.empty?
rght=@md.rights #.author.dup #dup is necessary, else contents of :rights changed
@@ -319,7 +319,7 @@ module SiSU_TeX
data=tables(data) #uncomment to start experimenting with tables
end
ocn=if @md.markup.inspect =~/no_ocn/ \
- or @md.mod.inspect =~/--no-ocn/ \
+ or @md.opt.mod.inspect =~/--no-ocn/ \
or @skin_no_ocn
false
else true
@@ -327,7 +327,7 @@ module SiSU_TeX
data=number_paras(data)
data=markup(data)
output(data)
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
end
end
@@ -656,7 +656,7 @@ WOK
p: markup_common(dob.tmp[ps][:p]),
l: markup_common(dob.tmp[ps][:l])
}
- else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/
+ else p "#{__FILE__}:#{__LINE__}" if @md.opt.cmd.inspect =~/M/
end
end
end
@@ -666,7 +666,7 @@ WOK
p: markup_common(dob.tmp[:p]),
l: markup_common(dob.tmp[:l])
}
- else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/
+ else p "#{__FILE__}:#{__LINE__}" if @md.opt.cmd.inspect =~/M/
end
end
@tex_file << dob
@@ -690,7 +690,7 @@ WOK
paranum=dob.ocn ? dob.ocn : ''
paranum = '' if paranum.to_i==0
paranumber_display=if @md.markup.inspect =~/no_ocn/ \
- or @md.mod.inspect =~/--no-ocn/ \
+ or @md.opt.mod.inspect =~/--no-ocn/ \
or not dob.ocn_
''
else
@@ -725,7 +725,7 @@ WOK
l: number_paras_numbering(dob.tmp[ps][:l])
}
dob.tmp=para_hash
- else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/
+ else p "#{__FILE__}:#{__LINE__}" if @md.opt.cmd.inspect =~/M/
end
end
end
@@ -734,7 +734,7 @@ WOK
p: number_paras_numbering(dob.tmp[:p]),
l: number_paras_numbering(dob.tmp[:l])
}
- else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/
+ else p "#{__FILE__}:#{__LINE__}" if @md.opt.cmd.inspect =~/M/
end
else
dob=if dob.of !~/comment|meta|layout/
@@ -770,7 +770,7 @@ WOK
if h[:l] !~/\A\s*\Z/
fn[:landscape].puts h[:l],"\n"
end
- else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/
+ else p "#{__FILE__}:#{__LINE__}" if @md.opt.cmd.inspect =~/M/
end
end
def output(array)
diff --git a/lib/sisu/v3/texpdf_format.rb b/lib/sisu/v3/texpdf_format.rb
index b235e1fc..90dd7452 100644
--- a/lib/sisu/v3/texpdf_format.rb
+++ b/lib/sisu/v3/texpdf_format.rb
@@ -334,7 +334,7 @@ module SiSU_TeX_Pdf
@txt.gsub!(/<:=\s*(\S+?)\s*>/,
"\\includegraphics*[width=11pt]{#{dir.path.image_source_include}/c_\\1.png}")
else
- SiSU_Screen::Ansi.new(@md.cmd,"ERROR - image:",%{"#{image}" missing},"search path: #{dir.path.image_source_include}").error2 unless @md.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"ERROR - image:",%{"#{image}" missing},"search path: #{dir.path.image_source_include}").error2 unless @md.opt.cmd =~/q/
@txt.gsub!(/#{Mx[:lnk_o]}\S+\.(png|jpg|gif).+?#{Mx[:lnk_c]}#{Mx[:url_o]}\S+?#{Mx[:url_c]}/,'') # fragile match operator\\ fragile !
end
end
@@ -352,7 +352,7 @@ module SiSU_TeX_Pdf
elsif FileTest.file?("#{dir.path.image_source_include}/#{image}")
dir.path.image_source_include
else
- SiSU_Screen::Ansi.new(@md.cmd,"ERROR - image:",%{"#{image}" missing},"search locations: #{dir.path.image_source_include_local},#{dir.path.image_source_include_remote} and #{dir.path.image_source_include}").error2 unless @md.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"ERROR - image:",%{"#{image}" missing},"search locations: #{dir.path.image_source_include_local},#{dir.path.image_source_include_remote} and #{dir.path.image_source_include}").error2 unless @md.opt.cmd =~/q/
nil
end
if image_source #CHECK
@@ -389,7 +389,7 @@ module SiSU_TeX_Pdf
else
unless image.nil? \
or image.length < 2
- SiSU_Screen::Ansi.new(@md.cmd,"ERROR - image:",%{"#{image}" missing},"search locations: #{dir.path.image_source_include_local},#{dir.path.image_source_include_remote} and #{dir.path.image_source_include}").error2 unless @md.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"ERROR - image:",%{"#{image}" missing},"search locations: #{dir.path.image_source_include_local},#{dir.path.image_source_include_remote} and #{dir.path.image_source_include}").error2 unless @md.opt.cmd =~/q/
end
nil
end
@@ -539,7 +539,7 @@ module SiSU_TeX_Pdf
hsp="\n{\\color{mywhite} .}&~\n" # ~ character for hardspace
caption=(c ? "{\\\\\ \n\\begin{scriptsize}#{hsp*3}#{c}\\end{scriptsize}&}" : '')
elsif images_hash[ps] =~/#{Mx[:lnk_o]}\s*(\S+\.?\.(?:png|jpg|gif))/m
- SiSU_Screen::Ansi.new(@md.cmd,%{document built without image: "#{$1}" as image dimensions not provided (either image not found or neither imagemagick nor graphicsmagick is installed)?\n}).print_grey #unless @opt.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,%{document built without image: "#{$1}" as image dimensions not provided (either image not found or neither imagemagick nor graphicsmagick is installed)?\n}).print_grey #unless @opt.cmd =~/q/
images_hash[ps].gsub!(/#{Mx[:lnk_o]}\s*(\S+\.?\.(?:png|jpg|gif))/,'[image]')
end
if image #most images fc etc. #% clean up !
@@ -576,7 +576,7 @@ module SiSU_TeX_Pdf
end
images_hash[ps]
else
- SiSU_Screen::Ansi.new(@md.cmd,"ERROR - image:",%{"#{image}" missing},"search locations: #{dir.path.image_source_include_local},#{dir.path.image_source_include_remote} and #{dir.path.image_source_include}").error2 unless @md.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,"ERROR - image:",%{"#{image}" missing},"search locations: #{dir.path.image_source_include_local},#{dir.path.image_source_include_remote} and #{dir.path.image_source_include}").error2 unless @md.opt.cmd =~/q/
if images_hash[ps] =~url_image_rgx \
or images_hash[ps] =~image_rgx
images_hash[ps]=''
@@ -1321,7 +1321,7 @@ WOK
sisu_ico=if FileTest.file?("#{dir.path.image_source_include}/sisu.png")
"\\includegraphics*[width=60pt]{#{dir.path.image_source_include}/sisu.png}"
else
- SiSU_Screen::Ansi.new(@md.cmd,'WARNING - image directory or image(s) missing:', %{"#{dir.path.image_source_include}"} ).warn unless @md.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'WARNING - image directory or image(s) missing:', %{"#{dir.path.image_source_include}"} ).warn unless @md.opt.cmd =~/q/
" SiSU "
end
url=@md.fnb.gsub(/(?:\\)*([$&~%_#}{^])/,'\\\\\1')
diff --git a/lib/sisu/v3/update.rb b/lib/sisu/v3/update.rb
index 7c35a5aa..473d3045 100644
--- a/lib/sisu/v3/update.rb
+++ b/lib/sisu/v3/update.rb
@@ -70,9 +70,9 @@ module SiSU_Update_control_flag
@env=SiSU_Env::Info_env.new(@md.fns)
out=@env.path.output
base_path="#{out}/#{@md.fnb}"
- SiSU_Screen::Ansi.new(@md.cmd,'Checking previous output',base_path).green_hi_blue unless @md.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'Checking previous output',base_path).green_hi_blue unless @md.opt.cmd =~/q/
Set_CF.new(@md).set_flags
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
end
end
diff --git a/lib/sisu/v3/xhtml.rb b/lib/sisu/v3/xhtml.rb
index 2b791a31..0871170a 100644
--- a/lib/sisu/v3/xhtml.rb
+++ b/lib/sisu/v3/xhtml.rb
@@ -107,9 +107,9 @@ module SiSU_XHTML
def song
begin
SiSU_XHTML::Source::Scroll.new(@particulars).songsheet
- SiSU_XHTML::Source::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/ # test wellformedness, comment out when not in use
- SiSU_Rexml::Rexml.new(@md,@file.place_file.xhtml).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ SiSU_XHTML::Source::Tidy.new(@md,@env).xml if @md.opt.cmd =~/[vVM]/ # test wellformedness, comment out when not in use
+ SiSU_Rexml::Rexml.new(@md,@file.place_file.xhtml).xml if @md.opt.cmd =~/M/ # test rexml parsing, comment out when not in use #debug
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
end
end
@@ -401,16 +401,16 @@ WOK
end
def xml
if @prog.tidy !=false
- if @md.cmd =~/[VM]/
- unless @md.cmd =~/q/
- SiSU_Screen::Ansi.new(@md.cmd,'invert','Using XML Tidy','check document structure').colorize
- tell=SiSU_Screen::Ansi.new(@md.cmd,'invert','','')
+ if @md.opt.cmd =~/[VM]/
+ unless @md.opt.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'invert','Using XML Tidy','check document structure').colorize
+ tell=SiSU_Screen::Ansi.new(@md.opt.cmd,'invert','','')
tell.grey_open
end
tidyfile='/dev/null' #don't want one or screen output, check for alternative flags
tidy=SiSU_Env::System_call.new("#{@env.path.output}/#{@md.fnb}/#{@md.fn[:xhtml]}",tidyfile)
tidy.well_formed?
- tell.p_off unless @md.cmd =~/q/
+ tell.p_off unless @md.opt.cmd =~/q/
end
end
end
diff --git a/lib/sisu/v3/xml.rb b/lib/sisu/v3/xml.rb
index 9b9bc3f5..1e68000b 100644
--- a/lib/sisu/v3/xml.rb
+++ b/lib/sisu/v3/xml.rb
@@ -107,9 +107,9 @@ module SiSU_XML_SAX
def song
begin
SiSU_XML_SAX::Source::Scroll.new(@particulars).songsheet
- SiSU_XML_SAX::Source::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/ # test wellformedness, comment out when not in use
- SiSU_Rexml::Rexml.new(@md,@file.place_file.xml_sax).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ SiSU_XML_SAX::Source::Tidy.new(@md,@env).xml if @md.opt.cmd =~/[vVM]/ # test wellformedness, comment out when not in use
+ SiSU_Rexml::Rexml.new(@md,@file.place_file.xml_sax).xml if @md.opt.cmd =~/M/ # test rexml parsing, comment out when not in use #debug
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
end
end
@@ -443,16 +443,16 @@ WOK
end
def xml
if @prog.tidy !=false #note values can be other than true
- if @md.cmd =~/[VM]/
- unless @md.cmd =~/q/
- SiSU_Screen::Ansi.new(@md.cmd,'invert','Using XML Tidy','check document structure').colorize
- tell=SiSU_Screen::Ansi.new(@md.cmd,'invert','','')
+ if @md.opt.cmd =~/[VM]/
+ unless @md.opt.cmd =~/q/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'invert','Using XML Tidy','check document structure').colorize
+ tell=SiSU_Screen::Ansi.new(@md.opt.cmd,'invert','','')
tell.grey_open
end
tidyfile='/dev/null' #don't want one or screen output, check for alternative flags
tidy=SiSU_Env::System_call.new("#{@env.path.output}/#{@md.fnb}/#{@md.fn[:sax]}",tidyfile)
tidy.well_formed?
- tell.p_off unless @md.cmd =~/q/
+ tell.p_off unless @md.opt.cmd =~/q/
end
end
end
diff --git a/lib/sisu/v3/xml_dom.rb b/lib/sisu/v3/xml_dom.rb
index 02180617..3f18a1b8 100644
--- a/lib/sisu/v3/xml_dom.rb
+++ b/lib/sisu/v3/xml_dom.rb
@@ -104,9 +104,9 @@ module SiSU_XML_DOM
def songsheet
begin
SiSU_XML_DOM::Source::Scroll.new(@particulars).songsheet
- SiSU_XML_DOM::Source::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/ # test wellformedness, comment out when not in use
- SiSU_Rexml::Rexml.new(@md,@file.place_file.xml_dom).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ SiSU_XML_DOM::Source::Tidy.new(@md,@env).xml if @md.opt.cmd =~/[vVM]/ # test wellformedness, comment out when not in use
+ SiSU_Rexml::Rexml.new(@md,@file.place_file.xml_dom).xml if @md.opt.cmd =~/M/ # test rexml parsing, comment out when not in use #debug
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
end
end
@@ -519,14 +519,14 @@ WOK
end
def xml
if @prog.tidy !=false
- if @md.cmd =~/[VM]/
- SiSU_Screen::Ansi.new(@md.cmd,'invert','Using XML Tidy','check document structure').colorize unless @md.cmd =~/q/
- tell=SiSU_Screen::Ansi.new(@md.cmd,'invert','','')
- tell.grey_open unless @md.cmd =~/q/
+ if @md.opt.cmd =~/[VM]/
+ SiSU_Screen::Ansi.new(@md.opt.cmd,'invert','Using XML Tidy','check document structure').colorize unless @md.opt.cmd =~/q/
+ tell=SiSU_Screen::Ansi.new(@md.opt.cmd,'invert','','')
+ tell.grey_open unless @md.opt.cmd =~/q/
tidyfile='/dev/null' #don't want one or screen output, check for alternative flags
tidy=SiSU_Env::System_call.new("#{@env.path.output}/#{@md.fnb}/#{@md.fn[:dom]}",tidyfile)
tidy.well_formed?
- tell.p_off unless @md.cmd =~/q/
+ tell.p_off unless @md.opt.cmd =~/q/
end
end
end
diff --git a/lib/sisu/v3/xml_fictionbook.rb b/lib/sisu/v3/xml_fictionbook.rb
index 09a9e5aa..277d4adc 100644
--- a/lib/sisu/v3/xml_fictionbook.rb
+++ b/lib/sisu/v3/xml_fictionbook.rb
@@ -181,7 +181,7 @@ WOK
end
def put(line)
@file_fictionbook.puts line
- puts line if @md.cmd =~/V/
+ puts line if @md.opt.cmd =~/V/
end
def structure_build_tag_close(lev,h)
@sp=' '
@@ -261,7 +261,7 @@ WOK
y="#{@sp*6}<#{@s[6]}>\n#{x[:para]}"
@h[0]=6
else
- y=if @md.cmd =~/V/; "#{x[:para]}"
+ y=if @md.opt.cmd =~/V/; "#{x[:para]}"
else nil
end
end
@@ -286,7 +286,7 @@ WOK
@ds[c][:para]=markup(para,'title')
else
@ds[c]={}
- @ds[c][:para]=markup(para) if @md.cmd =~/V/
+ @ds[c][:para]=markup(para) if @md.opt.cmd =~/V/
end
c+=1
end
diff --git a/lib/sisu/v3/xml_format.rb b/lib/sisu/v3/xml_format.rb
index dd41a094..a3539f60 100644
--- a/lib/sisu/v3/xml_format.rb
+++ b/lib/sisu/v3/xml_format.rb
@@ -342,7 +342,7 @@ WOK
end
def ocn_display
if @md.markup.inspect =~/no_ocn/ \
- or @md.mod.inspect =~/--no-ocn/ \
+ or @md.opt.mod.inspect =~/--no-ocn/ \
or @skin_no_ocn
ocn_class='ocn_off'
@ocn.gsub(/^(\d+|)$/,
@@ -1225,7 +1225,7 @@ WOK
else nil
end
else
- if @md.cmd =~/M/
+ if @md.opt.cmd =~/M/
p __FILE__ +':'+ __LINE__.to_s
p t_o.class
p caller
diff --git a/lib/sisu/v3/xml_scaffold.rb b/lib/sisu/v3/xml_scaffold.rb
index 1e423bea..fdd3e5b3 100644
--- a/lib/sisu/v3/xml_scaffold.rb
+++ b/lib/sisu/v3/xml_scaffold.rb
@@ -103,8 +103,8 @@ module SiSU_XML_scaffold
# 'sect2' # 'section'
#] #]
data=@data
- structure_outline(data) if @md.cmd =~/V/
- structure_simple(data) if @md.cmd =~/V/
+ structure_outline(data) if @md.opt.cmd =~/V/
+ structure_simple(data) if @md.opt.cmd =~/V/
structure_build(data)
end
def structure_outline(data)