diff options
Diffstat (limited to 'lib/sisu/v4/options.rb')
-rw-r--r-- | lib/sisu/v4/options.rb | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/lib/sisu/v4/options.rb b/lib/sisu/v4/options.rb index ddf9737b..b26bada2 100644 --- a/lib/sisu/v4/options.rb +++ b/lib/sisu/v4/options.rb @@ -62,15 +62,17 @@ module SiSU_Commandline require_relative 'param_make' # param_make.rb @@sisu_call_origin_path=nil class HeaderCommon + def initialize(make_instruct_array) + @make_instruct_array=make_instruct_array + end def sisu_document_make_instructions @pagenew=@pagebreak=@toc=@lv1=@lv2=@lv3=@lv4=@lv5=@lv6=@num_top=@i18n=@man_section=@emphasis_set_to=@bold_match_list=@italics_match_list=@substitution_match_list=@footer_links=@home_button_links=@links=nil @makeset=false - make_instruct_array=SiSU_Env::GetInit.new.sisu_document_make.makefile - if make_instruct_array - make_instruct_array.each do |para| #% scan document + if @make_instruct_array + @make_instruct_array.each do |para| #% scan document if para =~/^(?:@make:|@links:)[+-]?\s/ case para - when /^@make:(.+)/m #% * header processing - make + when /^@make:(.+)/m #% header processing - make @env=SiSU_Env::InfoEnv.new @make=SiSU_Param_Make::MdMake.new($1.strip,@opt,@env).make makes=SiSU_Param_Make::MakeHead.new(@make).make_instruct @@ -129,7 +131,7 @@ module SiSU_Commandline end end class Options - attr_accessor :cmd,:mod,:act,:dir_structure_by,:f_pths,:files,:files_mod,:base_path,:base_stub,:sub_location,:paths,:lngs,:f_pth,:pth,:fno,:fns,:fnb,:fnc,:fng,:fncb,:lng,:lng_base,:what,:make_instructions + attr_accessor :cmd,:mod,:act,:dir_structure_by,:f_pths,:files,:files_mod,:base_path,:base_stub,:sub_location,:paths,:lngs,:f_pth,:pth,:fno,:fns,:fnb,:fnc,:fng,:fncb,:lng,:lng_base,:what,:make_instructions,:make_instructions_pod @@act=nil def initialize(a) @cmd,@f_pth,@pth,@fno,@fns,@fnb,@fnc,@fng,@fncb,@what,@lng,@lng_base,@base_path,@base_stub,@sub_location='','','','','','','','','','','','','','' @@ -144,7 +146,9 @@ module SiSU_Commandline @base_stub=@base_path.gsub(u,'\1') @a=sisu_glob_rules(a) @a.freeze - @make_instructions=HeaderCommon.new.sisu_document_make_instructions + make_instruct_array=SiSU_Env::GetInit.new.sisu_document_make.makefile_read + @make_instructions=HeaderCommon.new(make_instruct_array).sisu_document_make_instructions + @make_instructions_pod=nil init end def find_all(find_flag,opt) @@ -265,6 +269,22 @@ module SiSU_Commandline @files self end + def sisu_document_make_pod + def makefile_name + SiSU_Env::GetInit.new.sisu_document_make.makefile_name + end + def makefile(pod_make_path) + "#{pod_make_path}/#{makefile_name}" + end + def makefile_read(pod_make_path) + f=if FileTest.file?(makefile(pod_make_path)) + sisu_doc_makefile=IO.read(makefile(pod_make_path), mode: 'r:utf-8') + sisu_doc_makefile.split(/\s*\n\s*\n/m) + else nil + end + end + self + end def set_files_and_paths_and_general_extract(s) c,w='','' m,f,pth,z,lng,lngs=[],[],[],[],[],[] @@ -289,6 +309,10 @@ module SiSU_Commandline fullname=@env.processing_path.processing + '/sisupod/' + fn_pod pt=Pathname.new(fullname) FileUtils::mkdir_p(pt.to_s) + pod_make_path=fullname + '/sisupod/doc/_sisu' + pod_make_path_file=pod_make_path + make_instruct_array=sisu_document_make_pod.makefile_read(pod_make_path) + @make_instructions_pod=HeaderCommon.new(make_instruct_array).sisu_document_make_instructions Dir.chdir(pt.realpath) options=s.gsub(/(\s+--?\S+)+.+/,'\1') system(" |