From 2099cce12c2ffb53023c3c644b329b235e442ae0 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 3 Oct 2012 00:19:18 -0400 Subject: v4: skins, remove * remove skins * defaults, rename class Defaults (was InfoSkin) * sisupod, remove skin * db * no skin info to store, omitted from structure * change prefix name (structure changed) --- lib/sisu/v4/shared_sisupod_source.rb | 78 +----------------------------------- 1 file changed, 1 insertion(+), 77 deletions(-) (limited to 'lib/sisu/v4/shared_sisupod_source.rb') diff --git a/lib/sisu/v4/shared_sisupod_source.rb b/lib/sisu/v4/shared_sisupod_source.rb index 18821e37..eede4e15 100644 --- a/lib/sisu/v4/shared_sisupod_source.rb +++ b/lib/sisu/v4/shared_sisupod_source.rb @@ -82,7 +82,6 @@ module SiSU_Source po: path_pod + '/' + Gt[:po] + '/' + @opt.lng, pot: path_pod + '/' + Gt[:pot], conf: path_pod + '/' + Gt[:conf], - skin: path_pod + '/' + Gt[:skin], image: path_pod + '/' + Gt[:image], audio: path_pod + '/' + Gt[:audio], video: path_pod + '/' + Gt[:video], @@ -102,32 +101,6 @@ module SiSU_Source def directories SiSU_Env::InfoEnv.new.sisupod_v3(@opt) end - def select_skin(skin='') #skin loading logic here - load "#{SiSU_lib}/defaults.rb" - @skin={} - skin_path = [ - "#{@opt.base_path}/_sisu/skin", - "#{@env.path.home}/.sisu/skin", - '/etc/sisu/skin', - "#{@path_pod[:pod]}/external_document/skin" #CHECK - ] - sk_doc,sk_dir="#{Gt[:doc]}/#{skin}.rb","dir/skin_#{@env.stub_pwd}.rb" - skin_path.each do |v| #document skin priority 1 - if FileTest.file?("#{v}/#{sk_doc}") - @skin={ name_path: "#{v}/#{sk_doc}", type: :doc } - break - end - end - unless @skin.length > 0 - skin_path.each do |v| #directory skin priority 2 - if FileTest.file?("#{v}/#{sk_dir}") - @skin={ name_path: "#{v}/#{sk_dir}", type: :dir } - break - end - end - end - @skin - end def images_extract(f,images) # consider using param info rgx_image=/(?:^|[^_\\])\{(?:\s*|\~\^\s+)(\S+?\.(?:png|jpg|gif)\b)/m if f !~/^%+\s/ \ @@ -140,14 +113,12 @@ module SiSU_Source @pwd=Dir.pwd @rgx_rb_image=/["']\S*?([a-zA-Z0-9_-]+?\.(?:png|jpg|gif))["']/ @rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/ - @rgx_skin=/^\s+:skin:\s+(\S+)/ @rgx_doc_import=/^<<\s*(\S+?\.ss[ti])/ file_array=IO.readlines(@opt.fno,'') - skin,images,doc_import=[],[],[] + images,doc_import=[],[] doc_import_dir=@opt.sub_location file_array.each do |f| #% work area if f !~/^%+\s/ - skin << f.scan(@rgx_skin).uniq.flatten if f =~@rgx_skin f=f.gsub(/<:=(\S+?)>/,'{ c_\1.png 14x14 }image') # embedded symbol (image) if f !~/^%+\s/ \ and f =~@rgx_image @@ -170,41 +141,6 @@ module SiSU_Source end end end - docskin=nil - if skin \ - and skin.length > 0 - docskin=skin.pop.flatten.join - skin_source=select_skin(docskin) - else - skin_source=select_skin - end - docskin_place="#{@path_pod[:skin]}/#{skin_source[:type].to_s}" - FileUtils::mkdir_p(docskin_place) - if skin_source[:type] == :dir - docskin_with_path="#{docskin_place}/skin_#{@env.stub_pwd}.rb" - docskin=[docskin_with_path.gsub(/.+?\/(skin_\S+?)\.rb/,'\1')] - docskin='skin_sisupod' - end - if skin_source \ - and skin_source[:name_path] - unless skin_source[:name_path].nil? \ - or skin_source[:name_path].empty? - if FileTest.file?(skin_source[:name_path]) - FileUtils::cp(skin_source[:name_path],"#{docskin_place}/#{docskin}.rb") - skinfile_array=IO.readlines(skin_source[:name_path],'') - para_images=[] - skinfile_array.each do |f| #% work area - unless f =~/^%+ / #hmmm - images << f.scan(@rgx_rb_image).uniq if f =~@rgx_rb_image - #does not really discriminate, may duplicate images in sisu file, and may take images from default image pool - end - end - else STDERR.puts %{\t*WARN* did not find - "#{skin_source[:name_path]}" [#{__FILE__}:#{__LINE__}]} - end - end - end - #1. mapping in doc dir? - #2. need images used by skin, scan skin?? if images \ and images.length > 1 images=images.flatten.uniq @@ -317,8 +253,6 @@ question?: should you permit the packing of multiple documents open @opt.fns, parse file extract from file content: images and copy each image from whatever image source to _sisu/sisupod/sisu/_sisu/image - skin and copy active skin from whatever source to _sisu/sisupod/sisu/_sisu/skin/doc - extract from skin images required by skin remove previously existing contents of _/sisu/sisupod & make directory structure: @@ -332,8 +266,6 @@ v3 --> fr/content.sst _sisu conf - skin/ - doc [relevant skin if any other than default] image (ln -s ../../image) audio (ln -s ../../audio) video (ln -s ../../video) @@ -347,19 +279,11 @@ v2 --> content.sst [file content] filename.sst [link to content.sst] _sisu/ - skin/ - doc [relevant skin if any other than default] image/ [all images for specific document gathered here] sisu _sisu sisurc.yml - skin/ - dir/ - doc/ - misc/ - site/ - yaml/ convert/ standard_terms/ image -- cgit v1.2.3