aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/param.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v0/param.rb')
-rw-r--r--lib/sisu/v0/param.rb33
1 files changed, 24 insertions, 9 deletions
diff --git a/lib/sisu/v0/param.rb b/lib/sisu/v0/param.rb
index 90aad6aa..fec253d0 100644
--- a/lib/sisu/v0/param.rb
+++ b/lib/sisu/v0/param.rb
@@ -78,7 +78,7 @@ module SiSU_Param
@opt=opt
@cX||=SiSU_Screen::Ansi.new(opt.cmd)
@cmd,@mod=opt.cmd,opt.mod
- @fns=opt.fns.gsub(/\.ssm$/,'._sst') #revisit CHECK
+ @fns=opt.fns.gsub(/\.ssm$/,'.ssm.sst') #revisit CHECK
Instantiate.new.param_instantiate
@env=SiSU_Env::Info_env.new(@fns)
@pstorefile="#{@env.path.dal}/#@fns.pstore"
@@ -115,9 +115,9 @@ module SiSU_Param
@doc={ :lv=>[] }
@doc[:fns],@doc[:fnb],@doc[:scr_suffix]='','',''
@@publisher='SiSU scribe'
- attr_accessor :cmd,:mod,:env,:fn,:fns,:fnb,:fnn,:fnt,:fnl,:flv,:fnstex,:ocn,:sfx_src,:sfx,:pdf,:file_type,:dir_out,:dir_tex,:dir_lout,:txt_path,:site_skin,:sisu,:sisu_version,:ruby_version,:title,:dc_title,:html_title,:subtitle,:subtitle_tex,:creator_home,:dc_creator,:translator,:illustrator,:prepared_by,:digitized_by,:dc_subject,:dc_description,:dc_publisher,:dc_contributor,:dc_date,:dc_date_created,:dc_date_issued,:dc_date_available,:dc_date_valid,:dc_date_modified,:date_scheme,:date_created_scheme,:date_issued_scheme,:date_available_scheme,:date_valid_scheme,:date_modified_scheme,:dc_type,:dc_format,:dc_identifier,:dc_source,:dc_language,:language_original,:dc_relation,:dc_coverage,:dc_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_endnotes,:flag_auto_endnotes,:flag_separate_endnotes,:flag_separate_endnotes_make,:flag_auto_heading_num,:markup,:markup_instruction,:markup_version,:markup_declared,:make_bold,:make_italic,:flag_tables,:vocabulary,:doc_skin,:doc_css,:yaml,:lnk,: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,:file_size,:user,:home,:hostname,:pwd,:firstseg,:programs,:creator_copymark,:lang,:en,: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,:man_section,:man_name,:man_synopsis
+ attr_accessor :cmd,:mod,:env,:fn,:fns,:fnb,:fnn,:fnt,:fnl,:flv,:fnz,:fnstex,:ocn,:sfx_src,:sfx,:pdf,:file_type,:dir_out,:dir_tex,:dir_lout,:txt_path,:site_skin,:sisu,:sisu_version,:ruby_version,:title,:dc_title,:html_title,:subtitle,:subtitle_tex,:creator_home,:dc_creator,:translator,:illustrator,:prepared_by,:digitized_by,:dc_subject,:dc_description,:dc_publisher,:dc_contributor,:dc_date,:dc_date_created,:dc_date_issued,:dc_date_available,:dc_date_valid,:dc_date_modified,:date_scheme,:date_created_scheme,:date_issued_scheme,:date_available_scheme,:date_valid_scheme,:date_modified_scheme,:dc_type,:dc_format,:dc_identifier,:dc_source,:dc_language,:language_original,:dc_relation,:dc_coverage,:dc_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_endnotes,:flag_auto_endnotes,:flag_separate_endnotes,:flag_separate_endnotes_make,:flag_auto_heading_num,:markup,:markup_instruction,:markup_version,:markup_declared,:make_bold,:make_italic,:flag_tables,:vocabulary,:doc_skin,:doc_css,:yaml,:lnk,: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,:file_size,:user,:home,:hostname,:pwd,:firstseg,:programs,:creator_copymark,:lang,:en,: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,:man_section,:man_name,:man_synopsis,:ec
def initialize(fns_array,opt)
- @env=@fn=@fns=@fnb=@fnn=@fnt=@fnl=@flv=@fnstex=@ocn=@sfx_src=@sfx=@pdf=@file_type=@dir_out=@dir_tex=@dir_lout=@txt_path=@flag_endnotes=@flag_auto_endnotes=@flag_separate_endnotes=@flag_separate_endnotes_make=@site_skin=@sisu=@sisu_version=@ruby_version=@title=@dc_title=@html_title=@subtitle=@subtitle_tex=@creator_home=@dc_creator=@translator=@illustrator=@prepared_by=@digitized_by=@dc_subject=@dc_description=@dc_publisher=@dc_contributor=@dc_date=@dc_date_created=@dc_date_issued=@dc_date_available=@dc_date_valid=@dc_date_modified=@date_scheme=@date_created_scheme=@date_issued_scheme=@date_available_scheme=@date_valid_scheme=@date_modified_scheme=@dc_type=@dc_format=@dc_identifier=@dc_source=@dc_language=@language_original=@dc_relation=@dc_coverage=@dc_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_auto_heading_num=@make_bold=@make_italic=@flag_tables=@vocabulary=@doc_skin=@doc_css=@yaml=@lnk=@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=@file_size=@firstseg=@programs=@creator_copymark=@lang=@en=@dgst=@dgst_skin=@generated=@heading_seg_first=@base_program=@man_synopsis=nil
+ @env=@fn=@fns=@fnb=@fnn=@fnt=@fnl=@flv=@fnz=@fnstex=@ocn=@sfx_src=@sfx=@pdf=@file_type=@dir_out=@dir_tex=@dir_lout=@txt_path=@flag_endnotes=@flag_auto_endnotes=@flag_separate_endnotes=@flag_separate_endnotes_make=@site_skin=@sisu=@sisu_version=@ruby_version=@title=@dc_title=@html_title=@subtitle=@subtitle_tex=@creator_home=@dc_creator=@translator=@illustrator=@prepared_by=@digitized_by=@dc_subject=@dc_description=@dc_publisher=@dc_contributor=@dc_date=@dc_date_created=@dc_date_issued=@dc_date_available=@dc_date_valid=@dc_date_modified=@date_scheme=@date_created_scheme=@date_issued_scheme=@date_available_scheme=@date_valid_scheme=@date_modified_scheme=@dc_type=@dc_format=@dc_identifier=@dc_source=@dc_language=@language_original=@dc_relation=@dc_coverage=@dc_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_auto_heading_num=@make_bold=@make_italic=@flag_tables=@vocabulary=@doc_skin=@doc_css=@yaml=@lnk=@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=@file_size=@firstseg=@programs=@creator_copymark=@lang=@en=@dgst=@dgst_skin=@generated=@heading_seg_first=@base_program=@man_synopsis=nil
@man_section=1
@man_name='man page "name/whatis" information not provided, set in header @man: name=[whatis information]'
@data,@fns,@cmd,@mod,@opt=fns_array,opt.fns,opt.cmd,opt.mod,opt #@data used as data
@@ -125,8 +125,11 @@ module SiSU_Param
@seg_autoname_safe=true
@markup_instruction,@markup_declared,@image='','','' #check which other values should be set to empty rather than nil
@markup=@markup_instruction #use @markup_instruction
- @flv,@lang,@seg_names,@tags,@tag_array,@tag_a=Array.new(6){[]}
- @doc,@fn,@make_italic,@make_bold,@tag_hash={},{},{},{},{},{}
+ @doc,@fn,@make_italic,@make_bold,@tag_hash,@ec={},{},{},{},{},{},{}
+ @flv,@lang,@seg_names,@tags,@tag_array,@tag_a,@ec[:image],@ec[:audio],@ec[:multimedia]=Array.new(9){[]}
+ @rgx_image=/\{\s*(\S+?\.(?:png|jpg|gif))/
+ @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
ensure
@@ -169,19 +172,25 @@ module SiSU_Param
# programs set here for things that affect output appearance only
@programs[:pdf]=SiSU_Env::System_call.new.program_found?('pdflatex')
if @env.i18n.multilingual
- m=/((.+?)(?:\~\w{2,3})?)\.([_-]?sst)$/ #watch added match for sss
+ m=/((.+?)(?:\~\w{2,3})?)\.((?:-|ssm\.)?sst)$/ #watch added match for sss
@fnn,@fnb,@fnt=@fns[m,1],@fns[m,2],@fns[m,3]
@flv=@env.document_language_versions_found[:f]
- else m=/(.+?)\.([_-]?sst)$/
+ @fnz=if @fns =~/\.(?:ssm\.sst|ssm)$/; @fnn + '.ssm.zip'
+ else @fnn + '.sst.zip'
+ end
+ else m=/(.+?)\.((?:-|ssm\.)?sst)$/
@fnb=@fnn=@fns[m,1]
@fnt=@fns[m,2]
@flv<<@fns
+ @fnz=if @fns =~/\.(?:_sst|ssm)$/; @fnb + '.ssm.zip'
+ else @@fnb + '.sst.zip'
+ end
end
@papersize=@env.papersize #'A4' #default size #get first from SiSU_Env:: # @env is probably no longer most appropriate name! as default info is more general
@sfx_src=@fns[m,2]
@sfx=nil
@flag_auto_heading_num=false
- if @fns =~ /[_-]?sst$/ #watch
+ if @fns =~ /(?:-|ssm\.)?sst$/ #watch
@env_out_root=@env.path.output
@dir_out="#{@env.path.output}/#@fnb"
@dir_tex=@env.path.tex
@@ -209,7 +218,7 @@ module SiSU_Param
sv=if @cmd =~/[VMv]/; "SiSU version (#{@sisu_version[:version]})"
else ''
end
- s_a,s_b,s_c=@sisu_version[:version].match(/^([0-9]+)?(?:\.([0-9]+))?(?:\.([0-9]+))?$/)[1..3]
+ s_a,s_b,s_c=@sisu_version[:version].match(/^([0-9]+)?(?:\.([0-9]+))?(?:\.([0-9]+))?(?:\-\S+)?$/)[1..3]
tell=if @markup_version_declared.to_f == @markup_version.to_f
SiSU_Screen::Ansi.new(@cmd,"Markup version (#@markup_version)",sv)
else
@@ -591,7 +600,13 @@ module SiSU_Param
@seg_autoname_safe=false if m=~/^\d{1,3}/ and m !~/^0/
end
end
+ @ec[:image] << para.scan(@rgx_image).uniq if para =~@rgx_image #embedded content
+ @ec[:audio] << para.scan(@rgx_audio).uniq if para =~@rgx_audio #embedded content
+ @ec[:multimedia] << para.scan(@rgx_mm).uniq if para =~@rgx_mm #embedded content
end #% here endeth the document loop
+ @ec[:image].uniq!; @ec[:image].flatten!; @ec[:image].sort!
+ @ec[:audio].uniq!; @ec[:audio].flatten!; @ec[:audio].sort!
+ @ec[:multimedia].uniq!; @ec[:multimedia].flatten!; @ec[:multimedia].sort!
@man_name.gsub!(/(-)/,"\\\\\\1")
@man_name.gsub!(/\n/,"\n.BR\n")
@man_name.gsub!(/\A/,"\n.SH NAME\n")