diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v2/constants.rb | 12 | ||||
-rw-r--r-- | lib/sisu/v2/dal_syntax.rb | 8 | ||||
-rw-r--r-- | lib/sisu/v2/db_columns.rb | 26 | ||||
-rw-r--r-- | lib/sisu/v2/db_create.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v2/db_load_tuple.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v2/defaults.rb | 6 | ||||
-rw-r--r-- | lib/sisu/v2/git.rb | 166 | ||||
-rw-r--r-- | lib/sisu/v2/hub.rb | 8 | ||||
-rw-r--r-- | lib/sisu/v2/i18n.rb | 21 | ||||
-rw-r--r-- | lib/sisu/v2/manifest.rb | 10 | ||||
-rw-r--r-- | lib/sisu/v2/param.rb | 21 | ||||
-rw-r--r-- | lib/sisu/v2/plaintext.rb | 1 | ||||
-rw-r--r-- | lib/sisu/v2/shared_metadata.rb | 10 | ||||
-rw-r--r-- | lib/sisu/v2/sisupod_make.rb | 8 | ||||
-rw-r--r-- | lib/sisu/v2/sysenv.rb | 24 |
15 files changed, 299 insertions, 26 deletions
diff --git a/lib/sisu/v2/constants.rb b/lib/sisu/v2/constants.rb index 9a24736c..83914038 100644 --- a/lib/sisu/v2/constants.rb +++ b/lib/sisu/v2/constants.rb @@ -58,7 +58,7 @@ =end Sfx={:txt=>'.txt',:html=>'.html',:xhtml=>'.xhtml',:xml=>'.xml',:epub=>'.epub',:epub_xhtml=>'.xhtml',:odt=>'.odt',:pdf=>'.pdf'} -Ax,Xx,Mx,Rx,Hx,Dx,Px,Db,Tex={},{},{},{},{},{},{},{},{} +Ax,Xx,Mx,Rx,Hx,Dx,Px,Db,Gt,Tex=Array.new(10){{}} Ax[:tab]="\t" Xx[:protect]='☞' Xx[:segment]='Ф' @@ -131,8 +131,8 @@ Px[:lv4]= '-' Px[:lv5]= '.' Px[:lv6]= '.' #Px[:lv5_6]= '.' -Db[:name_prefix]="SiSU#{SiSU_version_dir}b_" -Db[:name_prefix_db]="sisu_#{SiSU_version_dir}b_" +Db[:name_prefix]="SiSU#{SiSU_version_dir}c_" +Db[:name_prefix_db]="sisu_#{SiSU_version_dir}c_" Db[:col_title]=800 Db[:col_title_part]=400 Db[:col_title_edition]=10 @@ -150,7 +150,11 @@ Db[:col_classify_small]=16 Db[:col_filename]=256 Db[:col_digest]=64 Db[:col_filesize]=10 -Db[:col_info_note]=3000 +Db[:col_info_note]=2500 +Gt[:grotto]='sisu:' +Gt[:txt]='txt' +Gt[:image]='images' +Gt[:conf]='conf' __END__ consider: 〔comment〕 diff --git a/lib/sisu/v2/dal_syntax.rb b/lib/sisu/v2/dal_syntax.rb index 4a13b069..b7b9ec4b 100644 --- a/lib/sisu/v2/dal_syntax.rb +++ b/lib/sisu/v2/dal_syntax.rb @@ -215,8 +215,8 @@ module SiSU_Syntax def bodymarkup(dob) # << http://www.jus.uio.no/sisu/sisu_markup_table/markup >> # See: data/sisu/sample/document_samples_sisu_markup/ - # !{emphasis}! e{emphasis}e <strong>emphasis</strong> - # *{bold text}* b{bold}b <b>bold text</b> + # *{emphasis}* e{emphasis}e <strong>emphasis</strong> + # !{bold text}! b{bold}b <b>bold text</b> # _{underline}_ u{underline}u <u>underline</u> # /{italics}/ i{italics}i <i>italics</i> # "{citation}" c{citation}c <cite>citation</cite> #blockquote? @@ -411,8 +411,8 @@ module SiSU_Syntax dob end def tech #script markup planned to be more strict for technical documents - # !{emphasis}! e{emphasis}e <strong>emphasis</strong> - # *{bold text}* b{bold}b <b>bold text</b> + # *{emphasis}* e{emphasis}e <strong>emphasis</strong> + # !{bold text}! b{bold}b <b>bold text</b> # _{underline}_ u{underline}u <u>underline</u> # /{italics}/ i{italics}i <i>italics</i> # "{citation}" c{citation}c <cite>citation</cite> diff --git a/lib/sisu/v2/db_columns.rb b/lib/sisu/v2/db_columns.rb index 0c2eb367..ba861f4d 100644 --- a/lib/sisu/v2/db_columns.rb +++ b/lib/sisu/v2/db_columns.rb @@ -1425,7 +1425,7 @@ module SiSU_DB_columns end def column_comment %{COMMENT ON COLUMN metadata_and_text.#{name} - IS 'metadata classify document library of congress (if available)';} + IS 'metadata classify document Library of Congress';} end def tuple t=if defined? @md.classify.loc \ @@ -1447,7 +1447,7 @@ module SiSU_DB_columns end def column_comment %{COMMENT ON COLUMN metadata_and_text.#{name} - IS 'metadata classify document dewey (if available)';} + IS 'metadata classify document Dewey';} end def tuple t=if defined? @md.classify.dewey \ @@ -1460,6 +1460,28 @@ module SiSU_DB_columns end self end + def classify_oclc + def name + 'classify_oclc' + end + def create_column + "#{name} VARCHAR(#{Db[:col_classify_library]}) NULL," + end + def column_comment + %{COMMENT ON COLUMN metadata_and_text.#{name} + IS 'metadata classify document Online Computer Library Center number';} + end + def tuple + t=if defined? @md.classify.oclc \ + and @md.classify.oclc=~/\S+/ + txt=@md.classify.oclc + special_character_escape(txt) + ["#{name}, ","'#{txt}', "] + else ['',''] + end + end + self + end def classify_pg def name 'classify_pg' diff --git a/lib/sisu/v2/db_create.rb b/lib/sisu/v2/db_create.rb index c7ce9a6d..f6c2e50f 100644 --- a/lib/sisu/v2/db_create.rb +++ b/lib/sisu/v2/db_create.rb @@ -166,6 +166,7 @@ module SiSU_DB_create #{column.classify_type.create_column} #{column.classify_loc.create_column} #{column.classify_dewey.create_column} + #{column.classify_oclc.create_column} #{column.classify_pg.create_column} #{column.classify_isbn.create_column} #{column.classify_format.create_column} @@ -418,6 +419,7 @@ module SiSU_DB_create %{#{column.classify_type.column_comment}}, %{#{column.classify_loc.column_comment}}, %{#{column.classify_dewey.column_comment}}, + %{#{column.classify_oclc.column_comment}}, %{#{column.classify_pg.column_comment}}, %{#{column.classify_isbn.column_comment}}, %{#{column.classify_format.column_comment}}, diff --git a/lib/sisu/v2/db_load_tuple.rb b/lib/sisu/v2/db_load_tuple.rb index 67c8008f..f1af99a0 100644 --- a/lib/sisu/v2/db_load_tuple.rb +++ b/lib/sisu/v2/db_load_tuple.rb @@ -176,6 +176,7 @@ module SiSU_DB_tuple #{@tp.column.classify_type.tuple[0]} #{@tp.column.classify_loc.tuple[0]} #{@tp.column.classify_dewey.tuple[0]} +#{@tp.column.classify_oclc.tuple[0]} #{@tp.column.classify_pg.tuple[0]} #{@tp.column.classify_isbn.tuple[0]} #{@tp.column.classify_format.tuple[0]} @@ -259,6 +260,7 @@ tid) #{@tp.column.classify_type.tuple[1]} #{@tp.column.classify_loc.tuple[1]} #{@tp.column.classify_dewey.tuple[1]} +#{@tp.column.classify_oclc.tuple[1]} #{@tp.column.classify_pg.tuple[1]} #{@tp.column.classify_isbn.tuple[1]} #{@tp.column.classify_format.tuple[1]} diff --git a/lib/sisu/v2/defaults.rb b/lib/sisu/v2/defaults.rb index a654aed7..aa1c8e49 100644 --- a/lib/sisu/v2/defaults.rb +++ b/lib/sisu/v2/defaults.rb @@ -1775,7 +1775,7 @@ outputs include: plaintext, html, XHTML, XML, ODF (OpenDocument), EPUB, LaTeX, P --- </p> <p class="small"> - <a href="http://www.jus.uio.no/sisu/SiSU/examples.html#summary" target="_top" > + <a href="http://www.jus.uio.no/sisu/SiSU/1.html#summary" target="_top" > What does SiSU do? Summary </a> </p> @@ -1783,7 +1783,7 @@ outputs include: plaintext, html, XHTML, XML, ODF (OpenDocument), EPUB, LaTeX, P --- </p> <p class="small"> - <a href="http://www.jus.uio.no/sisu/SiSU/2.html" target="_top" > + <a href="http://www.jus.uio.no/sisu/SiSU/examples.html" target="_top" > Book Samples and Markup Examples </a> </p> @@ -2072,7 +2072,7 @@ More information on <a href="http://www.jus.uio.no/sisu/SiSU/"><b>SiSU</b></a> p <input type="text" name="s1" size="24" maxlength="255" /> <br /> <input type="submit" name="ignore" value="search" /> -<input type="hidden" name="db" value="SiSUv2_sisu" /> +<input type="hidden" name="db" value="#{Db[:name_prefix]}sisu" /> <input type="hidden" name="a" value="1" /> <input type="radio" name="view" value="index" checked="checked" /> idx <input type="radio" name="view" value="text" /> txt diff --git a/lib/sisu/v2/git.rb b/lib/sisu/v2/git.rb index 0a318d83..2d7629fd 100644 --- a/lib/sisu/v2/git.rb +++ b/lib/sisu/v2/git.rb @@ -56,7 +56,167 @@ ** Description: system environment, resource control and configuration details =end - - #___# - +module SiSU_Git + require "#{SiSU_lib}/param" # param.rb + require "#{SiSU_lib}/sysenv" # sysenv.rb + require "#{SiSU_lib}/dal" # dal.rb + class Source + include FileUtils #::Verbose + def initialize(opt) + @opt=opt + @env=SiSU_Env::Info_env.new + @git_path={} + @git_path[:fnb]=@env.path.processing_path_git + '/' + @opt.fnb + @git_path[:src]=@git_path[:fnb] + '/' + Gt[:txt] + @git_path[:image]=@git_path[:fnb] + '/' + Gt[:image] + @git_path[:conf]=@git_path[:fnb] + '/' + Gt[:conf] + @md=SiSU_Param::Parameters.new(@opt).get + SiSU_DAL::Source.new(@opt).read # -m + end + def read + make_dir_fnb + if program_found? + git_init + end + populate.sisusrc_files + if program_found? + git_commit + end + end + def program_found? + found=`whereis git` + (found =~/bin\/git\b/) ? true : false + end + def make_dir_fnb + mkdir_p(@git_path[:fnb]) unless FileTest.directory?(@git_path[:fnb]) + mkdir_p(@git_path[:src]) unless FileTest.directory?(@git_path[:src]) + mkdir_p(@git_path[:conf]) unless FileTest.directory?(@git_path[:conf]) + mkdir_p("#{@git_path[:conf]}/skin") unless FileTest.directory?("#{@git_path[:conf]}/skin") + mkdir_p(@git_path[:image]) unless FileTest.directory?(@git_path[:image]) + end + def git_init + unless FileTest.directory?("#{@git_path[:fnb]}/.git") + system("cd #{@git_path[:fnb]}\ + && git init + ") + end + end + def git_commit + system("cd #{@git_path[:fnb]} \ + && git add . \ + && git commit -a + ") + end + def populate + def identify_language_versions + print __FILE__ + ':' + p __LINE__ + end + def copy_src_head + if @opt.fns =~/\.ssm\.sst/ + ssm=@opt.fns.gsub(/\.ssm\.sst/,'.ssm') + cp_r("#{@env.path.pwd}/#{ssm}",@git_path[:src]) + else + cp_r("#{@env.path.pwd}/#{@opt.fns}",@git_path[:src]) + end + end + def copy_related_sst_ssi + doc_import=[] + @rgx_doc_import=/^<<\s(\S+?\.ss[ti])/ + file_array=IO.readlines(@opt.fns,'') + file_array.each do |f| + if f =~@rgx_doc_import + doc_import = doc_import + f.scan(@rgx_doc_import).uniq.flatten + end + end + doc_import.each do |f| + cp_r("#{@env.path.pwd}/#{f}",@git_path[:src]) + end + end + def locate_parse_file + composite_src=@opt.fns=~/\.ssm$/ ? true : false + parse_file=if composite_src \ + and @opt.cmd.inspect !~/m/ + ##SiSU_Assemble::Composite.new(@opt).read + #SiSU_DAL::Source.new(@opt).read # -m + "#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst" + elsif composite_src + "#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst" + else "#{@env.path.pwd}/#{@opt.fns}" + end + end + def locate_skin + SiSU_Env::Info_skin.new(@md).select + end + def read_composite + #print __FILE__ + ':' + #p __LINE__ + end + def extract_skin + #print __FILE__ + ':' + #p __LINE__ + end + def extract_skin_and_images #(parse_file) + parse_file_name=locate_parse_file + parse_file=IO.readlines(parse_file_name,'') + rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/ + #rgx_rb_image=/["'](\S+?\.(?:png|jpg|gif))["']/ + #rgx_rb_image=/[^\/]?([a-z]\S+?\.(?:png|jpg|gif))/ + rgx_rb_image=/([a-z][^ \/]+?\.(?:png|jpg|gif))/ + rgx_skin=/^\s+:skin:\s+(\S+)/ + skin_get=nil + images=[] + skin_get + parse_file.each do |f| #% work area + if f !~/^%+\s/ + skin_get ||= f.scan(rgx_skin).uniq.flatten if f =~rgx_skin + if f =~rgx_image + images << f.scan(rgx_image).uniq + end + end + end + skin=skin_get[0] if skin_get + skin=locate_skin + parse_skin=IO.readlines(skin,"\n") + parse_skin.each do |f| #% work area + if f !~/^#/ \ + and f =~rgx_rb_image + images << f.scan(rgx_rb_image).uniq + end + end + image_path="#{@env.path.pwd}/_sisu/image" + images.flatten.each do |i| + if FileTest.file?("#{image_path}/#{i}") + cp_r("#{image_path}/#{i}",@git_path[:image]) + end + end + if FileTest.file?(skin) + cp_r(skin,"#{@git_path[:conf]}/skin") + end + {:skin =>skin, :images =>images} + end + def read_src + print __FILE__ + ':' + p __LINE__ + end + def composite_src? + @opt.fns=~/\.ssm$/ ? true : false + end + def sisusrc_files + populate.copy_src_head + if composite_src? + populate.copy_related_sst_ssi + end + populate.extract_skin + #parse_file_name=locate_parse_file + #parse_file=IO.readlines(parse_file_name,'') + populate.extract_skin_and_images #(parse_file) + #populate.extract_composite_source + #populate.read_composite # or read_each_composite + populate.identify_language_versions + end + self + end + end +end __END__ diff --git a/lib/sisu/v2/hub.rb b/lib/sisu/v2/hub.rb index 08a120fa..58f62d0f 100644 --- a/lib/sisu/v2/hub.rb +++ b/lib/sisu/v2/hub.rb @@ -124,6 +124,7 @@ module SiSU @opt.fns=fns.gsub(/\.ssm$/,'.ssm.sst') end SiSU_DAL::Source.new(@opt).read # -m + when /^git$/; SiSU_Git::Source.new(@opt).read # -g when /^concordance$/; SiSU_Concordance::Source.new(@opt).read # -w when /^share_src$/; SiSU_Markup::Source.new(@opt).read # -s when /^sisupod_make$/; SiSU_Doc::Source.new(@opt).read # -S @@ -283,7 +284,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ if @opt.mod.inspect =~/--convert|--to|--from/ require "#{SiSU_lib}/sst_convert_markup" # sst_convert_markup.rb end - if @opt.cmd =~/([AabCcDdeFfGHhIiJjLMmNnOopQqrRSsTtUuVvwWXxYyZ_0-9])/ \ + if @opt.cmd =~/([AabCcDdeFfgGHhIiJjLMmNnOopQqrRSsTtUuVvwWXxYyZ_0-9])/ \ and @opt.cmd =~/^-/ \ and @opt.mod.inspect !~/--(?:sitemaps|query|identify)/ \ or @opt.mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/ #and @@ -292,7 +293,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ flag=SiSU_Env::Info_processing_flag.new extra='' if @opt.cmd !~/[mn]/ - extra+=if @opt.cmd =~/[abeghHhIiJjNOoptTwXxz]/ \ + extra+=if @opt.cmd =~/[abehHhIiJjNOoptTwXxz]/ \ and @opt.cmd !~/[mn]/ 'm' #% add dal elsif ((@opt.cmd =~/[Dd]/ \ @@ -372,6 +373,9 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ if @opt.cmd =~/s/ #% -s sisu source op('share_src','SiSU markup source') end + if @opt.cmd =~/g/ #% -g sisu git + op('git','SiSU Git') + end if @opt.cmd =~/m/ #% -m is remote url requested? (download if) @retry_count= -1 begin diff --git a/lib/sisu/v2/i18n.rb b/lib/sisu/v2/i18n.rb index e65e3717..2aa730be 100644 --- a/lib/sisu/v2/i18n.rb +++ b/lib/sisu/v2/i18n.rb @@ -213,6 +213,9 @@ module SiSU_Translate def cls_dewey @lang_class.cls_dewey end + def cls_oclc + @lang_class.cls_oclc + end def cls_gutenberg @lang_class.cls_gutenberg end @@ -428,6 +431,9 @@ module SiSU_Translate def cls_dewey 'Classify Dewey' end + def cls_oclc + 'Classify OCLC number' + end def cls_gutenberg 'Classify Project Gutenberg' end @@ -639,6 +645,9 @@ module SiSU_Translate def cls_dewey 'Classification Dewey' end + def cls_oclc # fix + 'Classify OCLC number' + end def cls_gutenberg 'Classification du project Gutenberg' end @@ -847,6 +856,9 @@ module SiSU_Translate def cls_dewey 'Klassifikation nach Dewey' end + def cls_oclc # fix + 'Classify OCLC number' + end def cls_gutenberg 'Klassifikation nach Projekt Gutenberg' end @@ -1055,6 +1067,9 @@ module SiSU_Translate def cls_dewey 'Clasificación Dewey' end + def cls_oclc # fix + 'Classify OCLC number' + end def cls_gutenberg 'Clasificación Proyecto Gutenberg' end @@ -1263,6 +1278,9 @@ module SiSU_Translate def cls_dewey 'Classificazione Dewey' end + def cls_oclc # fix + 'Classify OCLC number' + end def cls_gutenberg 'Classificazione del Progetto Gutenberg' end @@ -1471,6 +1489,9 @@ module SiSU_Translate def cls_dewey 'Classify Dewey' end + def cls_oclc # fix + 'Classify OCLC number' + end def cls_gutenberg 'Classify Project Gutenberg' end diff --git a/lib/sisu/v2/manifest.rb b/lib/sisu/v2/manifest.rb index c1da4ccb..85881263 100644 --- a/lib/sisu/v2/manifest.rb +++ b/lib/sisu/v2/manifest.rb @@ -485,6 +485,13 @@ module SiSU_Manifest id,info=@translate.cls_dewey,@md.classify.dewey metadata(id,info) end + if defined? @md.classify.oclc \ + and @md.classify.oclc=~/\S+/ + id,info=@translate.cls_oclc,@md.classify.oclc + @manifest[:html] << %{<tr><th class="left"><p class="bold_left">#{id}:</p></th><td>\n} + @manifest[:html] << %{<p class="left"><a href="http://worldcat.org/oclc/#{info}">#{info}</a></p>\n} + @manifest[:html] << %{</td></tr>\n} + end if defined? @md.classify.pg \ and @md.classify.pg=~/\S+/ id,info=@translate.cls_gutenberg,@md.classify.pg @@ -505,7 +512,8 @@ module SiSU_Manifest id,info=@translate.prefix_b,@md.notes.prefix_b metadata(id,info) end - if @md.topic_register_array.length > 1 + if defined? @md.topic_register_array \ + and @md.topic_register_array.length > 0 @manifest[:html] << %{<tr><th class="left"><p class="bold_left">#{@translate.topic_register}:</p></th><td>\n} @md.topic_register_array.each do |t| t.each_with_index do |st,i| diff --git a/lib/sisu/v2/param.rb b/lib/sisu/v2/param.rb index 87dd9aab..bf32fc59 100644 --- a/lib/sisu/v2/param.rb +++ b/lib/sisu/v2/param.rb @@ -514,6 +514,11 @@ module SiSU_Param l,n=Db[:col_classify_library],'classify.dewey' validate_length(s,l,n) end + def oclc + s=@h['oclc'] + l,n=Db[:col_classify_library],'classify.oclc' + validate_length(s,l,n) + end def pg s=@h['pg'] l,n=Db[:col_classify_small],'classify.pg' @@ -927,7 +932,7 @@ module SiSU_Param l=determine_papersize(l.dup) @papersize=l end - when /^@make:(.+)/m #% metainfo DC + when /^@make:(.+)/m #% metainfo DC @make=Md.new($1.strip,@opt).make if defined? @make.breaks \ and @make.breaks[:page_new] #clearpage @@ -1097,6 +1102,20 @@ module SiSU_Param @rights=Md_default.new.rights("[#{@creator.author}]",'') end end + if defined? @classify.topic_register \ + and @classify.topic_register.length >3 + topic_register=@classify.topic_register + u=topic_register.scan(/[^;]+/) + v=[] + u.each do |l| + v << l.scan(/[^:]+/) + end + v.each do |m| + m[-1]=m[-1].scan(/[^|]+/) if m[-1] =~/[|]/ + @topic_register_array << m + end + @topic_register_array.sort! + end if @markup_version.to_f >= 0.38 #convert values in headers to internal representation translated=[] translate_list=[@pagenew,@pagebreak,@num_top,@toc_lev_limit] diff --git a/lib/sisu/v2/plaintext.rb b/lib/sisu/v2/plaintext.rb index ddc82839..851da3f8 100644 --- a/lib/sisu/v2/plaintext.rb +++ b/lib/sisu/v2/plaintext.rb @@ -310,6 +310,7 @@ WOK dob.obj.gsub!(/#{Mx[:gl_o]}#169#{Mx[:gl_c]}/,'©') end if dob.of=='group' # watch + dob.obj.gsub!(/#{Mx[:gl_o]}●#{Mx[:gl_c]}/,"* ") dob.obj.gsub!(/#{Mx[:br_line]}|#{Mx[:br_nl]}/,"\n") else dob.obj.gsub!(/#{Mx[:br_line]}|#{Mx[:br_nl]}/,"\n\n") end diff --git a/lib/sisu/v2/shared_metadata.rb b/lib/sisu/v2/shared_metadata.rb index 07f87e2c..bd1fe73a 100644 --- a/lib/sisu/v2/shared_metadata.rb +++ b/lib/sisu/v2/shared_metadata.rb @@ -633,6 +633,11 @@ WOK tag,inf=tr.date,@md.date.published meta << meta_para(tag,inf) end + if defined? @md.classify.topic_register \ + and @md.classify.topic_register=~/\S+/ + tag,inf=tr.topic_register,@md.classify.topic_register + meta << meta_para(tag,inf) + end if defined? @md.classify.loc \ and @md.classify.loc=~/\S+/ tag,inf=tr.cls_loc,@md.classify.loc @@ -643,6 +648,11 @@ WOK tag,inf=tr.cls_dewey,@md.classify.dewey meta << meta_para(tag,inf) end + if defined? @md.classify.oclc \ + and @md.classify.oclc=~/\S+/ + tag,inf=tr.cls_oclc,@md.classify.oclc + meta << meta_para(tag,inf) + end if defined? @md.classify.pg \ and @md.classify.pg=~/\S+/ tag,inf=tr.cls_gutenberg,@md.classify.pg diff --git a/lib/sisu/v2/sisupod_make.rb b/lib/sisu/v2/sisupod_make.rb index 50d55a38..0b4b56d8 100644 --- a/lib/sisu/v2/sisupod_make.rb +++ b/lib/sisu/v2/sisupod_make.rb @@ -161,11 +161,11 @@ module SiSU_Doc def sisupod_build #see also sisupod in sysenv @rgx_rb_image=/["'](\S+?\.(?:png|jpg|gif))["']/ @rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/ - @rgx_skin=/^@skin:\s+(\S+)/ + @rgx_skin=/^\s+:skin:\s+(\S+)/ @rgx_doc_import=/^%\s\s*\|(\S+?\.ss[ti])\|@\|\^\|>>ok/ - use_file=if @opt.fns =~/(?:\.ssm|\.ssm\.sst)$/; "#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst" - else @opt.fns - end + use_file=@opt.fns =~/(?:\.ssm|\.ssm\.sst)$/ \ + ? "#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst" \ + : @opt.fns file_array=IO.readlines(use_file,'') skin,images,doc_import=[],[],[] file_array.each do |f| #% work area diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb index c857468f..ed0fe136 100644 --- a/lib/sisu/v2/sysenv.rb +++ b/lib/sisu/v2/sysenv.rb @@ -115,6 +115,7 @@ module SiSU_Env end processing_path=tmp_processing_individual processing_dir=prcss_dir + processing_git="#{Dir.pwd}/#{Gt[:grotto]}" user=ENV['USER'] port_pgsql=if defined? ENV['PGPORT'] \ and not (ENV['PGPORT'].nil? \ @@ -149,6 +150,7 @@ module SiSU_Env PROCESSING_SQLITE=:processing_sqlite PROCESSING_POSTGRESQL=:processing_postgresql PROCESSING_ENCODING=:processing_encoding + PROCESSING_GIT=:processing_git PAPERSIZE=:papersize LANGUAGE=:language LANGUAGE_CODE=:language_code @@ -191,6 +193,7 @@ module SiSU_Env PROCESSING_SQLITE => 'sqlite', PROCESSING_POSTGRESQL=> 'postgresql', PROCESSING_ENCODING => 'encoding', + PROCESSING_GIT => processing_git, #TEXINFO_STUB => 'texinfo', PAPERSIZE => 'A4', #A4, US_letter, book_b5, book_a5, US_legal LANGUAGE => 'English', @@ -526,7 +529,7 @@ module SiSU_Env end def program_found?(program) found=`whereis #{program}` - state=(found =~/bin\/#{program}\b/) ? true : false + (found =~/bin\/#{program}\b/) ? true : false end def locale #locales utf8 or other unless @@locale_flag @@ -817,7 +820,7 @@ module SiSU_Env class Info_env < Env_call require 'fileutils' include FileUtils - attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:stub_pwd,:stub_src,:webserv_host_cgi,:webserv_port_cgi,:processing,:etc,:yamlrc_dir + attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:stub_pwd,:stub_src,:webserv_host_cgi,:webserv_port_cgi,:processing,:processing_git,:etc,:yamlrc_dir @@image_flag,@@local_image=true,true #warning on @@image_flag @@fb=@@man_path=nil,nil def initialize(fns='',md=nil) @@ -1449,6 +1452,23 @@ WOK end processing end + def processing_path_git + proposed_dir=if defined? @rc['git']['dir'] \ + and not @rc['git']['dir'].nil? \ + and not @rc['git']['dir'].empty? + x=(@rc['git']['dir'] =~/^(?:~|home)$/) \ + ? home + '/' + 'sisu:' \ + : @rc['git']['dir'] + '/' + 'sisu:' + else defaults[:processing_git] + end + end + def processing_git + unless FileTest.directory?(processing_path_git) + mkdir_p(processing_path_git) + File.chmod(0700,processing_path_git) + end + processing_path_git + end def epub "#{processing}/epub/#{@fnb}" end |