From 498407053df453e9a72cdf8c7d3992455abd89b5 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 22 May 2007 05:03:33 +0100 Subject: sisu-0.52.7 + md5s --- CHANGELOG | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2c1bf32b..55e747a1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,9 +8,9 @@ Reverse Chronological: %% sisu_0.52.7.orig.tar.gz (2007-05-17::20/4) http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.7.orig.tar.gz - sisu_0.52.7.orig.tar.gz - sisu_0.52.7-1.dsc - sisu_0.52.7-1.diff.gz + a9513dea06487a4e588f160f3d2491e8 1283842 sisu_0.52.7.orig.tar.gz + 5e0cfa4abf66318161819331d6b0f5af 606 sisu_0.52.7-1.dsc + 0e5c9ddcf696aae9026d8b881a3dc7d7 148706 sisu_0.52.7-1.diff.gz * texpdf, related to special characters -- cgit v1.2.3 From c94f591946a0436767f2fa0637f1cfd2c22ff3d6 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 May 2007 23:36:19 +0100 Subject: restrict use to ruby1.8, plus some minor housekeeping changes file exist? instead of exists? --- bin/sisu | 2 +- bin/sisu_termsheet | 2 +- bin/sisu_webrick | 2 +- lib/sisu/0.52/dal.rb | 6 +++--- lib/sisu/0.52/hub.rb | 2 +- lib/sisu/0.52/sst_convert_markup.rb | 4 ++-- lib/sisu/0.52/sysenv.rb | 24 ++++++++++++------------ lib/sisu/0.52/texpdf.rb | 2 +- lib/sisu/0.52/texpdf_format.rb | 2 +- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/bin/sisu b/bin/sisu index 45873483..843ed721 100644 --- a/bin/sisu +++ b/bin/sisu @@ -1,6 +1,6 @@ #!/usr/bin/env ruby #SiSU: copyright (C) 1997..2007 Ralph Amissah; License GPL, see appended program information -raise "Please, use Ruby 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' +raise "Please, use Ruby1.8, 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9.0' $VERBOSE=nil $KCODE='u' Version='0.52' diff --git a/bin/sisu_termsheet b/bin/sisu_termsheet index 0ac11b6f..b998018e 100644 --- a/bin/sisu_termsheet +++ b/bin/sisu_termsheet @@ -1,6 +1,6 @@ #!/usr/bin/env ruby #SiSU: copyright (C) 1997..2007 Ralph Amissah; License GPL, see appended program information -raise "Please, use Ruby 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' +raise "Please, use Ruby1.8, 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9.0' $VERBOSE=nil Version='0.52' SiSU_lib='sisu/' + Version diff --git a/bin/sisu_webrick b/bin/sisu_webrick index b6d64e59..bd4e31a7 100644 --- a/bin/sisu_webrick +++ b/bin/sisu_webrick @@ -1,6 +1,6 @@ #!/usr/bin/env ruby #SiSU: copyright (C) 1997..2007 Ralph Amissah; License GPL, see appended program information -raise "Please, use Ruby 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' +raise "Please, use Ruby1.8, 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9.0' $VERBOSE=nil Version='0.52' SiSU_lib='sisu/' + Version diff --git a/lib/sisu/0.52/dal.rb b/lib/sisu/0.52/dal.rb index 43a4f015..130dbf87 100644 --- a/lib/sisu/0.52/dal.rb +++ b/lib/sisu/0.52/dal.rb @@ -278,9 +278,9 @@ module SiSU_DAL path_image=[dir.path.image_source_local_tex,dir.path.image_source_remote_tex,dir.path.image_source_tex] image_path=nil path_image.each do |image_path| - break if FileTest.exists?("#{image_path}/#{image}") + break if FileTest.exist?("#{image_path}/#{image}") end - if FileTest.exists?("#{image_path}/#{image}") + if FileTest.exist?("#{image_path}/#{image}") img=Magick::ImageList.new("#{image_path}/#{image}") img_col,img_row=img.columns,img.rows if img_col > img_row #landscape @@ -997,7 +997,7 @@ module SiSU_DAL else '' end para_plus_en << para_tail - para_plus_en.each {|e_p| en_and_para_digest << SiSU_DAL::Make.new(@md,e_p).endnote_digest } + en_and_para_digest << SiSU_DAL::Make.new(@md,para_plus_en).endnote_digest para_new=en_and_para_digest.join(' ') @tuned << para_new + '<' + digest_strip + ':' + digest_all + '>' unless para.nil? else @tuned << para + '<' + digest_strip + ':' + digest_all + '>' unless para.nil? diff --git a/lib/sisu/0.52/hub.rb b/lib/sisu/0.52/hub.rb index 939b70a5..1f2df5f6 100644 --- a/lib/sisu/0.52/hub.rb +++ b/lib/sisu/0.52/hub.rb @@ -540,7 +540,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ if @opt.fns =~/\._sst$/ and @opt.cmd !~/[S_M]/ # rework necessry, revist, the _ flag is a hack, to keep ._sst files @msg,@msgs='temporary file removed',nil @tell.call.warn unless @opt.cmd =~/V/ - File.unlink(@opt.fns) if File.exists?(@opt.fns) #CONSIDER + File.unlink(@opt.fns) if File.exist?(@opt.fns) #CONSIDER end else #Operations.new(fns,'html').not_found end diff --git a/lib/sisu/0.52/sst_convert_markup.rb b/lib/sisu/0.52/sst_convert_markup.rb index d1c337cf..bf1c10c8 100644 --- a/lib/sisu/0.52/sst_convert_markup.rb +++ b/lib/sisu/0.52/sst_convert_markup.rb @@ -232,9 +232,9 @@ WOK if y =~m and y =~w if @new @new=false - File.unlink(o) if File.exists?(o) + File.unlink(o) if File.exist?(o) File.rename(i,o) - File.unlink(i) if File.exists?(i) + File.unlink(i) if File.exist?(i) @file=File.new(i,'w') @matched=true break diff --git a/lib/sisu/0.52/sysenv.rb b/lib/sisu/0.52/sysenv.rb index 9bd2e977..56171c06 100644 --- a/lib/sisu/0.52/sysenv.rb +++ b/lib/sisu/0.52/sysenv.rb @@ -205,7 +205,7 @@ module SiSU_Env def prog load_prog=false $:.each do |reqpath| - if FileTest.exists?("#{reqpath}/#@prog.rb") + if FileTest.exist?("#{reqpath}/#@prog.rb") load_prog=true break end @@ -224,7 +224,7 @@ module SiSU_Env def prog? load_prog=false $:.each do |reqpath| - if FileTest.exists?("#{reqpath}/#@prog.rb"); load_prog=true + if FileTest.exist?("#{reqpath}/#@prog.rb"); load_prog=true break end end @@ -249,12 +249,12 @@ module SiSU_Env def yamlrc unless @@rc @yamlrc_path.each do |v| - if @@noyaml or FileTest.exists?("#{v}/noyaml") + if @@noyaml or FileTest.exist?("#{v}/noyaml") puts "WARNING - YAML loading switched off, to enable delete the file:\n\t#{v}/noyaml\n\n" unless @@noyaml @@noyaml=true break else - if FileTest.exists?("#{v}/sisurc.yml") + if FileTest.exist?("#{v}/sisurc.yml") unless @@rc require 'yaml' @@rc ||= YAML::load(File::open("#{v}/sisurc.yml")) @@ -262,7 +262,7 @@ module SiSU_Env break end unless @@rc - if FileTest.exists?("#{v}/sisurc.yaml") + if FileTest.exist?("#{v}/sisurc.yaml") unless @@rc require 'yaml' @@rc ||= YAML::load(File::open("#{v}/sisurc.yaml")) @@ -278,13 +278,13 @@ module SiSU_Env def ads #WORK AREA tell_no_yaml='WARNING - YAML loading switched off, to enable delete the file:' @ad_path.each do |v| - if @@noyaml or FileTest.exists?("#{v}/noyaml") + if @@noyaml or FileTest.exist?("#{v}/noyaml") puts tell_no_yaml + "\n\t#{v}/noyaml\n" unless @@noyaml @@noyaml=true break else #tell=SiSU_Screen::Ansi.new('','promo off (file not found): list.yml') - if FileTest.exists?("#{v}/list.yml") + if FileTest.exist?("#{v}/list.yml") unless @@ad[:promo_list] require 'yaml' @@ad[:promo_list] ||= YAML::load(File::open("#{v}/list.yml")) @@ -297,13 +297,13 @@ module SiSU_Env end end @ad_path.each do |v| - if @@noyaml or FileTest.exists?("#{v}/noyaml") + if @@noyaml or FileTest.exist?("#{v}/noyaml") puts tell_no_yaml + "\n\t#{v}/noyaml\n" unless @@noyaml @@noyaml=true break else #tell=SiSU_Screen::Ansi.new('','promo off (file not found): promo.yml') - if FileTest.exists?("#{v}/promo.yml") + if FileTest.exist?("#{v}/promo.yml") unless @@ad[:promo] require 'yaml' @@ad[:promo] ||= YAML::load(File::open("#{v}/promo.yml")) @@ -752,7 +752,7 @@ module SiSU_Env @sys.locale end def concord_max - concord_max=if defined? @rc['processing']['concord_max'] and @rc['processing']['concord_max']: + concord_max=if defined? @rc['processing']['concord_max'] and @rc['processing']['concord_max'] @rc['processing']['concord_max'] else defaults[:concord_max] end @@ -1051,14 +1051,14 @@ module SiSU_Env end def yamlrc rc.each do |v| - if FileTest.exists?("#{v}/sisurc.yml") + if FileTest.exist?("#{v}/sisurc.yml") @yamlrc_dir="#{v}/sisurc.yml" break end end unless @yamlrc_dir rc.each do |v| - if FileTest.exists?("#{v}/sisurc.yaml") + if FileTest.exist?("#{v}/sisurc.yaml") @yamlrc_dir="#{v}/sisurc.yaml" break end diff --git a/lib/sisu/0.52/texpdf.rb b/lib/sisu/0.52/texpdf.rb index 27c4f3bf..c4df0611 100644 --- a/lib/sisu/0.52/texpdf.rb +++ b/lib/sisu/0.52/texpdf.rb @@ -204,7 +204,7 @@ module SiSU_TeX @dir_sisu=@dirout.path.output texfile=@md.fns.gsub(/$/,'.tex') texfile=texfile.gsub(/~/,'-') - if File.exists?(texfile) and File.size(texfile) > 0 + if File.exist?(texfile) and File.size(texfile) > 0 @tex_f_no+=1 latex_do(texfile) else diff --git a/lib/sisu/0.52/texpdf_format.rb b/lib/sisu/0.52/texpdf_format.rb index db18ce61..50945af4 100644 --- a/lib/sisu/0.52/texpdf_format.rb +++ b/lib/sisu/0.52/texpdf_format.rb @@ -381,7 +381,7 @@ WOK @row_break='\\\\\\\\' @break_page="#@row_break\n#@row_break \n" if @string[//] - no_of_cols, cols_width=$1,$2 + no_of_cols,cols_width=$1,$2 @w=cols_width.split(/;\s*/) @colW=[] @w.each do |x| -- cgit v1.2.3 From d1221f437d771a80fdf9179a639e064a7d8b2935 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 24 May 2007 12:47:39 +0100 Subject: restrict use to ruby1.8 branch, i.e. < 1.9 --- bin/sisu | 2 +- bin/sisu_termsheet | 2 +- bin/sisu_webrick | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/sisu b/bin/sisu index 843ed721..1d9ad7f1 100644 --- a/bin/sisu +++ b/bin/sisu @@ -1,6 +1,6 @@ #!/usr/bin/env ruby #SiSU: copyright (C) 1997..2007 Ralph Amissah; License GPL, see appended program information -raise "Please, use Ruby1.8, 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9.0' +raise "Please, use Ruby1.8, 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9' $VERBOSE=nil $KCODE='u' Version='0.52' diff --git a/bin/sisu_termsheet b/bin/sisu_termsheet index b998018e..aef20bb1 100644 --- a/bin/sisu_termsheet +++ b/bin/sisu_termsheet @@ -1,6 +1,6 @@ #!/usr/bin/env ruby #SiSU: copyright (C) 1997..2007 Ralph Amissah; License GPL, see appended program information -raise "Please, use Ruby1.8, 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9.0' +raise "Please, use Ruby1.8, 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9' $VERBOSE=nil Version='0.52' SiSU_lib='sisu/' + Version diff --git a/bin/sisu_webrick b/bin/sisu_webrick index bd4e31a7..4ef1b598 100644 --- a/bin/sisu_webrick +++ b/bin/sisu_webrick @@ -1,6 +1,6 @@ #!/usr/bin/env ruby #SiSU: copyright (C) 1997..2007 Ralph Amissah; License GPL, see appended program information -raise "Please, use Ruby1.8, 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9.0' +raise "Please, use Ruby1.8, 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9' $VERBOSE=nil Version='0.52' SiSU_lib='sisu/' + Version -- cgit v1.2.3 From 26767cc88c0548ad7978021796d0ccc4c9f7ffed Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 2 Jun 2007 11:27:06 +0100 Subject: 0.53.0, pre-build, see changelog, library naming changed for scm, placed under v0 (instead of 0.53) --- CHANGELOG | 807 +++++----- bin/sisu | 8 +- bin/sisu_termsheet | 8 +- bin/sisu_webrick | 8 +- lib/sisu/0.52/cgi.rb | 76 - lib/sisu/0.52/cgi_pgsql.rb | 214 --- lib/sisu/0.52/cgi_sql_common.rb | 809 ---------- lib/sisu/0.52/cgi_sqlite.rb | 207 --- lib/sisu/0.52/character_encoding.rb | 369 ----- lib/sisu/0.52/composite.rb | 215 --- lib/sisu/0.52/concordance.rb | 311 ---- lib/sisu/0.52/conf.rb | 245 --- lib/sisu/0.52/css.rb | 1939 ----------------------- lib/sisu/0.52/dal.rb | 1089 ------------- lib/sisu/0.52/dal_doc_str.rb | 220 --- lib/sisu/0.52/dal_doc_str_code.rb | 153 -- lib/sisu/0.52/dal_doc_str_tables.rb | 180 --- lib/sisu/0.52/dal_syntax.rb | 330 ---- lib/sisu/0.52/db_columns.rb | 209 --- lib/sisu/0.52/db_create.rb | 530 ------- lib/sisu/0.52/db_drop.rb | 124 -- lib/sisu/0.52/db_import.rb | 735 --------- lib/sisu/0.52/db_indexes.rb | 95 -- lib/sisu/0.52/db_load_tuple.rb | 94 -- lib/sisu/0.52/db_remove.rb | 86 - lib/sisu/0.52/db_select.rb | 158 -- lib/sisu/0.52/db_tests.rb | 104 -- lib/sisu/0.52/dbi.rb | 119 -- lib/sisu/0.52/defaults.rb | 2045 ------------------------ lib/sisu/0.52/digests.rb | 364 ----- lib/sisu/0.52/docbook.rb | 561 ------- lib/sisu/0.52/errors.rb | 72 - lib/sisu/0.52/help.rb | 1906 ---------------------- lib/sisu/0.52/html.rb | 719 --------- lib/sisu/0.52/html_format.rb | 1056 ------------- lib/sisu/0.52/html_format_css.rb | 473 ------ lib/sisu/0.52/html_promo.rb | 382 ----- lib/sisu/0.52/html_scroll.rb | 231 --- lib/sisu/0.52/html_segments.rb | 471 ------ lib/sisu/0.52/html_table.rb | 141 -- lib/sisu/0.52/html_tune.rb | 376 ----- lib/sisu/0.52/hub.rb | 573 ------- lib/sisu/0.52/i18n.rb | 1528 ------------------ lib/sisu/0.52/manifest.rb | 528 ------- lib/sisu/0.52/odf.rb | 725 --------- lib/sisu/0.52/odf_format.rb | 225 --- lib/sisu/0.52/options.rb | 168 -- lib/sisu/0.52/param.rb | 791 ---------- lib/sisu/0.52/param_identify_markup.rb | 87 -- lib/sisu/0.52/plaintext.rb | 473 ------ lib/sisu/0.52/plaintext_format.rb | 100 -- lib/sisu/0.52/relaxng.rb | 1155 -------------- lib/sisu/0.52/remote_put.rb | 103 -- lib/sisu/0.52/response.rb | 61 - lib/sisu/0.52/rexml.rb | 118 -- lib/sisu/0.52/screen_text_color.rb | 404 ----- lib/sisu/0.52/semantics.rb | 388 ----- lib/sisu/0.52/share_src.rb | 88 -- lib/sisu/0.52/share_src_kdissert.rb | 82 - lib/sisu/0.52/shared_db.rb | 78 - lib/sisu/0.52/shared_html.rb | 55 - lib/sisu/0.52/shared_html_lite.rb | 180 --- lib/sisu/0.52/shared_txt.rb | 299 ---- lib/sisu/0.52/shared_xml.rb | 580 ------- lib/sisu/0.52/sisupod_make.rb | 316 ---- lib/sisu/0.52/sitemaps.rb | 213 --- lib/sisu/0.52/spell.rb | 91 -- lib/sisu/0.52/sst_convert_markup.rb | 298 ---- lib/sisu/0.52/sst_do_inline_footnotes.rb | 461 ------ lib/sisu/0.52/sst_from_kdissert.rb | 176 --- lib/sisu/0.52/sst_from_xml.rb | 148 -- lib/sisu/0.52/sst_identify_markup.rb | 322 ---- lib/sisu/0.52/sst_to_s_xml_dom.rb | 563 ------- lib/sisu/0.52/sst_to_s_xml_node.rb | 636 -------- lib/sisu/0.52/sst_to_s_xml_sax.rb | 434 ------ lib/sisu/0.52/sysenv.rb | 2517 ------------------------------ lib/sisu/0.52/termsheet.rb | 158 -- lib/sisu/0.52/texinfo.rb | 408 ----- lib/sisu/0.52/texinfo_format.rb | 507 ------ lib/sisu/0.52/texpdf.rb | 611 -------- lib/sisu/0.52/texpdf_format.rb | 1222 --------------- lib/sisu/0.52/update.rb | 123 -- lib/sisu/0.52/urls.rb | 229 --- lib/sisu/0.52/vocab.rb | 113 -- lib/sisu/0.52/vocab_lex.rb | 144 -- lib/sisu/0.52/webrick.rb | 163 -- lib/sisu/0.52/wikispeak.rb | 391 ----- lib/sisu/0.52/xhtml.rb | 483 ------ lib/sisu/0.52/xml.rb | 505 ------ lib/sisu/0.52/xml_dom.rb | 537 ------- lib/sisu/0.52/xml_format.rb | 339 ---- lib/sisu/0.52/xml_tables.rb | 202 --- lib/sisu/0.52/zap.rb | 73 - lib/sisu/v0/cgi.rb | 76 + lib/sisu/v0/cgi_pgsql.rb | 214 +++ lib/sisu/v0/cgi_sql_common.rb | 809 ++++++++++ lib/sisu/v0/cgi_sqlite.rb | 207 +++ lib/sisu/v0/character_encoding.rb | 369 +++++ lib/sisu/v0/composite.rb | 215 +++ lib/sisu/v0/concordance.rb | 296 ++++ lib/sisu/v0/conf.rb | 245 +++ lib/sisu/v0/css.rb | 1939 +++++++++++++++++++++++ lib/sisu/v0/dal.rb | 1066 +++++++++++++ lib/sisu/v0/dal_doc_str.rb | 220 +++ lib/sisu/v0/dal_doc_str_code.rb | 153 ++ lib/sisu/v0/dal_doc_str_tables.rb | 180 +++ lib/sisu/v0/dal_syntax.rb | 330 ++++ lib/sisu/v0/db_columns.rb | 209 +++ lib/sisu/v0/db_create.rb | 530 +++++++ lib/sisu/v0/db_drop.rb | 124 ++ lib/sisu/v0/db_import.rb | 735 +++++++++ lib/sisu/v0/db_indexes.rb | 95 ++ lib/sisu/v0/db_load_tuple.rb | 94 ++ lib/sisu/v0/db_remove.rb | 86 + lib/sisu/v0/db_select.rb | 158 ++ lib/sisu/v0/db_tests.rb | 104 ++ lib/sisu/v0/dbi.rb | 119 ++ lib/sisu/v0/defaults.rb | 2045 ++++++++++++++++++++++++ lib/sisu/v0/digests.rb | 364 +++++ lib/sisu/v0/docbook.rb | 561 +++++++ lib/sisu/v0/errors.rb | 72 + lib/sisu/v0/help.rb | 1906 ++++++++++++++++++++++ lib/sisu/v0/html.rb | 700 +++++++++ lib/sisu/v0/html_format.rb | 1053 +++++++++++++ lib/sisu/v0/html_format_css.rb | 473 ++++++ lib/sisu/v0/html_promo.rb | 382 +++++ lib/sisu/v0/html_scroll.rb | 232 +++ lib/sisu/v0/html_segments.rb | 464 ++++++ lib/sisu/v0/html_table.rb | 141 ++ lib/sisu/v0/html_tune.rb | 376 +++++ lib/sisu/v0/hub.rb | 573 +++++++ lib/sisu/v0/i18n.rb | 1528 ++++++++++++++++++ lib/sisu/v0/manifest.rb | 528 +++++++ lib/sisu/v0/odf.rb | 719 +++++++++ lib/sisu/v0/odf_format.rb | 225 +++ lib/sisu/v0/options.rb | 168 ++ lib/sisu/v0/param.rb | 788 ++++++++++ lib/sisu/v0/param_identify_markup.rb | 87 ++ lib/sisu/v0/plaintext.rb | 460 ++++++ lib/sisu/v0/plaintext_format.rb | 100 ++ lib/sisu/v0/relaxng.rb | 1155 ++++++++++++++ lib/sisu/v0/remote_put.rb | 103 ++ lib/sisu/v0/response.rb | 61 + lib/sisu/v0/rexml.rb | 118 ++ lib/sisu/v0/screen_text_color.rb | 404 +++++ lib/sisu/v0/semantics.rb | 388 +++++ lib/sisu/v0/share_src.rb | 88 ++ lib/sisu/v0/share_src_kdissert.rb | 82 + lib/sisu/v0/shared_db.rb | 78 + lib/sisu/v0/shared_html.rb | 55 + lib/sisu/v0/shared_html_lite.rb | 180 +++ lib/sisu/v0/shared_txt.rb | 299 ++++ lib/sisu/v0/shared_xml.rb | 580 +++++++ lib/sisu/v0/sisupod_make.rb | 316 ++++ lib/sisu/v0/sitemaps.rb | 213 +++ lib/sisu/v0/spell.rb | 91 ++ lib/sisu/v0/sst_convert_markup.rb | 298 ++++ lib/sisu/v0/sst_do_inline_footnotes.rb | 461 ++++++ lib/sisu/v0/sst_from_kdissert.rb | 176 +++ lib/sisu/v0/sst_from_xml.rb | 148 ++ lib/sisu/v0/sst_identify_markup.rb | 322 ++++ lib/sisu/v0/sst_to_s_xml_dom.rb | 563 +++++++ lib/sisu/v0/sst_to_s_xml_node.rb | 636 ++++++++ lib/sisu/v0/sst_to_s_xml_sax.rb | 434 ++++++ lib/sisu/v0/sysenv.rb | 2517 ++++++++++++++++++++++++++++++ lib/sisu/v0/termsheet.rb | 158 ++ lib/sisu/v0/texinfo.rb | 408 +++++ lib/sisu/v0/texinfo_format.rb | 507 ++++++ lib/sisu/v0/texpdf.rb | 597 +++++++ lib/sisu/v0/texpdf_format.rb | 1211 ++++++++++++++ lib/sisu/v0/update.rb | 123 ++ lib/sisu/v0/urls.rb | 229 +++ lib/sisu/v0/webrick.rb | 163 ++ lib/sisu/v0/wikispeak.rb | 391 +++++ lib/sisu/v0/xhtml.rb | 475 ++++++ lib/sisu/v0/xml.rb | 494 ++++++ lib/sisu/v0/xml_dom.rb | 533 +++++++ lib/sisu/v0/xml_format.rb | 339 ++++ lib/sisu/v0/xml_tables.rb | 202 +++ lib/sisu/v0/zap.rb | 73 + 180 files changed, 38613 insertions(+), 38985 deletions(-) delete mode 100644 lib/sisu/0.52/cgi.rb delete mode 100644 lib/sisu/0.52/cgi_pgsql.rb delete mode 100644 lib/sisu/0.52/cgi_sql_common.rb delete mode 100644 lib/sisu/0.52/cgi_sqlite.rb delete mode 100644 lib/sisu/0.52/character_encoding.rb delete mode 100644 lib/sisu/0.52/composite.rb delete mode 100644 lib/sisu/0.52/concordance.rb delete mode 100644 lib/sisu/0.52/conf.rb delete mode 100644 lib/sisu/0.52/css.rb delete mode 100644 lib/sisu/0.52/dal.rb delete mode 100644 lib/sisu/0.52/dal_doc_str.rb delete mode 100644 lib/sisu/0.52/dal_doc_str_code.rb delete mode 100644 lib/sisu/0.52/dal_doc_str_tables.rb delete mode 100644 lib/sisu/0.52/dal_syntax.rb delete mode 100644 lib/sisu/0.52/db_columns.rb delete mode 100644 lib/sisu/0.52/db_create.rb delete mode 100644 lib/sisu/0.52/db_drop.rb delete mode 100644 lib/sisu/0.52/db_import.rb delete mode 100644 lib/sisu/0.52/db_indexes.rb delete mode 100644 lib/sisu/0.52/db_load_tuple.rb delete mode 100644 lib/sisu/0.52/db_remove.rb delete mode 100644 lib/sisu/0.52/db_select.rb delete mode 100644 lib/sisu/0.52/db_tests.rb delete mode 100644 lib/sisu/0.52/dbi.rb delete mode 100644 lib/sisu/0.52/defaults.rb delete mode 100644 lib/sisu/0.52/digests.rb delete mode 100644 lib/sisu/0.52/docbook.rb delete mode 100644 lib/sisu/0.52/errors.rb delete mode 100644 lib/sisu/0.52/help.rb delete mode 100644 lib/sisu/0.52/html.rb delete mode 100644 lib/sisu/0.52/html_format.rb delete mode 100644 lib/sisu/0.52/html_format_css.rb delete mode 100644 lib/sisu/0.52/html_promo.rb delete mode 100644 lib/sisu/0.52/html_scroll.rb delete mode 100644 lib/sisu/0.52/html_segments.rb delete mode 100644 lib/sisu/0.52/html_table.rb delete mode 100644 lib/sisu/0.52/html_tune.rb delete mode 100644 lib/sisu/0.52/hub.rb delete mode 100644 lib/sisu/0.52/i18n.rb delete mode 100644 lib/sisu/0.52/manifest.rb delete mode 100644 lib/sisu/0.52/odf.rb delete mode 100644 lib/sisu/0.52/odf_format.rb delete mode 100644 lib/sisu/0.52/options.rb delete mode 100644 lib/sisu/0.52/param.rb delete mode 100644 lib/sisu/0.52/param_identify_markup.rb delete mode 100644 lib/sisu/0.52/plaintext.rb delete mode 100644 lib/sisu/0.52/plaintext_format.rb delete mode 100644 lib/sisu/0.52/relaxng.rb delete mode 100644 lib/sisu/0.52/remote_put.rb delete mode 100644 lib/sisu/0.52/response.rb delete mode 100644 lib/sisu/0.52/rexml.rb delete mode 100644 lib/sisu/0.52/screen_text_color.rb delete mode 100644 lib/sisu/0.52/semantics.rb delete mode 100644 lib/sisu/0.52/share_src.rb delete mode 100644 lib/sisu/0.52/share_src_kdissert.rb delete mode 100644 lib/sisu/0.52/shared_db.rb delete mode 100644 lib/sisu/0.52/shared_html.rb delete mode 100644 lib/sisu/0.52/shared_html_lite.rb delete mode 100644 lib/sisu/0.52/shared_txt.rb delete mode 100644 lib/sisu/0.52/shared_xml.rb delete mode 100644 lib/sisu/0.52/sisupod_make.rb delete mode 100644 lib/sisu/0.52/sitemaps.rb delete mode 100644 lib/sisu/0.52/spell.rb delete mode 100644 lib/sisu/0.52/sst_convert_markup.rb delete mode 100644 lib/sisu/0.52/sst_do_inline_footnotes.rb delete mode 100644 lib/sisu/0.52/sst_from_kdissert.rb delete mode 100644 lib/sisu/0.52/sst_from_xml.rb delete mode 100644 lib/sisu/0.52/sst_identify_markup.rb delete mode 100644 lib/sisu/0.52/sst_to_s_xml_dom.rb delete mode 100644 lib/sisu/0.52/sst_to_s_xml_node.rb delete mode 100644 lib/sisu/0.52/sst_to_s_xml_sax.rb delete mode 100644 lib/sisu/0.52/sysenv.rb delete mode 100644 lib/sisu/0.52/termsheet.rb delete mode 100644 lib/sisu/0.52/texinfo.rb delete mode 100644 lib/sisu/0.52/texinfo_format.rb delete mode 100644 lib/sisu/0.52/texpdf.rb delete mode 100644 lib/sisu/0.52/texpdf_format.rb delete mode 100644 lib/sisu/0.52/update.rb delete mode 100644 lib/sisu/0.52/urls.rb delete mode 100644 lib/sisu/0.52/vocab.rb delete mode 100644 lib/sisu/0.52/vocab_lex.rb delete mode 100644 lib/sisu/0.52/webrick.rb delete mode 100644 lib/sisu/0.52/wikispeak.rb delete mode 100644 lib/sisu/0.52/xhtml.rb delete mode 100644 lib/sisu/0.52/xml.rb delete mode 100644 lib/sisu/0.52/xml_dom.rb delete mode 100644 lib/sisu/0.52/xml_format.rb delete mode 100644 lib/sisu/0.52/xml_tables.rb delete mode 100644 lib/sisu/0.52/zap.rb create mode 100644 lib/sisu/v0/cgi.rb create mode 100644 lib/sisu/v0/cgi_pgsql.rb create mode 100644 lib/sisu/v0/cgi_sql_common.rb create mode 100644 lib/sisu/v0/cgi_sqlite.rb create mode 100644 lib/sisu/v0/character_encoding.rb create mode 100644 lib/sisu/v0/composite.rb create mode 100644 lib/sisu/v0/concordance.rb create mode 100644 lib/sisu/v0/conf.rb create mode 100644 lib/sisu/v0/css.rb create mode 100644 lib/sisu/v0/dal.rb create mode 100644 lib/sisu/v0/dal_doc_str.rb create mode 100644 lib/sisu/v0/dal_doc_str_code.rb create mode 100644 lib/sisu/v0/dal_doc_str_tables.rb create mode 100644 lib/sisu/v0/dal_syntax.rb create mode 100644 lib/sisu/v0/db_columns.rb create mode 100644 lib/sisu/v0/db_create.rb create mode 100644 lib/sisu/v0/db_drop.rb create mode 100644 lib/sisu/v0/db_import.rb create mode 100644 lib/sisu/v0/db_indexes.rb create mode 100644 lib/sisu/v0/db_load_tuple.rb create mode 100644 lib/sisu/v0/db_remove.rb create mode 100644 lib/sisu/v0/db_select.rb create mode 100644 lib/sisu/v0/db_tests.rb create mode 100644 lib/sisu/v0/dbi.rb create mode 100644 lib/sisu/v0/defaults.rb create mode 100644 lib/sisu/v0/digests.rb create mode 100644 lib/sisu/v0/docbook.rb create mode 100644 lib/sisu/v0/errors.rb create mode 100644 lib/sisu/v0/help.rb create mode 100644 lib/sisu/v0/html.rb create mode 100644 lib/sisu/v0/html_format.rb create mode 100644 lib/sisu/v0/html_format_css.rb create mode 100644 lib/sisu/v0/html_promo.rb create mode 100644 lib/sisu/v0/html_scroll.rb create mode 100644 lib/sisu/v0/html_segments.rb create mode 100644 lib/sisu/v0/html_table.rb create mode 100644 lib/sisu/v0/html_tune.rb create mode 100644 lib/sisu/v0/hub.rb create mode 100644 lib/sisu/v0/i18n.rb create mode 100644 lib/sisu/v0/manifest.rb create mode 100644 lib/sisu/v0/odf.rb create mode 100644 lib/sisu/v0/odf_format.rb create mode 100644 lib/sisu/v0/options.rb create mode 100644 lib/sisu/v0/param.rb create mode 100644 lib/sisu/v0/param_identify_markup.rb create mode 100644 lib/sisu/v0/plaintext.rb create mode 100644 lib/sisu/v0/plaintext_format.rb create mode 100644 lib/sisu/v0/relaxng.rb create mode 100644 lib/sisu/v0/remote_put.rb create mode 100644 lib/sisu/v0/response.rb create mode 100644 lib/sisu/v0/rexml.rb create mode 100644 lib/sisu/v0/screen_text_color.rb create mode 100644 lib/sisu/v0/semantics.rb create mode 100644 lib/sisu/v0/share_src.rb create mode 100644 lib/sisu/v0/share_src_kdissert.rb create mode 100644 lib/sisu/v0/shared_db.rb create mode 100644 lib/sisu/v0/shared_html.rb create mode 100644 lib/sisu/v0/shared_html_lite.rb create mode 100644 lib/sisu/v0/shared_txt.rb create mode 100644 lib/sisu/v0/shared_xml.rb create mode 100644 lib/sisu/v0/sisupod_make.rb create mode 100644 lib/sisu/v0/sitemaps.rb create mode 100644 lib/sisu/v0/spell.rb create mode 100644 lib/sisu/v0/sst_convert_markup.rb create mode 100644 lib/sisu/v0/sst_do_inline_footnotes.rb create mode 100644 lib/sisu/v0/sst_from_kdissert.rb create mode 100644 lib/sisu/v0/sst_from_xml.rb create mode 100644 lib/sisu/v0/sst_identify_markup.rb create mode 100644 lib/sisu/v0/sst_to_s_xml_dom.rb create mode 100644 lib/sisu/v0/sst_to_s_xml_node.rb create mode 100644 lib/sisu/v0/sst_to_s_xml_sax.rb create mode 100644 lib/sisu/v0/sysenv.rb create mode 100644 lib/sisu/v0/termsheet.rb create mode 100644 lib/sisu/v0/texinfo.rb create mode 100644 lib/sisu/v0/texinfo_format.rb create mode 100644 lib/sisu/v0/texpdf.rb create mode 100644 lib/sisu/v0/texpdf_format.rb create mode 100644 lib/sisu/v0/update.rb create mode 100644 lib/sisu/v0/urls.rb create mode 100644 lib/sisu/v0/webrick.rb create mode 100644 lib/sisu/v0/wikispeak.rb create mode 100644 lib/sisu/v0/xhtml.rb create mode 100644 lib/sisu/v0/xml.rb create mode 100644 lib/sisu/v0/xml_dom.rb create mode 100644 lib/sisu/v0/xml_format.rb create mode 100644 lib/sisu/v0/xml_tables.rb create mode 100644 lib/sisu/v0/zap.rb diff --git a/CHANGELOG b/CHANGELOG index 55e747a1..81193a07 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,27 @@ Reverse Chronological: %% STABLE MANIFEST +%% sisu_0.53.0.orig.tar.gz (2007-06-02::22/6) +http://www.jus.uio.no/sisu/pkg/src/sisu_0.53.0.orig.tar.gz + sisu_0.53.0.orig.tar.gz + sisu_0.53.0-1.dsc + sisu_0.53.0-1.diff.gz + + * housekeeping, internal program adjustments (i.e. unrelated to output) + * lib, moved lib base to v0 branch (major version preceded by a v), [from + major.minor version (this version would otherwise be 0.53)], primarily to + simplify reading of scm history (with fewer lib directory changes) + * issues with strings and arrays (flatten and compact some arrays) + * changed require from Constant + '/path' back to "#{Constant}/path" + * various little things + * cleanup, including cleaning of end of line (hanging white) spaces + + * Note: dcc, several hash values change. + + * moved to git for scm including git-buildpackage + (from a combination of mercurial and dars + darcs-buildpackage, [don't ask, + it served me quite well though]) + %% sisu_0.52.7.orig.tar.gz (2007-05-17::20/4) http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.7.orig.tar.gz a9513dea06487a4e588f160f3d2491e8 1283842 sisu_0.52.7.orig.tar.gz @@ -20,7 +41,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.6.orig.tar.gz f466b68b3093e2c95fed13e4ebf0d495 606 sisu_0.52.6-1.dsc aafb3b715fe2566f88c2def746d73099 148689 sisu_0.52.6-1.diff.gz - * texpdf, a url representation fix, escape of special characters + * texpdf, a url representation fix, escape of special characters %% sisu_0.52.5.orig.tar.gz (2007-05-10::19/4) http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.5.orig.tar.gz @@ -39,7 +60,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.5.orig.tar.gz setting PGPORT (e.g. "export PGPORT=5432") or setting the port in sisurc.yml (check what the correct value should be [on my system the default was set to 5433 for 8.2, "ls -la /var/run/postgresql/" may help]) - + %% sisu_0.52.4.orig.tar.gz (2007-05-05::18/6) http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.4.orig.tar.gz 8712a6162633f27dce36f57bc60599a5 1282392 sisu_0.52.4.orig.tar.gz @@ -121,7 +142,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.0.orig.tar.gz sisupod (zip) files (currently) have inserted into the binary: 'SiSU sisupod 0.52.0' - and sisupod (zip) of directory content: + and sisupod (zip) of directory content: 'SiSU sisupod 0.52.0 directory contents sisupod-sisu-2007-04-03.ssp' * command line options: @@ -138,7 +159,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.0.orig.tar.gz conversion to and from ordinary sisu markup (.sst) * shared_xml fix (occasionally affecting html) make sure content of - =1.8.3) - + * sisu_0.31.3-2 debian:control: Depends: ruby (>=1.8.2) %% sisu_0.31.2.orig.tar.gz (2005w47/6 | 2005-11-26) @@ -3029,7 +3050,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.31.1.orig.tar.gz * odf, minor fix url match - * [sample documents urls to amazon and barnes and noble + * [sample documents urls to amazon and barnes and noble added as courtesy to authors] * [Note: change to automated debian package build procedure] @@ -3039,7 +3060,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.31.0.orig.tar.gz e6beae75cda1d00c68dc0d97c67cb540 3244304 sisu_0.31.0.orig.tar.gz 8785cf622dee3fe07eed841b8cfbf8e1 10626 sisu_0.31.0-1.diff.gz - * metaverse, header, italicise and bold lists, + * metaverse, header, italicise and bold lists, results in significant changes markup change use regex directly [results in odf (openoffice) repair of 0.30.9] @@ -3049,9 +3070,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.10.orig.tar.gz ed89acbe1f406f2f55052651d12f1b78 3242816 sisu_0.30.10.orig.tar.gz 6495690d1611efd7c9a8145a8b0ca73e 10589 sisu_0.30.10-1.diff.gz - * rollback to 0.30.8 header, italicise and bold lists, - use of semi-colon delimited list, - [new version number 0.31 opened for header use of regex + * rollback to 0.30.8 header, italicise and bold lists, + use of semi-colon delimited list, + [new version number 0.31 opened for header use of regex to italicise and bold] %% sisu_0.30.9.orig.tar.gz (2005w47/2 | 2005-11-22) @@ -3063,7 +3084,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.9.orig.tar.gz * package directory structure modified to comply with setup.rb default data/man moved to man as setup.rb, affects debian - + * header, italicise and bold lists, markup change use regex directly [instead of converting semi-colon delimited list] @@ -3108,12 +3129,12 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.5.orig.tar.gz e3e08897e4d7c3373c5898f31926c094 3228219 sisu_0.30.5.orig.tar.gz 583723571b8df2aa7717a7872b143227 10497 sisu_0.30.5-1.diff.gz - * conf, homepage, skin path precedence, fix + * conf, homepage, skin path precedence, fix (related to finding ./_sisu/conf/skin/doc/skin_sisu.rb) * summary, suggested links, cosmetic: fix to static url - * sisu_doc, drop making of directory _sisu/config + * sisu_doc, drop making of directory _sisu/config (using _sisu/conf) %% sisu_0.30.4.orig.tar.gz (2005w46/6 | 2005-11-19) @@ -3136,7 +3157,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.3.orig.tar.gz 444a194aae38120f13fd3bf2f9ae505a 3227547 sisu_0.30.3.orig.tar.gz 1d1b49a957cb118a3110574d26bb9304 10413 sisu_0.30.3-1.diff.gz - * configuration, change, use ./_sisu/conf + * configuration, change, use ./_sisu/conf [WARNING ./_sisu/config is depreciated and will be removed] * db:pgsql, bugfix FROM required in a select statement @@ -3145,7 +3166,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.3.orig.tar.gz * zap, delete, -Z disable by default, to use must enable in sisurc.yaml - * rmagick, disable load/require by default, sisurc.yaml + * rmagick, disable load/require by default, sisurc.yaml problem with some local installs of ruby * pdfetex, call with -fmt=pdflatex @@ -3153,7 +3174,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.3.orig.tar.gz * summary, metadata suggested links added * xml,xhtml,html tidy only run with -V or -M - rexml only with -M, primary reason a considerable speedup + rexml only with -M, primary reason a considerable speedup in skipping step unless specifically requested for testing * sisu control file, changes a bit arbitrary, but a bit easier @@ -3193,8 +3214,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.0.orig.tar.gz * sisudoc, only -V and -M show verbose tgz of what goes in to sisudoc (previously -v did) - * name correction: SiSU is a recursive acronym, and has other - alternative possible expansions, one of which i got wrong, + * name correction: SiSU is a recursive acronym, and has other + alternative possible expansions, one of which i got wrong, under the influenced of the other ! * SiSU information Structuring Universe * Simple information Structuring Universe @@ -3250,17 +3271,17 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.29.3.orig.tar.gz * rsync use added for remote puts -R (scp is -r) - * summary bug fix, variable scope reduced + * summary bug fix, variable scope reduced (incorrectly retained information from previous files in batch runs) * introduced -K which deletes output files prior to processing of files of same type * -s sisu markup source copied to output directory, (placed remotely with -sr) - + * -S sisudoc made and copied to output directory, (placed remotely with -Sr) [renamed from -Z] - + * --update updates previous output, with same filetype output only, useful * [-F renaming from -S naive cgi search form sample] @@ -3271,12 +3292,12 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.29.3.orig.tar.gz http://www.jus.uio.no/sisu/pkg/src/sisu_0.29.2.orig.tar.gz b8ecd141040e1ffa0820cdf9382304a7 3220476 sisu_0.29.2.orig.tar.gz 3d42aeb8d9648fed4baf837c59cff7a5 9899 sisu_0.29.2-1.diff.gz - + * sql table metadata created, replaces table titles [breaks former table structure] * sql urls replaces links table - + * pgsql comments * cgi scripts use table:metadata instead of table:tiles @@ -3311,7 +3332,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.29.1.orig.tar.gz [as alternative to 0~cvs equivalent, metaverse and downstream adjusted accordingly] - * debian/control added suggests lv and rcs as alternative to cvs + * debian/control added suggests lv and rcs as alternative to cvs [to which it is personally preferred for document control (as making more sense working with favoured used development distributed source control management systems, mercurial and darcs)] @@ -3321,7 +3342,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.29.0.orig.tar.gz a1658902d929eee564c77f061568a677 3214113 sisu_0.29.0.orig.tar.gz fc3c5c566c307636d23467476d38b5bf 9732 sisu_0.29.0-1.diff.gz - * metaverse autonumbering changed, + * metaverse autonumbering changed, affecting default html segment naming [change to metaverse affects downstream processing] @@ -3357,7 +3378,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.28.2.orig.tar.gz ae92bc6a14600a15f4bfbe5512bf9af2 3213202 sisu_0.28.2.orig.tar.gz ee23f7ac2122521fe4d802e023921a7f 9644 sisu_0.28.2-1.diff.gz - * texpdf character encoding bugfix, (removed iconv) however, + * texpdf character encoding bugfix, (removed iconv) however, sisu requires utf-8 input for extended character sets * character encoding touches, e.g. sample files saved as utf-8 @@ -3380,16 +3401,16 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.28.0.orig.tar.gz 12064bd92864441ab8b103f094412c2f 3210000 sisu_0.28.0.orig.tar.gz 22c5452ca4a060ddbb4bcb768a4bd119 9600 sisu_0.28.0-1.diff.gz - Release (and version number bump) primarily to put ruby sisu segfault + Release (and version number bump) primarily to put ruby sisu segfault bug behind us, Debian ruby-1.8.3-2 released and fixes this - [an emergency build to work around the problem was made available as + [an emergency build to work around the problem was made available as 0.27.0 see note there for details] * remote placement of open document files added (odt) * added open document format to several default shortcuts sisu -2 etc. - * made note of opendocument format output on sisu home page + * made note of opendocument format output on sisu home page [feature not complete] * synced skin_sisu.rb files, (there are a bit too many of them, most would normally be syslinks) @@ -3404,7 +3425,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.26.4.orig.tar.gz * sisu -Z without [filename/wildcard] makes gzip of sisu directory of marked up files, including sisu markup source files, local configuration file, images and skins. - + * sisu -Z [filename/wildcard] makes gzip of individual sisu file specified including sisu markup source file and related images and skin @@ -3421,7 +3442,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.26.4.orig.tar.gz tables poem code - + todo: groups tables @@ -3447,13 +3468,13 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.26.3.orig.tar.gz its images and its skins, opens as sisu_ball directory, which once unipped sisu may be run within, - (sisu does not at present automatically unpack and run on these files, + (sisu does not at present automatically unpack and run on these files, but is a convenient way of packing the contents of a file for sending) [early days] * man1/sisu.1 upadated and html on -B sisu file format (sisu help not yet done) - * cosmetic firefox taken from list of lightweight browsers, + * cosmetic firefox taken from list of lightweight browsers, remains very much amongst the heavies * cosmetic correction on info related to librmagick-ruby contained within @@ -3473,16 +3494,16 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.26.2.orig.tar.gz for the editors: * nano http://www.nano-editor.org/ * diakonos http://purepistos.net/diakonos/ - + NOT REALLY DONE, but intitial attempt included anyway: * nedit http://www.nedit.org/ * gedit http://www.gnome.org/projects/gedit * kate http://kate.kde.org * emacs http://www.gnu.org/software/emacs/emacs.html - [vim-sisu still provides the most comprehensive sisu markup + [vim-sisu still provides the most comprehensive sisu markup editor environment] - + * evince becomes the default pdf in maintenance urls etc. (previous was xpdf) * document samples image dimensions manually provided, affected document @@ -3493,13 +3514,13 @@ WARNING ruby 1.8.3 (2005-09-21) [i486-linux] segfaults SiSU FIXED in 1.8.3 (2005-09-29) [i486-linux] thank you TS/Guy Decoux the new ruby build is not as yet uploaded to Debian unstale -%% sisu_0.27.0.orig.tar.gz (2005w39/1 | 2005-09-26) %% Emergency Release: +%% sisu_0.27.0.orig.tar.gz (2005w39/1 | 2005-09-26) %% Emergency Release: NOTE: this is an emergency version of SiSU that does not segfault with problem versions of ruby, see note follwing. It is prepared without Syck/Yaml Problem ruby versions: -* ruby 1.8.3 (2005-09-21) and was removed by TS:Guy in ruby 1.8.3 (2005-09-29), +* ruby 1.8.3 (2005-09-21) and was removed by TS:Guy in ruby 1.8.3 (2005-09-29), released as Debian unstable ruby-1.8.2-1, and in * ruby 1.8.3 (2005-10-12) and was again removed by TS:Guy in ruby 1.8.3 (2005-10-13). @@ -3512,7 +3533,7 @@ Problem ruby versions: ignoring yaml user config files as such this emergency release: - * only uses sisu default configuration settings, + * only uses sisu default configuration settings, ignoring yaml user config files * does not provide sisu version information @@ -3525,7 +3546,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.26.1.orig.tar.gz * wmap & vocabulary, minor modifications, and runs metaverse - * minor pruning and renaming, small changes + * minor pruning and renaming, small changes %% sisu_0.26.0.orig.tar.gz (2005w37/7 | 2005-09-18) http://www.jus.uio.no/sisu/pkg/src/sisu_0.26.0.orig.tar.gz @@ -3552,7 +3573,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.11.orig.tar.gz bdd533301ed392ec7c27f1e364dc8388 sisu_0.25.11-1.diff.gz * cgi, cgi sql search form sample generator, link suffixes added - + * cgi, cgi sql search form sample generator, -S takes additional parameter webrick to provide port links that webrick server will use. @@ -3562,10 +3583,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.11.orig.tar.gz * html output (tune), fix image, no link where non provided, i.e. where the { imagename.png }image notation is used - + * html output (css & tune), image caption, smaller font - * configure, (-C & -CC) absence of trang is only reported + * configure, (-C & -CC) absence of trang is only reported if -V (extra verbose) flag is used * processing remote urls, (-C & -CC) absence of external_images is only @@ -3594,7 +3615,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.9.orig.tar.gz that require the librmagick library. [librmagick-ruby is not "required" as provided documents are marked up accordingly, it is never needed. As an example first image markup form requires the library, the second does not: - { freeculture01.png }http://www.free-culture.cc/ + { freeculture01.png }http://www.free-culture.cc/ {freeculture01.png 350x350 }http://www.free-culture.cc/ * man pages additions, mostly "man 8 sisu" @@ -3604,10 +3625,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.8.orig.tar.gz bd8edf228360f3f3795812c93edfee19 3159743 sisu_0.25.8.orig.tar.gz 17b662d3d2e7f1881c7eebecb6dca192 9232 sisu_0.25.8-1.diff.gz - * metaverse, default is to run metaverse wherever it may be required, + * metaverse, default is to run metaverse wherever it may be required, i.e. when any of - abDdeHhINptXxz - * plaintext, endnotes version (-e) sorted, + * plaintext, endnotes version (-e) sorted, -a (footnotes following paragraphs) is ok [however is currently an either or, both output plain.txt] @@ -3669,7 +3690,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.5.orig.tar.gz dadf9ffb77c629189be5f08345f451cf 3154083 sisu_0.25.5.orig.tar.gz 7749d8a2a4ed73e9f0d85e5fae5d9027 9178 sisu_0.25.5-1.diff.gz - * latex/pdf cosmetic reduced size of font related to document + * latex/pdf cosmetic reduced size of font related to document processing information. %% sisu_0.25.4.orig.tar.gz (2005w37/1 | 2005-09-12) @@ -3688,7 +3709,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.3.orig.tar.gz * metaverse, subtle correction todo with interaction between operation of bold lines and bold words selected in header. - * changes to text accompanying latex/pdfs, toning down of language, + * changes to text accompanying latex/pdfs, toning down of language, correction of gpl2 url to fsf.org rather than gnu.org %% sisu_0.25.2.orig.tar.gz (2005w36/6 | 2005-09-10) @@ -3735,7 +3756,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.24.2.orig.tar.gz cbbfdde8fd261b1bfdd47f633c895222 9093 sisu_0.24.2-1.diff.gz * character encoding, existing table hash replaced with a KirbyBase table - character encoding lib is not currently used by sisu, + character encoding lib is not currently used by sisu, (& KirbyBase is not included with sisu), for what it is see http://www.netpromi.com/kirbybase_ruby.html ) hoever, this is a possible way forward should such a table be needed @@ -3748,7 +3769,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.24.1.orig.tar.gz * latex/pdf fix: tilde may be printed if marked up as escaped character has been a problem, (revisit, refactor what is done with tilde) - * escaping sisu special characters a bit of work done, html latex/pdf + * escaping sisu special characters a bit of work done, html latex/pdf done { } ~ < > _ - / # | : ! ^ examine need for others such as * * latex/pdf, also html, bugfix, a bit of work on escaping of sisu special @@ -3817,20 +3838,20 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.24.0.orig.tar.gz * texpdf, utf8 added properly by way of ucs package (now requires latex-ucs) breaks some things but in the long run is hopefully an improvement currently supported encodings utf8 and iso8859. - + Resulting in out of the box improved Iñtërnâtiônàlizætiøn a slightly more extended character set, using utf-8, [ tested so far on LaTeX / pdf output, line-breaking is not perfect ] ! # $ % & \ () * + , - . / ' 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] … † ‡ < - ~ t ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ' µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å - æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ + æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ * character encoding, utf-8 improved basic table, not yet utilised though, [and even as a small utf-8 table is on the large side] * minor code play with output (webserve) path - + * sqlite db output mapped to webserve path, current directory stub [instead of being deposited in pwd] @@ -3841,7 +3862,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.24.0.orig.tar.gz with level 4 in doc version consider implications [easy to attach somthing to level 5 & 6 names] - * document digest in document information by default + * document digest in document information by default (previously only when cvs info also selected) * loading of skins for inserts @@ -3865,7 +3886,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.22.0.orig.tar.gz dependency on other packages, introduced for rmagick and now used also for dbi. - * rmagick if installed can be used to calculate image dimensions, so these + * rmagick if installed can be used to calculate image dimensions, so these need not be provided in markup. * sql database operations only attempted if dbi is loaded(/available for @@ -3902,18 +3923,18 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.21.0.orig.tar.gz * changes to file structure for processing and provided images now placed under the markup directory in _sisu - ./_sisu/processing [built by sisu] unless ./ is not writable + ./_sisu/processing [built by sisu] unless ./ is not writable then /tmp/sisu_processing ./_sisu/image [added to manually] ./_sisu/config [precedence: ./_sisu/config ~/.sisu /etc/sisu] - * skin fix reading and precedence + * skin fix reading and precedence [uses ./_sisu/config/skin ~/.sisu/skin /etc/sisu/skin ./_sisu/processing/external_document/skin] * external documents, provide similar logic placed in ./_sisu/processing/external_document/{image,config} - this should mean that along external documents are downloaded + this should mean that along external documents are downloaded together with their skins and images and processed as a unit * changed a couple of search path statements (skin,sisurc) to use blocks. @@ -3937,7 +3958,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.8.orig.tar.gz 2fee766bb3079d7f955dbeb8c7e1c9dd 3089931 sisu_0.20.8.orig.tar.gz 6505b8ad8e6ccdc73676a61b25a466a2 8815 sisu_0.20.8-1.diff.gz - * minor database rationalisation, + * minor database rationalisation, postgresql & sqlite logic in same files [additional testing required] @@ -3957,7 +3978,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.7.orig.tar.gz UNIX ASCII * vim auto-conversion to UNIX ASCII for sisu markup files - (sisu parses unix ascii, not dos ascii ... consider further, + (sisu parses unix ascii, not dos ascii ... consider further, an issue for example with many(most/all?) Project Gutenberg texts) %% sisu_0.20.6.orig.tar.gz (2005w34/1 | 2005-08-22) @@ -3965,7 +3986,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.6.orig.tar.gz 8e50493f947b6c1e0ed77bb1fb4e8ede 3096291 sisu_0.20.6.orig.tar.gz 0636fedf8a38e0cb62dbdf7c0ad9397f 8778 sisu_0.20.6-1.diff.gz - * (composite) fix for new header links where linbreak used + * (composite) fix for new header links where linbreak used and imported into composite document, result in .t? suffix * (sisu_search.cgi) sample search form, minor fixes & @@ -3984,21 +4005,21 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.4.orig.tar.gz c65c974dbdef638014c578c8a06d4560 3095378 sisu_0.20.4.orig.tar.gz bca68a13d322deee67a4e20730c55acb 8741 sisu_0.20.4-1.diff.gz - * (param) header links notation made similar to links within text + * (param) header links notation made similar to links within text old markup syntax remains possible, (i.e. backward compatibility kept) [should possibly force version number change to 0.21 but is minor change] * small touch to sisu vim syntax file, remove false positive error highlighting for alternative links markup - * touch to remove relevance of whitespace in image markup + * touch to remove relevance of whitespace in image markup (previously a problem in composite texts for latex/pdf output) * (metaverse for html) touch, whitespace reintroduced where name is given to an object as easy solution to interference that may otherwise arise with urls - * html touch whitespace reintroduced where name is given to an object + * html touch whitespace reintroduced where name is given to an object as easy solution to interference that may otherwise arise with urls * ruby-libyaml removed from debian control, @@ -4018,7 +4039,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.3.orig.tar.gz http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.2.orig.tar.gz 56c7a77c9a78f12cd132e06234ded543 3094356 sisu_0.20.2.orig.tar.gz 774b095fc376f4decde435fd6d32fbc2 8631 sisu_0.20.2-1.diff.gz - + * sisu_vim manpage * latex/pdf monospace font (ttfamily) where code{ }code is used @@ -4035,13 +4056,13 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.2.orig.tar.gz http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.1.orig.tar.gz 1cdbe3739722c877af1095135a7a6f9e 3089912 sisu_0.20.1.orig.tar.gz 90e8a6ac6a1c868d8f7138c8974b2611 8588 sisu_0.20.1-1.diff.gz - - * console output XML clutter reduced, + + * console output XML clutter reduced, REXML parsed headers now only produced for -V not -v * debian package, started signing dsc and changes file both email addresses ralph@amissah.com and ralph.amissah@gmail.com - on ring, singing ended up being done against latter, + on ring, singing ended up being done against latter, the former being what debian knows me as, correct on next signing Key fingerprint = F899 5A87 C648 3F38 5107 79F1 B97B 7C4D BD76 E77F @@ -4078,14 +4099,14 @@ OhNer8Yu7SSyBCIO/8V71UhkgyUdG7fMl0BzqPmITwQYEQIADwUCQvx+2QIbDAUJ A8JnAAAKCRC5e3xNvXbnfzpwAJ0ZKPoWuWrx8K/zGSIRRj7ZRbf6KgCgji13BXoF tJaIUHauen7hNIoUQXo= =6US6 ------END PGP PUBLIC KEY BLOCK----- +-----END PGP PUBLIC KEY BLOCK----- %% sisu_0.20.0.orig.tar.gz (2005w32/4 | 2005-08-11) http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.0.orig.tar.gz 0c0c5ef53a3dd85fcaf5912a971c3b26 3089497 sisu_0.20.0.orig.tar.gz 741731b3d842820cb2b427fdf1197e4a 8517 sisu_0.20.0-1.diff.gz 0b1ea809280f45b293cb5a9ea9453b49 8551 sisu_0.20.0-2.diff.gz - + * remap sisu psql database names to SiSU_[directory name stub] instead of just [directory name stub] as this will make name collisions (and accidents) with other databases, when using SiSU to creating, deleting @@ -4107,13 +4128,13 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.0.orig.tar.gz http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.8.orig.tar.gz aa7e128202d4e60dfa9b328888406a3d 3087797 sisu_0.18.8.orig.tar.gz 262edbc6bcd7b29cf70d8f3b0fd1a9cf 8404 sisu_0.18.8-1.diff.gz - + * (webrick url) console display of output text default to webrick url - (can be switched off in sisurc.yaml, by setting + (can be switched off in sisurc.yaml, by setting webserve,webrick_url: false) however this assumes people know to start sisu_webrick - (it is a toss-up between advertising webrick's availability, - and sticking with filesystem paths as default, may have + (it is a toss-up between advertising webrick's availability, + and sticking with filesystem paths as default, may have to revert) have thought of tying webrick url output to starting sisu_webrick automatically, would need to look at log files and get logging off the console, else would disturb @@ -4142,7 +4163,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.8.orig.tar.gz http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.7.orig.tar.gz ace9eb421e31f7d3f1d12ba29b00baaf 3086170 sisu_0.18.7.orig.tar.gz 3530196ebba2260a60bfe885ee536731 8393 sisu_0.18.7-1.diff.gz - + * some license clean up, gpl2 or later (appearing in pdf text output), removed sentences referring to alternative, somehow missed in previous grand cleanup sisu_0.16.24 where all document headers were cleaned, and the @@ -4155,7 +4176,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.7.orig.tar.gz * sequence digests if requested follow on directly after metaverse -mN... - * html and latex/pdf so far, continue tradition of assuming that a comma (,) + * html and latex/pdf so far, continue tradition of assuming that a comma (,) or full stop (.) following a url is part of a sentence, i.e. if a url actually is terminated by a comma or a dot are not parsed correctly, is extremely convenient, consider implications though, may need to change. @@ -4174,7 +4195,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.6.orig.tar.gz * fixed digest tree where image not found * defaults for shortcut flags (-1v -3v etc.) set to - create the digest tree (-N) + create the digest tree (-N) and to include filetype suffix (-H) as this works with webrick (sisu_webrick) @@ -4182,7 +4203,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.6.orig.tar.gz consistently removed as on cursory glance does not appear to be supported by tetex, trivial to add later - man page and help mention of verbose screen output of digest tree + man page and help mention of verbose screen output of digest tree %% sisu_0.18.5.orig.tar.gz (2005w31/6 | 2005-08-06) http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.5.orig.tar.gz @@ -4205,13 +4226,13 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.4.orig.tar.gz * detailed document md5 digest output as digest.txt generated with -N flag [decide whether to: - keep multiple document digest versions; and + keep multiple document digest versions; and whether to link to html or databse (at some stage add digest names to html generated)] * added -N flag (document digests) to man pages and help - * replaced uses of include? with plain regex (some vague recollection of + * replaced uses of include? with plain regex (some vague recollection of rumours of depreciation in future ruby)... no rush, perhaps should have waited @@ -4246,10 +4267,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.1.orig.tar.gz 030ba198b242541bd261ec5fb0776b0a 3086052 sisu_0.18.1.orig.tar.gz 6cd8c2b571c485edbe77946fe7245a14 8301 sisu_0.18.1-1.diff.gz - * latex/pdf, tmp bugfix, substitute & with 'and' in toc, + * latex/pdf, tmp bugfix, substitute & with 'and' in toc, needed e.g. for AT&T, see ffa, REVISIT - * a bit of play with texinfo module, but (still) broken + * a bit of play with texinfo module, but (still) broken (in 0.18) until tested * some writing in man pages @@ -4259,84 +4280,84 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.0.orig.tar.gz ff45f2bca98b6e8fbae0714684576571 3086151 sisu_0.18.0.orig.tar.gz 9f0cf2ca1b6e02aea52f9dd22e51c32d 8268 sisu_0.18.0-1.diff.gz - Development branch 0.17 (opened 2005-07-14) + Development branch 0.17 (opened 2005-07-14) rolled back into main as 0.18: sisu_0.17.5.orig.tar.gz (2005w29/5 | 2005-07-22) http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.5.orig.tar.gz 23e3b01175d55e815933881fcfe415c5 3085611 sisu_0.17.5.orig.tar.gz 41e800763be26bb37a8f1901a05bff08 8570 sisu_0.17.5-1.diff.gz - + * plaintext linebreaks in endnotes
- + * xml series, branch-fix todo with tables (common_xml) - + * html endnote section branch-fix - + sisu_0.17.4.orig.tar.gz (2005w29/4 | 2005-07-21) http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.4.orig.tar.gz 23bef7ae21ac0b65cb7b27c049f3ea15 3085478 sisu_0.17.4.orig.tar.gz 6542bc3d7f65440f02834de6141e74dd 8553 sisu_0.17.4-1.diff.gz - + * url maintenance mode, minor fix - + * small fixes to latex pdf mostly todo with & character - + sisu_0.17.3.orig.tar.gz (2005w29/3 | 2005-07-20) http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.3.orig.tar.gz 086b054dba3ee8837406157c74062252 3084736 sisu_0.17.3.orig.tar.gz 3029bdb8375586b57cec9997578d8f98 8535 sisu_0.17.3-1.diff.gz - + * md5 into postgresql and sqlite modules, (including endnotes clean md5 digest) - + * Implemented, but need to be consistent about content of paragraphs on which md5 digest is made: - + 1. clean/stripped text without any markup, paragraph, headings etc. without endnotes - + 2. endnotes clean/stripped text digest only (there may be several endnotes within a paragraph) - + 3. whole object, text with markup and any endnotes, (question: with or without the endnote digests??? presumption better without, [however may be easier to check with?]) - + * some renaming in db modules - + [deleted accidentally and rebuilt] - + sisu_0.17.2.orig.tar.gz (2005w28/5 | 2005-07-15) http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.2.orig.tar.gz dab5f72a55e525e3f2bac4053db57c6a 3083022 sisu_0.17.2.orig.tar.gz 4fad5f499da1d26d89070ce1cb26ad8d 8512 sisu_0.17.2-1.diff.gz - + * change in metaverse representation of md5 hashes - + * cleaning up of output after introduction of md5 digests - + sisu_0.17.1.orig.tar.gz (2005w28/5 | 2005-07-15) http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.1.orig.tar.gz ed3301693f3a86535b6d7c1595c1afdf 3082665 sisu_0.17.1.orig.tar.gz a3bf9b7198544ae341e0c4b397b185fd 8467 sisu_0.17.1-1.diff.gz - + * arrangement of md5s - + sisu_0.17.1.orig.tar.gz (2005w28/5 | 2005-07-15) http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.1.orig.tar.gz *** sisu_0.17.1.orig.tar.gz *** sisu_0.17.1-1.diff.gz - + * todo with use of dev branch and being 0.17 rather than 0.16 - + sisu_0.17.0.orig.tar.gz (2005w28/4 | 2005-07-14) http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.0.orig.tar.gz MD5(sisu_0.17.0.orig.tar.gz)= 46d56d54e6040170cbaad77f6764e2ca - + * incorporated two md5 digests for each object, available for use downstream as desired - + %% sisu_0.16.26.orig.tar.gz (2005w28/6 | 2005-07-16) http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.26.orig.tar.gz *** sisu_0.16.26.orig.tar.gz @@ -4371,7 +4392,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.23.orig.tar.gz * some changes in use of ocn for segment naming in html output * a couple of postgresql fileds changed to text - + * using Rant 4.0 for package build and install(er) * cosmetic rearrangement of code @@ -4381,11 +4402,11 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.22.orig.tar.gz 4c290986eb68607420a602c3fae4baaf 3087090 sisu_0.16.22.orig.tar.gz c925bddaee01bb7b5d5a2c241f3f75e0 8089 sisu_0.16.22-1.diff.gz - * metaverse fix for alternative endnote markup marker + * metaverse fix for alternative endnote markup marker at end of line~^ * texpdf fix for images, (where dimensions not - provided) not final, may need to pass through + provided) not final, may need to pass through imagemagick at metaverse stage * fix to cgi sample sisu_search.cgi @@ -4426,8 +4447,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.17.orig.tar.gz 410f1c01c261e2cf2bb25ff782b4c0b8 3105488 sisu_0.16.17.orig.tar.gz 649cbe59bf940d93a74cdac46e59123c 7774 sisu_0.16.17-1.diff.gz - * separated color file out from ftplugin ... called dusk (or slate) by - me for several years i now call it sisu... perhaps i should stick + * separated color file out from ftplugin ... called dusk (or slate) by + me for several years i now call it sisu... perhaps i should stick with slate as it is pretty appropriate... hmmm, slate %% sisu_0.16.16.orig.tar.gz (2005w26/3 | 2005-06-29) @@ -4435,8 +4456,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.16.orig.tar.gz f5ce8002e6876feba22c276d4e49d3f5 3105731 sisu_0.16.16.orig.tar.gz 251af2096015e193888a429cd69a328d 7576 sisu_0.16.16-1.diff.gz - * small touches to offer vim config files working the way i am used to - with Debian install... needs testing by someone with different + * small touches to offer vim config files working the way i am used to + with Debian install... needs testing by someone with different habits though. %% sisu_0.16.15.orig.tar.gz (2005w26/3 | 2005-06-29) @@ -4452,9 +4473,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.15.orig.tar.gz http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.14.orig.tar.gz 18e0cfcac265ecb03e9af5f958aad0f7 3105239 sisu_0.16.14.orig.tar.gz 493c64b453dc43ff36565aacacbc0b8c 7441 sisu_0.16.14-1.diff.gz - + * sisu vim ftplugin ... for folds, syntax, colors, markup - auto installed in debian, + auto installed in debian, (but uses shared filetype in /usr/share/vim/addons check how that is supposed to work) else (non-debian install) @@ -4464,13 +4485,13 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.14.orig.tar.gz http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.13.orig.tar.gz 775c33a1e6f0140f5552cb3f2784b00a 3124785 sisu_0.16.13.orig.tar.gz 04242b7e8fec91a0b4f69bd 7328 sisu_0.16.13-1.diff.gz - + * debian setup of vim syntax ok... however much vim setup still to automate, immediately noticeable: folds for sisu not sorted; and permitting cursor movement up and down without following long lines with screen wrap; (and no clever way yet to contribute colors other than through sisu-examples, but they being user preference should be contributed with care). - + * on_markup.txt quick check & minor update %% sisu_0.16.12.orig.tar.gz (2005w26/1 | 2005-06-27) @@ -4482,7 +4503,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.12.orig.tar.gz ~/.sisu/skin/doc /etc/sisu/skin/doc defaults - and content is interchangeable (so future latent break + and content is interchangeable (so future latent break is less likely) * touch to Rantfile. @@ -4493,12 +4514,12 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.11.orig.tar.gz 742089f905479231a32fb6b4fc62824f 7024 sisu_0.16.11-1.diff.gz * bugfix a default variable, in defaults version should be @ver - introduced by cuts and pastes between different files, - with recent default home page updates; make less likely to - happen in future, for now quick fix, revisit: + introduced by cuts and pastes between different files, + with recent default home page updates; make less likely to + happen in future, for now quick fix, revisit: currently index.html taken from - ~/.sisu/skin/doc if it exists else defaults, - /etc/sisu/skin/doc is ignored, breaking expected + ~/.sisu/skin/doc if it exists else defaults, + /etc/sisu/skin/doc is ignored, breaking expected search precedence %% sisu_0.16.10.orig.tar.gz (2005w25/0 | 2005-06-26) @@ -4579,9 +4600,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.3.orig.tar.gz 7dc657a1299e3ff831c932eb3975293f 3124710 sisu_0.16.3.orig.tar.gz 93210116080bed4f22356e8ac1bba570 6324 sisu_0.16.3-1.diff.gz - * tables fixed, much latent breakage sorted + * tables fixed, much latent breakage sorted html segments fixed (scroll was ok) - xml sax and dom sorted + xml sax and dom sorted xml css naive but done latex/pdf done @@ -4591,11 +4612,11 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.2.orig.tar.gz e82cc99b1a8a62cb1d590aa3dc65a4eb 6227 sisu_0.16.2-1.diff.gz * conditional heading reinstated /^[12]~\?\s/ - (may be used when it is expected that a document may be - imported into another, and the controlling documents level + (may be used when it is expected that a document may be + imported into another, and the controlling documents level 1 and/or 2 headings should be used instead (take precedence)) - * rant install options, force specification of root if wish to + * rant install options, force specification of root if wish to proceed as root, (previously was default on ok or continue) %% sisu_0.16.1.orig.tar.gz (2005w25/3 | 2005-06-22) @@ -4642,7 +4663,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.0.orig.tar.gz * to mark headers and heading levels: [0-6]~ replaces [0-6]\{ and [0-6]\{~ [at the start of a line] header and headings marked by digit tilde at the start of the line - tilde replacing unclosed curly brace occurring after digit at + tilde replacing unclosed curly brace occurring after digit at beginning of line vim: :%s/\([0-6]\){\~\?/\1\~/c @@ -4669,13 +4690,13 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.0.orig.tar.gz http://www.jus.uio.no/sisu/pkg/src/sisu_0.15.1.orig.tar.gz MD5(sisu_0.15.1.orig.tar.gz)= d00ff37b438fe38732d887d8555dddb5 - * Syntax Changes, WARNING breaks old syntax, + * Syntax Changes, WARNING breaks old syntax, - * endnotes where not embedded within text, + * endnotes where not embedded within text, i.e. endnote following paragraph with endnote marker ~^ replaces ~e as marker within text ^~ for endnote content instead of -{{ or ~{{ [at the start of a line] - {~^ shortcut for making link with url as endnote }http://url + {~^ shortcut for making link with url as endnote }http://url instead of {~e previous shortcut}http://url vim: :%s/\~e/\~^/c @@ -4685,11 +4706,11 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.0.orig.tar.gz http://www.jus.uio.no/sisu/pkg/src/sisu_0.15.2.orig.tar.gz MD5(sisu_0.15.2.orig.tar.gz)= c28a58664d9a5f1726ed4c5f875e8f12 - * bugfix for composite documents, place newline - and mark end of import + * bugfix for composite documents, place newline + and mark end of import (bug also in current stable 0.14.6) - * bugfix for [html] endnotes introduced (in param) + * bugfix for [html] endnotes introduced (in param) in development branch * number paragraph in given heading sequence @@ -4699,13 +4720,13 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.0.orig.tar.gz sisu -t * fix webrick port settings sysenv - + * html subtoc touch required * help files updated on syntax changes - + * document markup samples updated - + * vim syntax files updated * extensive testing required @@ -4767,8 +4788,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.14.2.orig.tar.gz 90ab342311461a0c7b752df78e43d3b5 3121884 sisu_0.14.2.orig.tar.gz 257f8716e88e0a29aa6853d73520821d 3414 sisu_0.14.2-1.diff.gz - * -g option taken out, unused and forgotten - -h and -H currently do what -g used to by default + * -g option taken out, unused and forgotten + -h and -H currently do what -g used to by default (will revisit) %% sisu_0.14.1.orig.tar.gz (2005w23/2 | 2005-06-14) @@ -4783,12 +4804,12 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.14.0.orig.tar.gz a7ba5eeedad74ba6231f13c3a39535ec 3121235 sisu_0.14.0.orig.tar.gz fd74f52531699370664657064aed8578 3406 sisu_0.14.0-1.diff.gz - * Flattened directory structure for ./conf/sisu which maps to /etc/sisu - or equivalent i.e. removed the additional version number which is - not supported by debian packaging, and unnecessary anyway. + * Flattened directory structure for ./conf/sisu which maps to /etc/sisu + or equivalent i.e. removed the additional version number which is + not supported by debian packaging, and unnecessary anyway. (this change is the reason for version the hop to 0.14.0) - * Changed name of ./conf/sisu/sisurc.yaml.sample_disabled, + * Changed name of ./conf/sisu/sisurc.yaml.sample_disabled, is now ./conf/sisu/sisurc.yaml and enabled with some parts commented out @@ -4798,16 +4819,16 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.14.0.orig.tar.gz * Added man page summary of sisu-examples (and a README for directory which refers you to man page) -%% sisu_0.12.7.tar.gz (2005w22/3 | 2005-06-01 ) -http://www.jus.uio.no/sisu/pkg/src/sisu_0.12.7.tar.gz - MD5(sisu_0.12.7.tar.gz)= 080a45e3e94ed744cca9d0222aa0ae9b +%% sisu_0.12.7.tar.gz (2005w22/3 | 2005-06-01 ) +http://www.jus.uio.no/sisu/pkg/src/sisu_0.12.7.tar.gz + MD5(sisu_0.12.7.tar.gz)= 080a45e3e94ed744cca9d0222aa0ae9b [(self inflicted) glitch with Debian build, not released together with source tarball.] * Make SiSU convenient to use to produce other formats (including LaTeX) without the software necessary to produce pdf, i.e. pdflatex http://www.tug.org/applications/pdftex/ all this does really is recognise when pdflatex is absent - and pdfs cannot be generated in html generated output + and pdfs cannot be generated in html generated output (i.e. no links to pdf are produced, as was previously the case where pdf output was assumed) @@ -4829,7 +4850,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.12.6.orig.tar.gz * removed sisu-[version number] executable, is not necessary, (resulted in skip from 0.12.6 from 0.12.4) [0.12.6] -%% sisu_0.12.5.orig.tar.gz +%% sisu_0.12.5.orig.tar.gz skipped, synced tarball and deb in 0.12.6 %% sisu_0.12.4.orig.tar.gz (2005w21/4 | 2005-05-26 ): @@ -4843,18 +4864,18 @@ skipped, synced tarball and deb in 0.12.6 db7b4401a63dea7b9f47b6ead5cf9d4a 3272 sisu_0.12.3-1.diff.gz * updated man 8 sisu - + * updated part of interactive help in line with 'man 1 sisu' and 'man 8 sisu' - + * debian package added as required in current ubuntu at least: libyaml-ruby - + * touch to sisu_termsheet, colour fix %% sisu_0.12.2.orig.tar.gz (2005w21/1 | 2005-05-23 ): 65d8cc8021579e307f8c2cce31cc988 3119888 sisu_0.12.2.orig.tar.gz 6a13bc64be600e96366ccff0fac66344 3208 sisu_0.12.2-1.diff.gz - * changes with packaging methods (rather than sisu), and redone from + * changes with packaging methods (rather than sisu), and redone from scratch with new origional source * switch from using the sha digest to md5 @@ -4863,7 +4884,7 @@ skipped, synced tarball and deb in 0.12.6 2c877136005c5052921e619d435f0c91 3119846 sisu_0.12.1.orig.tar.gz 28e4022ff40fcfc0c5d8f6d64279ede7 3146 sisu_0.12.0-1.diff.gz - * changes with packaging methods (rather than sisu), and redone from + * changes with packaging methods (rather than sisu), and redone from scratch with new original source * switch from using the sha digest to md5 @@ -4888,7 +4909,7 @@ skipped, synced tarball and deb in 0.12.6 689f92bce4d1a9390d0c62726410d47b 3128684 sisu_0.10.9.orig.tar.gz 2775d317627ca5902b5c430defb39421 235 sisu_0.10.9-1.diff.gz - * default generic install of sisu is to type as root + * default generic install of sisu is to type as root (in the root directory of the unpacked tarball): ruby install @@ -4896,22 +4917,22 @@ skipped, synced tarball and deb in 0.12.6 For additional options: ruby install help - + or - + ruby install -T - + Thanks to rant. - * rant install file (used by sisu) has been made fairly - generic, and mirrors the directory structure used by + * rant install file (used by sisu) has been made fairly + generic, and mirrors the directory structure used by setup.rb - sisu specific post setup instructions are included + sisu specific post setup instructions are included in rant/plugin directory. - * removed Rakefile, I do like rake, but do find - rant more flexible and remove the duplication of + * removed Rakefile, I do like rake, but do find + rant more flexible and remove the duplication of effort. The Rantfile, or rather install works without the separate installation of rant. @@ -4939,7 +4960,7 @@ skipped, synced tarball and deb in 0.12.6 SHA1(sisu_0.10.7.tar.gz)= e18a47f07c1627f353bfc3a7c1e9d647c3265cf3 Debian sisu_0.10.7-1.dsc: d5978970a1e5891e5e9b0b406f503f79 3094556 sisu_0.10.7-1.tar.gz - * Rantfile for installation, (Stefan Lang's rant) + * Rantfile for installation, (Stefan Lang's rant) to install SiSU, in the root directory of the unpacked SiSU as root type: ruby install @@ -4955,30 +4976,30 @@ skipped, synced tarball and deb in 0.12.6 %% SiSU version 0.10.5 of 2005w18/0 (2005-05-08): sisu_0.10.5.tar.gz SHA1(sisu_0.10.5.tar.gz)= 274be3ca806288d7cce5607707c4fd35fe1ecc6c - + * version detail [synchronising packaging] %% SiSU version 0.10.4 of 2005w18/0 (2005-05-08): sisu_0.10.4.tar.gz SHA1(sisu_0.10.4.tar.gz)= 3adfc0400055fa45200158c34523486fdede895a - + * small fix on reporting, generated by information, metaverse %% SiSU version 0.10.3 of 2005w18/0 (2005-05-08): sisu_0.10.3.tar.gz SHA1(sisu_0.10.3.tar.gz)= ad95cbe339115437f1605e4aa7d7cd4519bb34cb - + * cleaning in packages %% SiSU version 0.10.2 of 2005w18/0 (2005-05-08): sisu_0.10.2.tar.gz SHA1(sisu_0.10.2.tar.gz)= 6e02af05df9b32ed3565b2058bb15ab19482c893 - + * rebuilt to correct debian package paths .deb installation paths should be correct * work-nickname Sabaki dropped from naming convention, will for - the time being stick to just sisu + the time being stick to just sisu (previous work-names/nick-names included scribbler, and scribe) %% SiSU version 0.10.1 of 2005w18/5 (2005-05-06): @@ -4987,7 +5008,7 @@ skipped, synced tarball and deb in 0.12.6 Contains development-branch, version 0.11.1 of 2005w18/5 0.11.1 of 2005w18/5 - * debian packaging, + * debian packaging, all architectures, use debian sub_version numbers 0.11.1-1 @@ -4995,14 +5016,14 @@ skipped, synced tarball and deb in 0.12.6 with tarball created by debuild (remove sabaki and date stamp) the sha provided here is for the darcs tarball, - will have to consider what to do when also providing debuild - source tarball with it's own sha, and in any event to reduce + will have to consider what to do when also providing debuild + source tarball with it's own sha, and in any event to reduce duplication - * deb package provided together with debian source package + * deb package provided together with debian source package and ***, which contains debian package sha. - * tinkering in database lib, minor renaming edits, + * tinkering in database lib, minor renaming edits, (tuple instead of loadline) * fix to cgi sample: sisu_search.cgi @@ -5015,8 +5036,8 @@ skipped, synced tarball and deb in 0.12.6 Contains development-branch, version 0.11.0 of 2005w18/2 0.11.0 of 2005w18/2 (0.9.10 - 0.11.0) - * debian packaging re-visited, - (based on help from wookey earlier in the year, + * debian packaging re-visited, + (based on help from wookey earlier in the year, thanks also to geoff for testing, ... more to be done, but progress.) @@ -5038,7 +5059,7 @@ skipped, synced tarball and deb in 0.12.6 SHA1(sisu-sabaki_0.8.3_2005w17-5.tar.gz)= 5603a862909c24eaec7a65b91f376e581fc76362 Contains development-branch, version 0.9.6 of 2005w17/5 - + 0.9.5 - 6 2005w17/5 * xml series tables @@ -5047,13 +5068,13 @@ skipped, synced tarball and deb in 0.12.6 SHA1(sisu-sabaki_0.8.2_2005w17-5.tar.gz)= 6564d4babe9a04520699bdeaac0f13c0bd723fa3 Contains development-branch, version 0.9.4 of 2005w17/5 - + 0.9.4 2005w17/5 * fixes: * html table of contents, use of ocn * xml series, (metaverse & xml_common) - tables not created at present, and removed + tables not created at present, and removed revisit, (previous version inserted non-"tidy" xml markup) %% SiSU Sabaki, version 0.8.1 of 2005w17/4 (2005-04-28): @@ -5061,7 +5082,7 @@ skipped, synced tarball and deb in 0.12.6 SHA1(sisu-sabaki_0.8.1_2005w17-4.tar.gz)= c3508979690aad04834238354b259ae0c2588bfb Contains development-branch, version 0.9.3 of 2005w17/4 - + 0.9.3 2005w17/4 (contains rad of 2005w17/4) * hot on the heels of 0.8.0 some fixes, and more likely to follow. @@ -5071,13 +5092,13 @@ skipped, synced tarball and deb in 0.12.6 SHA1(sisu-sabaki_0.8.0_2005w17-4.tar.gz)= 8fcfc3f8d7661a0b3110a3206491581a93e0e920 Contains development-branch, version 0.9.2 of 2005w17/4 (rad - 0.9.2) - - Summary, an old idea reinstated, to permit alternative text - presentations downstream: + + Summary, an old idea reinstated, to permit alternative text + presentations downstream: rad of 2005w17/3 - * old idea reinstated: + * old idea reinstated: metaverse now carries three ocn (numbering) schemes for each document * ocn as before all substantive objects numbered sequentially @@ -5088,7 +5109,7 @@ skipped, synced tarball and deb in 0.12.6 some bugs remain rad of 2005w17/4 - * changes to plaintext, xml series, and wmap to take account of ocn + * changes to plaintext, xml series, and wmap to take account of ocn changes 0.9.0 2005w17/4 (contains rad of 2005w17/3-4) @@ -5096,7 +5117,7 @@ skipped, synced tarball and deb in 0.12.6 * fixes needed in libraries using altered ocn/metaverse (more to follow) - * cgi-bin search form sample + * cgi-bin search form sample 0.9/data/sisu/sample/cgi-bin/sisu_search.cgi break fix (table structure had been changed) @@ -5112,15 +5133,15 @@ skipped, synced tarball and deb in 0.12.6 0.5.10 of 2005w16/2 - * default shortuct flags -1 to -5 (what they do) can be modified in + * default shortuct flags -1 to -5 (what they do) can be modified in sisurc.yaml (by changing the default flags they call) - * screen output ansi colour default can be set to true or false in + * screen output ansi colour default can be set to true or false in sisu.rc with -c acting as a toggle to turn screen output colour on or off as appropriate against the default set. 0.7.0 of 2005w16/3 - + * Remove old markup syntax, simplifies description of SiSU markup, without any loss of functionality (the newer markup style is already a superset of the old). Removal of old markup syntax necessitates branch/ version change. @@ -5141,12 +5162,12 @@ skipped, synced tarball and deb in 0.12.6 * remote file operations and file letter naming conventions, now composite, requesting, requiring files have filename with extension .r when processed a temporary file is created with the extension .t - + when a url is provided to request the processing of a remote file, the file is downloaded saved and processed with the .u extension - 0.7.2 of 2005w16/6 - + 0.7.2 of 2005w16/6 + * Work with the downloading of images where remote documents are requested either by use of a url on the command line or within a composite document images if not found there are downloaded to a subdirectory of the working @@ -5210,21 +5231,21 @@ skipped, synced tarball and deb in 0.12.6 * sysenv ansi colors, revisit later - * wordmaps, revisit later... problem introduced (a loop removed, + * wordmaps, revisit later... problem introduced (a loop removed, double counting removed) * rescue single line syntax rescue: ... 0.5.8 of 2005w15/0 - * introduce -c ansi color flag for screen output, (perhaps should be - color off instead), and + * introduce -c ansi color flag for screen output, (perhaps should be + color off instead), and -q quiet mode, no screen output - there is some scope for breakage here, continue to examine the + there is some scope for breakage here, continue to examine the plumbing * man page updated - + 0.5.9 of 2005w16/1 * dbi fixes from 0.5.8 changes (ansi) @@ -5240,7 +5261,7 @@ skipped, synced tarball and deb in 0.12.6 * sqlite default file name created to sisu_sqlite.db (was lex.db) * plaintext some cleaning of output - + * xml, minor touch, image tag, version/revision control info optional %% SiSU Sabaki, version 0.4.1 of 2005w15/3 (2005-04-13): @@ -5251,17 +5272,17 @@ skipped, synced tarball and deb in 0.12.6 0.5.1 of 2005w15/3 - * dbi sqlite re-introduced, though not tested. some things moved to + * dbi sqlite re-introduced, though not tested. some things moved to common_db 0.5.2 of 2005w15/3 - * common_db, dbi, pg and sqlite most logic is common and moved to + * common_db, dbi, pg and sqlite most logic is common and moved to common_db 0.5.3 of 2005w15/3 - - * dbi increased field size for text contents again, + + * dbi increased field size for text contents again, (to 12,000 for now from inadequate 2712) both postgresql and sqlite appear to support this @@ -5269,12 +5290,12 @@ skipped, synced tarball and deb in 0.12.6 sisu-sabaki_0.4.0_2005w15-2.tar.gz SHA1(sisu-sabaki_0.4.0_2005w15-2.tar.gz)= 832f47c37910dfbac05c401f26865b5f53dea358 - Contains development-branch, version + Contains development-branch, version 0.5.0 == 0.3.0 of 2005w15/2 0.3.1 of 2005w15/2 - * image representation changed dimensions now represented as + * image representation changed dimensions now represented as width x height i.e. \d+x\d+ e.g. 480x640 (as in imagemagick) previously was explicit w=480 h=640 (this change causes breakage in sample text with images) @@ -5284,33 +5305,33 @@ skipped, synced tarball and deb in 0.12.6 0.5.0 of 2005w15/2 * sorry for the quick version number turn around, and for its being applied - to pretty minor changes. - + to pretty minor changes. + The version numbering rule applied is that a second digit version number change will be made when potential breakage is caused by code changes. - + This has happened now with the decision to alter representation of image dimensions. Backward compatibility, though easily provided is not thought to be necessary (or desirable) in this instance, based on current user base, and modest use of images in text. 0.4.0 is on it's way. This type of event is fairly rare, though it has occurred occasionally in subtle ways. For example Tainaron marked up in 1997-1998 markup style still builds. - - For description of change see 0.3.1 + + For description of change see 0.3.1 %% SiSU Sabaki, version 0.2.0 of 2005w14/0 (2005-04-10): sisu-sabaki_0.2.0_2005w14-0.tar.gz SHA1(sisu-sabaki_0.2.0_2005w14-0.tar.gz)= 36986ffa6a17651a0d52646c9c91032af33bb32a From stable 0.1.4-11 - Contains development-branch, version + Contains development-branch, version 0.3 == 0.1.5-58 of 2005w13/6 * version number changes: stable branch is 0.2 development branch is 0.3 - * replaced config_environment.rb file which had dropped out of stable + * replaced config_environment.rb file which had dropped out of stable tarball. [lesson, test future setup/installs from clean slate] %% STABLE MANIFEST (@ 0.1.4 branch) @@ -5319,32 +5340,32 @@ skipped, synced tarball and deb in 0.12.6 sisu-sabaki-stable_0.1.4-10_2005w14-6.tar.gz SHA1(sisu-sabaki-stable_0.1.4-11_2005w14-6.tar.gz)= bdb2b09d467804a6d3a4bd92abb13c015c57d897 - Contains development-branch, version + Contains development-branch, version 0.1.5-58 of 2005w13/6 (56-58) 0.1.5-56 of 2005w14/3 - * html endnote segment, (introduced bug fixed) linkback to + * html endnote segment, (introduced bug fixed) linkback to main text broken, url was split on more than one line, resulting in error - * special characters escaping for use within text + * special characters escaping for use within text looked at, (mostly there previously but not documented) - ~ { } < > - _ / also used : ^ ! # - note added to man pages + ~ { } < > - _ / also used : ^ ! # + note added to man pages (more to be done) 0.1.5-57 of 2005w14/5 - * distinguish text poem from other text groupings by giving an + * distinguish text poem from other text groupings by giving an object citation number to each verse - * cosmetic html default colors for navigation band and home button + * cosmetic html default colors for navigation band and home button surround made neutral (white) 0.1.5-58 of 2005w14/6 - * distinguish text poem from other text groupings by giving an + * distinguish text poem from other text groupings by giving an object citation number to each verse * alt and group text groupings bugfix @@ -5353,12 +5374,12 @@ skipped, synced tarball and deb in 0.12.6 sisu-sabaki-stable_0.1.4-10_2005w13-6.tar.gz SHA1(sisu-sabaki-stable_0.1.4-10_2005w13-6.tar.gz)= bdd91b004c456251d6e7074439f6e9b571ae5316 - Contains development-branch, version + Contains development-branch, version 0.1.5-55 of 2005w13/6 (47-55) 0.1.5-47 of 2005w13/3 - * texpdf suggested urls at end of document problems with latex special + * texpdf suggested urls at end of document problems with latex special characters, not fully looked into, or passed through the appropriate filter, but some ad hoc corrections made @@ -5382,23 +5403,23 @@ skipped, synced tarball and deb in 0.12.6 0.1.5-51 of 2005w13/4 - * initial xml table logic is in place (logic taken from html unit) [still using + * initial xml table logic is in place (logic taken from html unit) [still using html type tags but logic is in place] 0.1.5-52 of 2005w13/6 * object character numbering of special blocks "code", "poem", "group" - and "alt" finally corrected, in line with "tables". (may introduce a subtle + and "alt" finally corrected, in line with "tables". (may introduce a subtle variation, between poem and code, or alt and others, numbering the equivalent - of each verse, but need a bit of time to consider) numbering correct, some - cosmetic adjustments to follow, e.g. in pdfs, more work necessary in xml + of each verse, but need a bit of time to consider) numbering correct, some + cosmetic adjustments to follow, e.g. in pdfs, more work necessary in xml series. 0.1.5-53 of 2005w13/6 * dbi a bit of cleaning of search column, and touch to data - 0.1.5-54 of 2005w13/6 + 0.1.5-54 of 2005w13/6 * texpdf adjustment to position of ocn in special text blocks @@ -5414,8 +5435,8 @@ skipped, synced tarball and deb in 0.12.6 sisu-sabaki-stable_0.1.4-9_2005w13-2.tar.gz SHA1(sisu-sabaki-stable_0.1.4-9_2005w13-2.tar.gz)= 743b912beddc235ec96456e97fe9350b2a275370 - Contains development-branch, version - 0.1.5-46 of 2005w13/1 (44-46) + Contains development-branch, version + 0.1.5-46 of 2005w13/1 (44-46) * small updates to man page @@ -5423,8 +5444,8 @@ skipped, synced tarball and deb in 0.12.6 sisu-sabaki-stable_0.1.4-8_2005w13-1.tar.gz SHA1(sisu-sabaki-stable_0.1.4-8_2005w13-1.tar.gz)= f8a7760bbd583e5d8637420d153c178ffafcbf68 - Contains development-branch, version - 0.1.5-43 of 2005w13/1 (34-43) + Contains development-branch, version + 0.1.5-43 of 2005w13/1 (34-43) Quick summary (context sisu markup): @@ -5438,7 +5459,7 @@ skipped, synced tarball and deb in 0.12.6 * various small fixes -- detail from development branch - + 0.1.5-44 of 2005w13/2: * documentation updates @@ -5464,7 +5485,7 @@ skipped, synced tarball and deb in 0.12.6 #using thlnk require r{ req #for vim folds - + with thlnk is attractive if you use vim because it recognises and permits the plain-text hyperlinking to the remote file, which can be called in for viewing. @@ -5478,7 +5499,7 @@ skipped, synced tarball and deb in 0.12.6 .s[1-3] ordinary sisu marked up documents .si sisu marked up snippets for incorporation into other documents .r[1-3] documents using require - (like a master document) - .t[1-3] temporary marked up files, usually created by sisu for processing, + .t[1-3] temporary marked up files, usually created by sisu for processing, e.g. from building the master file, or on having downloaded a remote sisu markup file for local processing. @@ -5489,33 +5510,33 @@ skipped, synced tarball and deb in 0.12.6 and peace); and .s3 requesting both the scroll and segments. 0.1.5-41 of 2005w12/0: - + * more alpha code: remote source a sisu markup file using url (http://) for - local processing. - + local processing. + For example, assuming sisu is installed, you could generate the text of the GPL in plain-text, html, xhtml, XML, pdf and a wordmap of its contents using the following string: - sisu -mhpabxXwv http://www.jus.uio.no/sisu/sample/markup/gpl2.fsf.s3 + sisu -mhpabxXwv http://www.jus.uio.no/sisu/sample/markup/gpl2.fsf.s3 - or to just do html and pdf files from one remote source to the default + or to just do html and pdf files from one remote source to the default remote destination (assuming you have one setup): - - sisu -mhpr http://www.jus.uio.no/sisu/sample/markup/gpl2.fsf.s3 - + + sisu -mhpr http://www.jus.uio.no/sisu/sample/markup/gpl2.fsf.s3 + [this works for texts without embedded images, unless you already have the images stored locally - it will be a relatively easy matter to get the program to search relative parts on the remote server and download them for processing with the document... no doubt it will happen one day, but is not a priority in the near future, also; will be a small step to permit remote (and local files) to be stored in zip format and unzipped prior to - processing if desired, to reduce bandwidth and time] - + processing if desired, to reduce bandwidth and time] + Nice from a flexibility perspective, though I expect SiSU's use to be primarily on locally stored marked up document sets. - * vim updates (small touches) to sisu: syntax highlighting; folds, and; + * vim updates (small touches) to sisu: syntax highlighting; folds, and; recognised filetypes (included .si .[rst][0-3] already being recognised) 0.1.5-40 of 2005w12/0: @@ -5539,18 +5560,18 @@ skipped, synced tarball and deb in 0.12.6 require r{ req #for vim folds - the value of the textlink and thlnk style is they are live hyperlinks to - the constituent parts of the document, which can be brought up at a + the value of the textlink and thlnk style is they are live hyperlinks to + the constituent parts of the document, which can be brought up at a keystroke for viewing or editing. - + [An interesting possibility to consider, is to permit sisu to get the composite parts of a document from a remote url source via http, using thlnk syntax which permits this - - NOTE: implemented in 0.1.5-42] - + - NOTE: implemented in 0.1.5-42] + 0.1.5-39 of 2005w12/6: - - * *alpha* code: assemble source document for processing from a document + + * *alpha* code: assemble source document for processing from a document requesting additional parts ... i.e. a master document, or a document with regular markup plus external insertions. Requesting documents currently with named suffix .r[1-3] documents requested may be complete valid sisu @@ -5568,11 +5589,11 @@ skipped, synced tarball and deb in 0.12.6 { name_of_file_to_load.s3 }require 0.1.5-38 of 2005w12/6: - + * xml sax and dom, pass data through... development-branch, version 0.1.5-37 of 2005w12/6 - + * document generator information added as comment to head of xml & xhtml output @@ -5583,7 +5604,7 @@ skipped, synced tarball and deb in 0.12.6 * cosmetic, (still with screen output on doing remote sending) - * [ratchet fix so yyyymmdd date info displayed correctly, was dropping + * [ratchet fix so yyyymmdd date info displayed correctly, was dropping the 0 before month and day where less than 10] * css and default home page modified @@ -5608,8 +5629,8 @@ skipped, synced tarball and deb in 0.12.6 sisu-sabaki-stable_0.1.4-7_2005w12-3.tar.gz SHA1(sisu-sabaki-stable_0.1.4-7_2005w12-3.tar.gz)= 929875de0658f1adeabd837fa09aca3ae48197e0 - Contains development-branch, version - 0.1.5-33 of 2005w12/3 (30-33) + Contains development-branch, version + 0.1.5-33 of 2005w12/3 (30-33) 0.1.5-33 of 2005w12/3: @@ -5640,12 +5661,12 @@ skipped, synced tarball and deb in 0.12.6 sisu-sabaki-stable_0.1.4-6_2005w12-1.tar.gz SHA1(sisu-sabaki-stable_0.1.4-6_2005w12-1.tar.gz)= 3f8ded60f1f43e3ba3e745d9bbc045bb0ab43ffb - Contains development-branch, version - 0.1.5-29 of 2005w11/6 (22-29) + Contains development-branch, version + 0.1.5-29 of 2005w11/6 (22-29) from development-branch, version 0.1.5-26 to 0.1.5-29 of 2005w11/6 - * -h0 turns off object character number display in html ouput + * -h0 turns off object character number display in html ouput (-p0 to turn of object character number display in pdf, already exists) [this is the digit 0 not upercase o] @@ -5662,7 +5683,7 @@ skipped, synced tarball and deb in 0.12.6 0.1.5-25 of 2005w11/5: * on table of contents page (for segmented text), new arrow navigation - button linked to first segment. + button linked to first segment. * -ru forces use of scp so as to build remote file structure and for input files selected for processing, to copy all output files in their @@ -5678,7 +5699,7 @@ skipped, synced tarball and deb in 0.12.6 0.1.5-24 of 2005w11/3: * [decided how to represent blockquotes, propagte] - + * provided sisu home site urls (not a code change) 0.1.5-23 of 2005w11/3: @@ -5687,7 +5708,7 @@ skipped, synced tarball and deb in 0.12.6 (e.g. all pdf files for the following files to be processed - previously copied all files from output directory of file for which processing was requested) has a drawback though, as rely on scp -r to build the directory - structure, the first sending of any file must be done by calling the + structure, the first sending of any file must be done by calling the -r flag alone, ie without other sisu instructions. 0.1.5-22 of 2005w11/2: @@ -5705,27 +5726,27 @@ skipped, synced tarball and deb in 0.12.6 sisu-sabaki-stable_0.1.4-5_2005w11-2.tar.gz SHA1(sisu-sabaki-stable_0.1.4-5_2005w11-2.tar.gz)= 25e35edc2f932269d21b17c29890ad72c54510a5 - Contains development-branch, version - 0.1.5-21 of 2005w11/2 + Contains development-branch, version + 0.1.5-21 of 2005w11/2 * html, css, indented bullet fixed - + * [see 0.1.4-4 for recent changes] %% SiSU Sabaki, version 0.1.4-4 of 2005w11/1 (2005-03-14): sisu-sabaki-stable_0.1.4-4_2005w11-1.tar.gz SHA1(sisu-sabaki-stable_0.1.4-4_2005w11-1.tar.gz)= 2ab9fa0a45275ca65a23e5199ef13851f00042f2 - Contains development-branch, version - 0.1.5-16 to 0.1.5-20 of 2005w11/1 + Contains development-branch, version + 0.1.5-16 to 0.1.5-20 of 2005w11/1 * html markup, a quick glance at & nod (anew) towards css changes to ruby html code & to markup arranging & pruning (also get rid of some line noise) from 0.1.5-16 to 0.1.5-20 (an ongoing longer term sort of thing) quite a few changes, more to be done though - + * line wrap visited - + * ascii touched * some code files moved and renamed @@ -5734,8 +5755,8 @@ skipped, synced tarball and deb in 0.12.6 sisu-sabaki-stable_0.1.4-3_2005w10-5.tar.gz SHA1(sisu-sabaki-stable_0.1.4-3_2005w10-5.tar.gz)= 7e06a3b37e85eaebc74892244f6626ee4f2fcc8a - Contains development-branch, version - 0.1.5-15 of 2005w10/5 + Contains development-branch, version + 0.1.5-15 of 2005w10/5 * remote host secure copy: adjustments, and flagged in help as EXPERIMENTAL and as requiring configuration. Checks provided - no action taken if @@ -5750,11 +5771,11 @@ skipped, synced tarball and deb in 0.12.6 sisu-sabaki-stable_0.1.4-2_2005w10-5.tar.gz SHA1(sisu-sabaki-stable_0.1.4-2_2005w10-5.tar.gz)= 46ad3b254b5e9293610dccd6274e039e49c5b9a2 - Contains development-branch, version - 0.1.5-12 of 2005w10/5 + Contains development-branch, version + 0.1.5-12 of 2005w10/5 * forgot to update Rakefile along with rest of last stable relese (this is - excuse for current update) + excuse for current update) * [A potentially useful feature, released prematurely] remote host secure copy using system call, -r flag introduced, hostname and user must be @@ -5765,10 +5786,10 @@ skipped, synced tarball and deb in 0.12.6 (note is faster i am sure to send a compressed tarball)) [could do same for ftp etc.] Note also would be more efficiently implemented as a threaded, will consider later, for now the output of this implementation is - appreciated. + appreciated. * ascii.rb minor touch, (repeated require removed) - + * an email address update for author %% SiSU Sabaki, version 0.1.4-1 of 2005w10/3 (2005-03-09): @@ -5776,8 +5797,8 @@ skipped, synced tarball and deb in 0.12.6 http://www.jus.uio.no/sisu/download/sisu-sabaki-stable_0.1.4-0_2005w10-3.tar.gz SHA1(sisu-sabaki-stable_0.1.4-1_2005w10-3.tar.gz)= 8ab95e942f7dd2449e1c92ec94f15a938d01edce - Contains development-branch, version - 0.1.5-1 (post 2005w06/4) - 0.1.5-11 of 2005w10/2 + Contains development-branch, version + 0.1.5-1 (post 2005w06/4) - 0.1.5-11 of 2005w10/2 0.1.5-11 of 2005w10/1: @@ -5801,7 +5822,7 @@ skipped, synced tarball and deb in 0.12.6 0.1.5-7 of 2005w09/0: * utf8 xml - + * utf8 related transforms in one file, (but should profile), so far latexpdf and html, (xml to follow) @@ -5834,12 +5855,12 @@ skipped, synced tarball and deb in 0.12.6 Changed computer environment to utf8 (locale, postgresql, vim etc.), and run SiSU to see what breaks... * issues detected with LaTeX/pdf and sorted - + * hooks for paper size used by latex/pdf in place currently only default a4 set for all available types, sort out LaTeX settings later. - + * text version of version manifest included start to provide 2004-02-27 - + * small changes to rakefile * small changes to dates in sysenv @@ -5850,7 +5871,7 @@ skipped, synced tarball and deb in 0.12.6 detail as to how this works... this is left out for now, as having so many appendages is a distraction and make sisu look more complicated than it need be, or rather than it is for its' ordinary functions. - + * included Debian directory, first attempt at making a deb. [still only in development directory] @@ -5859,7 +5880,7 @@ skipped, synced tarball and deb in 0.12.6 http://www.jus.uio.no/sisu/download/sisu-sabaki-stable_0.1.4-0_2005w07-2.tar.gz SHA1(sisu-sabaki-stable_0.1.4-0_2005w07-2.tar.gz)= 0867a884c6741751e73e664c6fe485ec7161dcdb - + * substantively the same as 0.1.5-0 (development branch) * tables get object citation numbers @@ -5906,7 +5927,7 @@ skipped, synced tarball and deb in 0.12.6 sisu-sabaki_0.1.2-24_2005w05-5.tar.gz http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-24_2005w05-5.tar.gz SHA1(sisu-sabaki_0.1.2-24_2005w05-5.tar.gz)= - d93c2b510d3784dc7b396541734bcdaf198c0c9b + d93c2b510d3784dc7b396541734bcdaf198c0c9b * if you have ruby1.8.2, rake and sudo install and setup should be automated - small adjustments to Rakefile, if sudo is used on machine, will request @@ -5990,7 +6011,7 @@ skipped, synced tarball and deb in 0.12.6 sisu-sabaki_0.1.2-20_2005w05-2.tar.gz http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-20_2005w05-2.tar.gz SHA1(sisu-sabaki_0.1.2-20_2005w05-2.tar.gz)= - 1e28dde239c96b82acfced1a37615ca7255d102a + 1e28dde239c96b82acfced1a37615ca7255d102a * Most remaining system calls moved to single location, and binaries checked for before use, will be very easy to have alternative calls for different @@ -6010,7 +6031,7 @@ skipped, synced tarball and deb in 0.12.6 %% SiSU Sabaki, version 0.1.2-19 of 2005w05/1 (2005-01-31): sisu-sabaki_0.1.2-19_2005w05-1.tar.gz http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-19_2005w05-1.tar.gz - SHA1(sisu-sabaki_0.1.2-19_2005w05-1.tar.gz)= eb7ef826f2fa69c4ef8eaf33ff297f3141c1217e + SHA1(sisu-sabaki_0.1.2-19_2005w05-1.tar.gz)= eb7ef826f2fa69c4ef8eaf33ff297f3141c1217e * Rakefile modified, same result ... a few more options @@ -6069,7 +6090,7 @@ skipped, synced tarball and deb in 0.12.6 http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-17_2005w04-4.tar.gz SHA1(sisu-sabaki_0.1.2-17_2005w04-4.tar.gz)= e61952bcde4b7cd936fdcd35835287d50af83814 - + * Test documents regenerated. * Bugfix release, fixing bug intruduced by longtime planned nifty new feature @@ -6266,7 +6287,7 @@ SHA1(sisu-sabaki_0.1.2-5_2005w03-2.tar.gz)= non-duplication of such names. There is a remote possibility it breaks something. An example of such a link: http://www.jus.uio.no/sisu/SiSU/2004#ibm - http://www.jus.uio.no/sisu/SiSU/2004#2004-06-17 + http://www.jus.uio.no/sisu/SiSU/2004#2004-06-17 * endnotes were missing from the html full length, scroll outputs, and are now back. @@ -6279,7 +6300,7 @@ SHA1(sisu-sabaki_0.1.2-5_2005w03-2.tar.gz)= http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-1_2005w02-1.tar.gz SHA1(sisu-sabaki_0.1.2-1_2005w02-1_sha1)= 6afa36b152359da215df84244cb156c2ee61d61f - + * previous bundle not quite complete (skins missing) - [still missing were marked incorrectly for darcs revision control exclusion] @@ -6330,7 +6351,7 @@ SHA1(sisu-sabaki_0.1.2-5_2005w03-2.tar.gz)= %% *Withdrawn* - SiSU Sabaki, version 0.1.1-2 of 2005w01/6 (2005-01-08): SHA1(sisu-sabaki_0.1.1-2_2005w01-6.tar.gz)= 6acb02f98d100ff9a7f7a01ad71b88c215488009 - + * Few lines of code changed from 0.1.1-2, which is withdrawn. %% SiSU Sabaki, version 0.1.1-1 of 2005w01/5 (2005-01-07): @@ -6369,7 +6390,7 @@ SHA1(sisu-sabaki_0.1.2-5_2005w03-2.tar.gz)= First release of SiSU - sisu_0.1.0-9_2005w01-2.tgz http://www.jus.uio.no/sisu/download/sisu_0.1.0-9_2005w01-2.tgz SHA1(sisu_0.1.0-9_2005w01-2.tgz)= - 14b230ba5a4c8f1c7264b38cd2d9c95a97477f3a + 14b230ba5a4c8f1c7264b38cd2d9c95a97477f3a SiSU Sabaki, version 0.1.0-9 of 2005w01/2 (2005-01-04) was released to the public on January 4th 2005. It may be downloaded from: @@ -6398,29 +6419,29 @@ SiSU Sabaki development-branch, version 0.1.5-46 of 2005w13/2 * substantively the same as 0.1.4-9 SiSU Sabaki development-branch, version 0.1.5-44 of 2005w13/2 -* substantively the same as 0.1.4-8 +* substantively the same as 0.1.4-8 SiSU Sabaki development-branch, version 0.1.5-33 of 2005w12/3 -* substantively the same as 0.1.4-7 +* substantively the same as 0.1.4-7 SiSU Sabaki development-branch, version 0.1.5-29 of 2005w12/1 -* substantively the same as 0.1.4-6 +* substantively the same as 0.1.4-6 SiSU Sabaki development-branch, version 0.1.5-21 of 2005w11/2 -* substantively the same as 0.1.4-5 +* substantively the same as 0.1.4-5 SiSU Sabaki development-branch, version 0.1.5-20 of 2005w11/1 -* substantively the same as 0.1.4-4 +* substantively the same as 0.1.4-4 -SiSU Sabaki development-branch, version 0.1.5-15 of 2005w10/4 -* substantively the same as 0.1.4-3 +SiSU Sabaki development-branch, version 0.1.5-15 of 2005w10/4 +* substantively the same as 0.1.4-3 -SiSU Sabaki development-branch, version 0.1.5-12 of 2005w10/4 -* substantively the same as 0.1.4-2 +SiSU Sabaki development-branch, version 0.1.5-12 of 2005w10/4 +* substantively the same as 0.1.4-2 -SiSU Sabaki development-branch, version 0.1.5-11 of 2005w10/2 -* substantively the same as 0.1.4-1 +SiSU Sabaki development-branch, version 0.1.5-11 of 2005w10/2 +* substantively the same as 0.1.4-1 -SiSU Sabaki development-branch, version 0.1.5-0 of 2005w06/4 -* substantively the same as 0.1.4-0 +SiSU Sabaki development-branch, version 0.1.5-0 of 2005w06/4 +* substantively the same as 0.1.4-0 diff --git a/bin/sisu b/bin/sisu index 1d9ad7f1..4ee3f0f3 100644 --- a/bin/sisu +++ b/bin/sisu @@ -1,11 +1,11 @@ #!/usr/bin/env ruby #SiSU: copyright (C) 1997..2007 Ralph Amissah; License GPL, see appended program information -raise "Please, use Ruby1.8, 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9' +raise "Please, use Ruby1.8, 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' #or RUBY_VERSION > '1.9' $VERBOSE=nil $KCODE='u' -Version='0.52' -SiSU_lib='sisu/' + Version -require SiSU_lib + '/hub' +branch='v0' +SiSU_lib="sisu/#{branch}" +require "#{SiSU_lib}/hub" __END__ * Name: SiSU information Structuring Universe - Structured information, Serialized Units * Author: Ralph Amissah diff --git a/bin/sisu_termsheet b/bin/sisu_termsheet index aef20bb1..38d24a6f 100644 --- a/bin/sisu_termsheet +++ b/bin/sisu_termsheet @@ -1,10 +1,10 @@ #!/usr/bin/env ruby #SiSU: copyright (C) 1997..2007 Ralph Amissah; License GPL, see appended program information -raise "Please, use Ruby1.8, 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9' +raise "Please, use Ruby1.8, 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' #or RUBY_VERSION > '1.9' $VERBOSE=nil -Version='0.52' -SiSU_lib='sisu/' + Version -require SiSU_lib + '/termsheet' +branch='v0' +SiSU_lib="sisu/#{branch}" +require "#{SiSU_lib}/termsheet" __END__ * Name: SiSU information Structuring Universe - Structured information, Serialized Units * Author: Ralph Amissah diff --git a/bin/sisu_webrick b/bin/sisu_webrick index 4ef1b598..cebddded 100644 --- a/bin/sisu_webrick +++ b/bin/sisu_webrick @@ -1,10 +1,10 @@ #!/usr/bin/env ruby #SiSU: copyright (C) 1997..2007 Ralph Amissah; License GPL, see appended program information -raise "Please, use Ruby1.8, 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9' +raise "Please, use Ruby1.8, 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' #or RUBY_VERSION > '1.9' $VERBOSE=nil -Version='0.52' -SiSU_lib='sisu/' + Version -require SiSU_lib + '/webrick' +branch='v0' +SiSU_lib="sisu/#{branch}" +require "#{SiSU_lib}/webrick" __END__ * Name: SiSU information Structuring Universe - Structured information, Serialized Units * Author: Ralph Amissah diff --git a/lib/sisu/0.52/cgi.rb b/lib/sisu/0.52/cgi.rb deleted file mode 100644 index 83448613..00000000 --- a/lib/sisu/0.52/cgi.rb +++ /dev/null @@ -1,76 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: generates naive cgi search form for search of sisu database (pgsql sqlite) - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah mailto:ralph@amissah.com - Ralph Amissah mailto:amissah@gmail.com - -=end -module SiSU_CGI #% database building documents - require SiSU_lib + '/sysenv' - require SiSU_lib + '/cgi_pgsql' - require SiSU_lib + '/cgi_sqlite' - include SiSU_CGI_pgsql - class SiSU_search - def initialize(opt) - @opt=opt - @webserv=@opt.files[0].to_s.strip - end - def search_info - a=%{ - For help on sisu search, type: - sisu --help search - For help on setting up hyperestraier for sisu, type: - sisu --help hyperestraier - } - tell=SiSU_Screen::Ansi.new(@opt.cmd,a) - tell.print_grey - end - def read - SiSU_CGI_sqlite::SiSU_search_sqlite.new(@opt,@webserv).sqlite - SiSU_CGI_pgsql::SiSU_search_pgsql.new(@opt,@webserv).pgsql - search_info unless @opt.cmd =~/q/ - end - end -end -__END__ diff --git a/lib/sisu/0.52/cgi_pgsql.rb b/lib/sisu/0.52/cgi_pgsql.rb deleted file mode 100644 index a5a2ef93..00000000 --- a/lib/sisu/0.52/cgi_pgsql.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: generates naive cgi search form for search of sisu database (pgsql sqlite) - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah mailto:ralph@amissah.com - Ralph Amissah mailto:amissah@gmail.com - -=end -module SiSU_CGI_pgsql #% database building documents - require SiSU_lib + '/sysenv' - require SiSU_lib + '/cgi_sql_common' - include SiSU_CGI_sql - class SiSU_search_pgsql < SiSU_CGI_common - def initialize(opt,webserv) - @opt,@webserv=opt,webserv - @env=SiSU_Env::Info_env.new('',opt) - @sys=SiSU_Env::System_call.new - @image_src="#{@env.url.webserv_cgi}/_sisu/image" - @common=SiSU_CGI_sql::SiSU_CGI_common.new(@webserv,@opt.cmd,@image_src,@env) - @db=SiSU_Env::Info_db.new - #p @db.port_psql - end - def pgsql - serve=[] - if @sys.psql - available_db_table=`psql --list` # system call requires psql - available_db=available_db_table.scan(/(SiSU_\S+)/) if not available_db_table.nil? - if available_db and available_db.class == Array - available_db.flatten.each do |x| - serve << x.gsub(/SiSU_(\S+)/,'\1') - end - else put "WARNING: no postgresql database available, (have you created one?)" - end - serve.sort! - f1,f2,f3=[],[],[] - serve.each do |x| - f1 << %{ \n} unless x =~/apache|sisu\/image/ #check - end - f2 << %{ selected_db=case cgi['db']\n} - serve.each do |x| - f2 << %{ when /SiSU_#{x}/; ''\n} unless x =~/apache|sisu\/image/ #check - end - end - f2 << " end\n" - if FileTest.writable?('.') - output=File.open('sisu_pgsql.cgi','w') - output << header0 << header1 << header_desc << header2 << f1 << buttons1 << buttons_note << buttons2 << search_request << search_statement << search_statement_common << search_query1 << @common.pages << search_query2 << @common.tail << @common.main1 << f2 << dbi_connect << @common.main2 - a=%{ generated sisu_pgsql.cgi, - BASED ON ALREADY EXISTING directories that could potentially be used to populate postgresql db, (-D) - } - tell=SiSU_Screen::Ansi.new(@opt.cmd,a) - tell.print_grey - c=case @webserv - when /pwd/; '' - else "if necessary make the directory /usr/lib/cgi-bin : - sudo cp -vi #{Dir.pwd}/sisu_pgsql.cgi /usr/lib/cgi-bin/. - sudo chmod -v 755 /usr/lib/cgi-bin/sisu_pgsql.cgi - (copy sisu_pgsql.cgi to your cgi directory) and set file permissions to 755" - end - a=%{#{c} - #{@env.webserv_base_cgi}/cgi-bin/sisu_pgsql.cgi - } - tell=SiSU_Screen::Ansi.new(@opt.cmd,a) - tell.warn - a="postgresql db used for present directory: #{@db.db_psql}" - b="\n\t(to create and populate postgresql database see 'man sisu' and in particular the -D flag)\n\t[the database to be used for this directory (#{@db.db_psql}) will have to be created manually if it does not exist,\n\tsee 'sisu --help sql'\n\tif you have permission to create databases:\n\t'sisu -d --createdb'\n\tor using postgresql tools directly:\n\t'createdb #{@db.db_psql}'\n\tfor a list of existing databases try 'psql --list']" - tell=SiSU_Screen::Ansi.new(@opt.cmd,a,b) - tell.txt_cyan - else puts 'failed in attempt to write sisu_pgsql.cgi to present directory, is directory writable?' - end - end - def header0 - <<-WOK_SQL -#!/usr/bin/env ruby -=begin -#{about} - * Description: generates naive cgi search form for search of sisu database (pgsql) -#{gpl} -=end - require 'cgi' - require 'fcgi' - require 'dbi' - @version='sisu_pgsql' - @image_src="#{@env.url.webserv_cgi}/_sisu/image" - @hosturl_db="#{@env.url.webserv_base_cgi}" - @hosturl_files="#{@env.url.webserv_files_from_db}" - @port="#{@db.port_psql}" - user='' # '#{@env.user}' - WOK_SQL - end - def search_statement - <<-'WOK_SQL' - class Dbi_search_string - def initialize(l,t,q) - @l,@t,@q=l,t,q - end - def string - search={ :search => [],:flag => false } - if @t =~/\S+/ or @q =~/\S+/ - if @t =~/\S+/; unescaped_search=CGI.unescape(@t) - elsif @q =~/\S+/; unescaped_search=CGI.unescape(@q) - end - search_construct=[] - unescaped_search.gsub!(/\s*(AND|OR)\s*/,"' \) \\1 #@l~\( '") - unescaped_search.gsub!(/(.+)/,"#@l~\( '\\1' \)") - search_construct << unescaped_search - search_construct=search_construct.join(' ') - search[:search] << search_construct - search[:flag]=true - search - end - search - end - end - WOK_SQL - end - def buttons_note - ' case sensitive' - end - def search_query1 - <<-'WOK_SQL' - @search_text,@search_endnotes=[],[] - #% - search[:text].each{|x| @search_text << "#{x} AND " } - @search_text=@search_text.to_s.gsub!(/AND\s+$/,'') - @search_text.gsub!(/(documents\.clean~\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+documents\.clean~\(\s*'[^']+'\s*\))+)/,'(\1)') - search[:endnotes].each{|x| @search_endnotes << "#{x} AND " } - @search_endnotes=@search_endnotes.to_s.gsub!(/AND\s+$/,'') - @search_endnotes.gsub!(/(endnotes\.clean~\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean~\(\s*'[^']+'\s*\))+)/,'(\1)') - end - WOK_SQL - end - def search_query2 - <<-'WOK_SQL' - def sql_select_body - limit ||=@@limit - offset ||=@@offset - @sql_statement[:body]=%{SELECT metadata.title, metadata.creator, metadata.filename, metadata.suffix, documents.body, documents.seg, documents.ocn, metadata.tid FROM documents, metadata WHERE (#@search_text) AND documents.metadata_tid = metadata.tid ORDER BY metadata.title, documents.ocn} - @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;} - select=@sql_statement[:body] + ' ' + @sql_statement[:range] - select - end - def sql_select_endnotes - limit ||=@@limit - offset ||=@@offset - @sql_statement[:endnotes]=%{SELECT metadata.title, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE (#@search_endnotes) AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, endnotes.nr} - @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;} - select=@sql_statement[:endnotes] + ' ' + @sql_statement[:range] - select - end - def sql_select_body_format - %{#{sql_select_body}} - end - def sql_select_endnotes_format - %{#{sql_select_endnotes}} - end - def contents - @conn.select_all(sql_select_body) - end - def endnotes - @conn.select_all(sql_select_endnotes) - end - end - WOK_SQL - end - def dbi_connect - <<-'WOK_SQL' - dbi="dbi:Pg:database=#{@db};port=#{@port}" - @conn=DBI.connect(dbi,user) - WOK_SQL - end - end -end -__END__ diff --git a/lib/sisu/0.52/cgi_sql_common.rb b/lib/sisu/0.52/cgi_sql_common.rb deleted file mode 100644 index ae4e170f..00000000 --- a/lib/sisu/0.52/cgi_sql_common.rb +++ /dev/null @@ -1,809 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: generates naive cgi search form for search of sisu database (pgsql sqlite) - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah mailto:ralph@amissah.com - Ralph Amissah mailto:amissah@gmail.com - -=end -module SiSU_CGI_sql - class SiSU_CGI_common - def initialize(webserv,cmd,image_src,dir) - @webserv,@cmd,@image_src,@env=webserv,cmd,image_src,dir - end - def about - <<-'WOK_SQL' - * Name: SiSU information Structuring Universe - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download - WOK_SQL - end - def gpl - <<-'WOK_SQL' - - Copyright (C) 2007 Ralph Amissah - Copyright (C) 2005 Ralph Amissah (first release edition) - Copyright (C) 1997 Ralph Amissah (first edition) - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah ralph@amissah.com - Ralph Amissah ralph.amissah@gmail.com - WOK_SQL - end - def header1 - <<-'WOK_SQL' -#Common TOP - @@limit,@@offset=1000,0 - @base="#@hosturl_db/cgi-bin/#@version.cgi" - @@canned_search_url=@base - class Form - def initialize(base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can='') - search_note='' if checked_searched !~/\S/ - the_can='' if checked_url !~/\S/ - search_field='' if checked_echo !~/\S/ - @base,@search_field,@selected_db,@checked_index,@checked_text,@checked_tip,@checked_searched,@checked_url,@checked_echo,@checked_sql,@checked_all,@checked_none,@checked_ignore,@search_note,@the_can=base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can - @tip=if checked_tip =~/\S/ - 'text:__; keywords:__; title:__; author:__; subject:__; description:__; publisher:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; filename:__;' - else '' - end - end - def submission_form - search_form=<<-WOK - WOK_SQL - end - def header_desc - <<-WOK_SQL - - - - - SiSU search form (sample): SiSU information Structuring Universe - - - - - - - - - - -
SiSU --> - - -
- WOK_SQL - end - def header2 - <<-'WOK_SQL' - -
-
- - - - select which database to search - -
- - - index - text / grep - -
- - -
- -
- WOK_SQL - end - def buttons2 - <<-'WOK_SQL' -
- #@tip - #@search_note - #@the_can -
-
- - echo previous search - search result stats - url for search - available search fields - sql statement -
- checks: - selected - all - none -
- -
- - WOK - end - end - WOK_SQL - end - def search_request - <<-'WOK_SQL' - class Search_request #% search_for - attr_accessor :text1,:keywords,:title,:author,:subject,:description,:publisher,:contributor,:date,:type,:format,:identifier,:source,:language,:relation,:coverage,:rights,:comment,:abstract,:owner,:date_created,:date_issued,:date_modified,:date_available,:date_valid,:filename - def initialize(search_field='',q='') - @search_field,@q=search_field,q - @text1=@keywords=@title=@author=@subject=@description=@publisher=@contributor=@date=@type=@format=@identifier=@source=@language=@relation=@coverage=@rights=@comment=@abstract=@owner=@date_created=@date_issued=@date_modified=@date_available=@date_valid=@filename='' - if @search_field=~/\S/ - @text1=text_to_match('text:') - @keywords=text_to_match('key(?:words?)?:') - @title=text_to_match('title:') # DublinCore 1 - title - @author=text_to_match('(?:author|creator)s?:') # DublinCore 2 - creator/author - @subject=text_to_match('subj(?:ect)?:') # DublinCore 3 - subject - @description=text_to_match('description:') # DublinCore 4 - description - @publisher=text_to_match('pub(?:lisher)?:') # DublinCore 5 - publisher - @contributor=text_to_match('contributor:') # DublinCore 6 - contributor - @date=text_to_match('date:') # DublinCore 7 - date dd-mm-yy - @type=text_to_match('type:') # DublinCore 8 - type - @format=text_to_match('format:') # DublinCore 9 - format - @identifier=text_to_match('identifier:') # DublinCore 10 - identifier - @source=text_to_match('source:') # DublinCore 11 - source - @language=text_to_match('language:') # DublinCore 12 - language - @relation=text_to_match('relation:') # DublinCore 13 - relation - @coverage=text_to_match('coverage:') # DublinCore 14 - coverage - @rights=text_to_match('rights:') # DublinCore 15 - rights - @comment=text_to_match('comment:') - @abstract=text_to_match('abs(?:tract)?:') - @owner=text_to_match('owner:') - @date_created=text_to_match('date_created:') - @date_issued=text_to_match('date_issued:') - @date_modified=text_to_match('date_modified:') - @date_available=text_to_match('date_available:') - @date_valid=text_to_match('date_valid:') - @filename=text_to_match('filename:') - @text1=text_to_match unless @keywords or @author or @title or @text1 or @comment or @abstract or @rights or @subject or @publisher or @date or @filename - else - @text1=q['s1'] if q['s1']=~/\S/ - @keywords=q['key'] if q['key']=~/\S/ - @title=q['ti'] if q['ti']=~/\S/ - @author=q['au'] if q['au']=~/\S/ - @subject=q['sj'] if q['sj']=~/\S/ - @description=q['dsc'] if q['dsc']=~/\S/ - @publisher=q['pb'] if q['pb']=~/\S/ - @contributor=q['cntr'] if q['cntr']=~/\S/ - @date=q['dt'] if q['dt']=~/\S/ - @type=q['ty'] if q['ty']=~/\S/ - @identifier=q['id'] if q['id']=~/\S/ - @source=q['src'] if q['src']=~/\S/ - @language=q['lang'] if q['lang']=~/\S/ - @relation=q['rel'] if q['rel']=~/\S/ - @coverage=q['cov'] if q['cov']=~/\S/ - @rights=q['cr'] if q['cr']=~/\S/ - @comment=q['co'] if q['co']=~/\S/ - @abstract=q['ab'] if q['ab']=~/\S/ - @date_created=q['dtc'] if q['dtc']=~/\S/ - @date_issued=q['dti'] if q['dti']=~/\S/ - @date_modified=q['dtm'] if q['dtm']=~/\S/ - @date_available=q['dta'] if q['dta']=~/\S/ - @date_valid=q['dtv'] if q['dtv']=~/\S/ - @filename=q['fns'] if q['fns']=~/\S/ - @@limit=q['ltd'] if q['ltd']=~/\d+/ # 1000 - @@offset=q['off'] if q['off']=~/\d+/ # 0 - end - end - def text_to_match(identifier='') - m={ - :string => /#{identifier}\s*(.+?)/, - :string => /#{identifier}\s*(.+?)(?:;|\n|\r|$)/, - :word => /#{identifier}[\s(]*(\S+)/ - } - search_string=if @search_field =~m[:word] - search_string=if @search_field =~m[:braces]; m[:braces].match(@search_field)[1] - elsif @search_field =~m[:string]; m[:string].match(@search_field)[1] - else - str=m[:word].match(@search_field)[1] - str.gsub!(/[()]/,'') - str - end - search_string.strip! - search_string.gsub!(/\s+/,'+') - search_string - #else - # "__" - end - end - end - WOK_SQL - end - def search_statement_common - <<-'WOK_SQL' - class Dbi_search_statement - attr_reader :text_search_flag,:sql_select_body_format,:sql_select_endnotes_format,:sql_offset,:sql_limit - def initialize(conn,search_for,q) - @conn=conn - @text_search_flag=false - @sql_statement={ :body=>'',:endnotes=>'',:range=>'' } - #@offset||=@@offset - #@offset+=@@limit - search={ :text => [],:endnotes => [] } - st=Dbi_search_string.new('documents.clean',search_for.text1,q['s1']).string - se=Dbi_search_string.new('endnotes.clean',search_for.text1,q['s1']).string - @text_search_flag=st[:flag] - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << se[:search] - end - st=Dbi_search_string.new('metadata.keywords',search_for.keywords,q['key']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - st=Dbi_search_string.new('metadata.title',search_for.title,q['ti']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - st=Dbi_search_string.new('metadata.creator',search_for.author,q['au']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - st=Dbi_search_string.new('metadata.subject',search_for.subject,q['sj']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - st=Dbi_search_string.new('metadata.description',search_for.description,q['dsc']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - st=Dbi_search_string.new('metadata.publisher',search_for.publisher,q['pb']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - st=Dbi_search_string.new('metadata.contributor',search_for.contributor,q['cntr']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - st=Dbi_search_string.new('metadata.date',search_for.date,q['dt']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - st=Dbi_search_string.new('metadata.type',search_for.type,q['ty']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - st=Dbi_search_string.new('metadata.identifier',search_for.identifier,q['id']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - st=Dbi_search_string.new('metadata.source',search_for.source,q['src']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - st=Dbi_search_string.new('metadata.language',search_for.language,q['lang']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - st=Dbi_search_string.new('metadata.relation',search_for.relation,q['rel']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - st=Dbi_search_string.new('metadata.coverage',search_for.coverage,q['cov']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - st=Dbi_search_string.new('metadata.rights',search_for.rights,q['cr']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - st=Dbi_search_string.new('metadata.comment',search_for.comment,q['co']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - st=Dbi_search_string.new('metadata.abstract',search_for.abstract,q['ab']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - st=Dbi_search_string.new('metadata.filename',search_for.filename,q['fns']).string - if st[:flag] - search[:text] << st[:search] - search[:endnotes] << st[:search] - end - @@limit=q['ltd'] if q['ltd']=~/\d+/ # 1000 - @@offset=q['off'] if q['off']=~/\d+/ # 0 - WOK_SQL - end - def pages - <<-'WOK_SQL' - def sql_offset - @@offset - end - def sql_limit - @@limit - end - def sql_canned_search - @offset_next=sql_offset.to_i + sql_limit.to_i - @offset_previous=sql_offset.to_i - sql_limit.to_i - def current - @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + sql_offset.to_s - end - def next - @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_next.to_s - end - def previous - @offset_previous >= 0 ? (@@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_previous.to_s) : '' - end - def start - @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + 0.to_s - end - self - end - def sql_canned_search_url - can=sql_canned_search - page=(sql_offset.to_i + sql_limit.to_i)/sql_limit.to_i - case page.to_s - when /^1$/ - %{

- pg. #{page.to_s} -   > -
} - when /^2$/ - %{

- <   - pg. #{page.to_s} -   > -
} - else - %{

- |<   - <   - pg. #{page.to_s} -   > -
} - end - end - WOK_SQL - end - def tail - <<-WOK_SQL - def tail - <<-'WOK' -


-
- - -

- presentations' look and feel
- generated by
- SiSU in Ruby with the usual GPL (or OSS) suspects - Way Better!
- SiSU
- version 0.50
2007w11/1 (2007-03-12)
- - - © Ralph Amissah
- 1993, current 2007
- GPL 2
- w3 since October 3 1993
- ralph@amissah.com
-

-
- -

the usual GPL (or OSS) suspects:
Better - "performance, reliability, scalability, security
& total cost of ownership"
[not to mention flexibility & choice]

<<Way Better!>>

- -
- - WOK - end - WOK_SQL - end - def main1 - <<-'WOK_SQL' - @tail=tail - @counter_txt_doc,@counter_txt_ocn,@counter_endn_doc,@counter_endn_ocn=0,0,0,0 - @counters_txt,@counters_endn,@sql_select_body,@sql_select_endnotes='','','','' - FCGI.each_cgi do |cgi| - begin # all code goes in begin section - @search={ :text => [],:endnotes => [] } - q=CGI.new - @db=if cgi['db'] =~/\S+/; - @stub=/SiSU_(\S+)/.match(cgi['db'])[1] - cgi['db'] - else - @stub='sisu' - 'SiSU_sisu' - end - checked_url,checked_searched,checked_tip,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,selected_db='','','','','','','','' - if cgi['view']=~/text/; checked_index,checked_text='','checked' - else checked_index,checked_text='checked','' - end - checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1 - checked_searched='checked' if cgi['searched'] =~/\S/ - checked_tip='checked' if cgi['tip'] =~/\S/ - checked_echo='checked' if cgi['echo'] =~/\S/ - checked_sql='checked' if cgi['sql'] =~/\S/ - if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1 - checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql='checked' - checked_none='' - elsif cgi['checks'] =~/check_none/ #or cgi['a'].to_i==0 - checked_none='checked' - checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql='' - else checked_ignore='checked' - end - WOK_SQL - end - def main2 - <<-'WOK_SQL' - search_field=cgi['find'] if cgi['find'] # =~/\S+/ - @search_for=Search_request.new(search_field,q) #.analyze #% search_for - #% searches - #Canned_search.new(@base,@search_for.text1,cgi) - if @search_for.text1=~/\S+/ or @search_for.author=~/\S+/ #and search_field =~/\S/ - s1='s1=' + CGI.escape(@search_for.text1) if @search_for.text1=~/\S/ - key='key=' + CGI.escape(@search_for.keywords) if @search_for.keywords=~/\S/ - ti='&ti=' + CGI.escape(@search_for.title) if @search_for.title=~/\S/ - au='&au=' + CGI.escape(@search_for.author) if @search_for.author=~/\S/ - sj='&sj=' + CGI.escape(@search_for.subject) if @search_for.subject=~/\S/ - dsc='&dsc=' + CGI.escape(@search_for.description) if @search_for.description=~/\S/ - pb='&pb=' + CGI.escape(@search_for.publisher) if @search_for.publisher=~/\S/ - cntr='&cntr=' + CGI.escape(@search_for.contributor) if @search_for.contributor=~/\S/ - dt='&dt=' + CGI.escape(@search_for.date) if @search_for.date=~/\S/ - ty='&ty=' + CGI.escape(@search_for.type) if @search_for.type=~/\S/ - id='&id=' + CGI.escape(@search_for.identifier) if @search_for.identifier=~/\S/ - src='&src=' + CGI.escape(@search_for.source) if @search_for.source=~/\S/ - lang='&lang=' + CGI.escape(@search_for.language) if @search_for.language=~/\S/ - rel='&rel=' + CGI.escape(@search_for.relation) if @search_for.relation=~/\S/ - cov='&cov=' + CGI.escape(@search_for.coverage) if @search_for.coverage=~/\S/ - cr='&cr=' + CGI.escape(@search_for.rights) if @search_for.rights=~/\S/ - co='&co=' + CGI.escape(@search_for.comment) if @search_for.comment=~/\S/ - ab='&ab=' + CGI.escape(@search_for.abstract) if @search_for.abstract=~/\S/ - dtc='&dtc=' + CGI.escape(@search_for.date_created) if @search_for.date_created=~/\S/ - dti='&dti=' + CGI.escape(@search_for.date_issued) if @search_for.date_issued=~/\S/ - dtm='&dtm=' + CGI.escape(@search_for.date_modified) if @search_for.date_modified=~/\S/ - dta='&dta=' + CGI.escape(@search_for.date_available) if @search_for.date_available=~/\S/ - dtv='&dtv=' + CGI.escape(@search_for.date_valid) if @search_for.date_valid=~/\S/ - fns='&fns=' + CGI.escape(@search_for.filename) if @search_for.filename=~/\S/ - @@canned_search_url=if checked_all =~/checked/ - "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}&a=1" - else "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}&u=1&e=1" - end - @search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1 - @search[:endnotes][1]=%{endnotes.clean~'#{@search_for.text1}'} #s1 - canned_note='previous search url:' - else - @@canned_search_url="#@base?s1=United+Nations&db=documents&view=index" - canned_note='search url example:' - end - if search_field =~/\S+/ - analyze_format=search_field.gsub(/\s*\n/,'; ') - elsif checked_all =~/checked/ or checked_url =~/checked/ - canned_search=@@canned_search_url.scan(/(?:s1|au|ti|fns)=[^&]+/) - af=canned_search.join('; ') - af.gsub!(/s1=/,'text: ') - af.gsub!(/au=/,'author: ') - af.gsub!(/ti=/,'title: ') - af.gsub!(/fns=/,'filename: ') - af.gsub!(/%2B/,' ') - analyze_format=af - st=af.split(/\s*;\s*/) - search_field=st.join("\n") - end - green=%{} - canned_search_url_txt=CGI.escapeHTML(@@canned_search_url) - the_can=%{#{canned_note}
#{canned_search_url_txt}

} - p_text=p_keywords=p_title=p_author=p_subject=p_description=p_publisher=p_contributor=p_date=p_type=p_format=p_identifier=p_source=p_language=p_relation=p_coverage=p_rights=p_comment=p_abstract=p_subject=p_filename='' - p_text=%{text: #{green}#{@search_for.text1}

} if @search_for.text1 =~/\S+/ - p_keywords=%{keywords: #{green}#{@search_for.keywords}

} if @search_for.keywords =~/\S+/ - p_title=%{title: #{green}#{@search_for.title}
} if @search_for.title =~/\S+/ - p_author=%{author: #{green}#{@search_for.author}
} if @search_for.author =~/\S+/ - p_subject=%{subject: #{green}#{@search_for.subject}
} if @search_for.subject =~/\S+/ - p_description=%{description: #{green}#{@search_for.description}
} if @search_for.description =~/\S+/ - p_publisher=%{publisher: #{green}#{@search_for.publisher}
} if @search_for.publisher =~/\S+/ - p_contributor=%{contributor: #{green}#{@search_for.contributor}
} if @search_for.contributor =~/\S+/ - p_date=%{date: #{green}#{@search_for.date}
} if @search_for.date =~/\S+/ - p_type=%{type: #{green}#{@search_for.type}
} if @search_for.type =~/\S+/ - p_format=%{format: #{green}#{@search_for.format}
} if @search_for.format =~/\S+/ - p_identifier=%{identifier: #{green}#{@search_for.identifier}
} if @search_for.identifier =~/\S+/ - p_source=%{source: #{green}#{@search_for.source}
} if @search_for.source =~/\S+/ - p_language=%{language: #{green}#{@search_for.language}
} if @search_for.language =~/\S+/ - p_relation=%{relation: #{green}#{@search_for.relation}
} if @search_for.relation =~/\S+/ - p_coverage=%{coverage: #{green}#{@search_for.coverage}
} if @search_for.coverage =~/\S+/ - p_rights=%{rights: #{green}#{@search_for.rights}
} if @search_for.rights =~/\S+/ - p_comment=%{comment: #{green}#{@search_for.comment}
} if @search_for.comment =~/\S+/ - p_abstract=%{abstract: #{green}#{@search_for.abstract}
} if @search_for.abstract =~/\S+/ - p_filename=%{filename: #{green}#{@search_for.filename}
} if @search_for.filename =~/\S+/ - search_note=<<-WOK - -
previous selection:
- database: #{green}#@db
; selected view: #{green}#{cgi['view']}
- search string: "#{green}#{analyze_format}"
- #{p_text} #{p_keywords} #{p_title} #{p_author} #{p_subject} #{p_description} #{p_publisher} #{p_contributor} #{p_date} #{p_type} #{p_format} #{p_identifier} #{p_source} #{p_language} #{p_relation} #{p_coverage} #{p_rights} #{p_comment} #{p_abstract} #{p_filename} - - WOK - #eg = %{canned search e.g.:
#{url}
find: #{analyze}
database: #{database}} - #dbi_canning - @header=Form.new(@base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can).submission_form #% form - unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/ - print "Content-type: text/html\n\n" - puts (@header+@tail) - else #% searches - s1=if @search_for.text1 =~/\S/ - @search_for.text1 - else 'Unavailable' - end - @search[:text]<<%{documents.clean~'#{CGI.unescape(s1)}'} - @search[:endnotes]<<%{endnotes.clean~'#{CGI.unescape(s1)}'} - #dbi_request - dbi_statement=Dbi_search_statement.new(@conn,@search_for,q) - @text_search_flag=false - @text_search_flag=dbi_statement.text_search_flag - s_contents=dbi_statement.contents - s_endnotes=dbi_statement.endnotes - @body_main,@endnotes=[],[] - @search_regx=nil - oldtid=0 - if @text_search_flag - if checked_sql =~/\S/ - sql_select_body=dbi_statement.sql_select_body_format - sql_select_endnotes=dbi_statement.sql_select_endnotes_format - else sql_select_body,sql_select_endnotes='','' - end - @body_main << '



Main Text:
' << sql_select_body - @endnotes << '



Endnotes:
' << sql_select_endnotes - else - end - #text_objects_body - s_contents.each do |c| #% text body - location=c['filename'][/(.+?)\.(?:_?sst|ssm)$/,1] - file_suffix=c['filename'][/.+?\.(_?sst|ssm)$/,1] - lang=if location =~ /\S+?~(\S\S\S?)$/ - l=location[/\S+?~(\S\S\S?)$/,1] - location.gsub!(/(\S+?)~\S\S\S?/,'\1') - l=".#{l}" - else '' - end - #metadata_found_body - if c['tid'].to_i != oldtid.to_i - title=%{#{c['title']} by #{c['creator']} pdf portraitpdf landscape manifest ?
} if file_suffix=~/s/ #hmm watch file_suffix - if @text_search_flag; title='

'+title - else title='
'+title - end - @counter_txt_doc+=1 - oldtid=c['tid'].to_i - else title='' - end - if @text_search_flag - if cgi['view']=~/text/ #% txt body - text=if c['suffix'] !~/1/ #seg - if @search_for.text1 =~/\S+/ or q['s1'] =~/\S+/ #% only this branch is working !! - unescaped_search=if @search_for.text1 =~/\S+/; CGI.unescape(@search_for.text1) - elsif q['s1'] =~/\S+/; CGI.unescape(q['s1']) - else nil - end - @search_regx=if unescaped_search #check - search_regex=[] - build=unescaped_search.scan(/\S+/).each do |g| - if g.to_s =~/(AND|OR)/ - search_regex << '|' - else search_regex << %{#{g.to_s}} - end - end - search_regex=search_regex.join(' ') - search_regex=search_regex.gsub(/\s*\|\s*/,'|') - search_regex.to_s - else nil - end - else nil - end - matched_para=(@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) ? (c['body'].gsub(/(#@search_regx)/,'\1')) : c['body'] #check - %{

ocn #{c['ocn']}:

#{matched_para}} - elsif c['suffix'] =~/1/ #doc - %{#{title}

ocn #{c['ocn']}:#{c['body']}} - end - @counter_txt_ocn+=1 - output=if c['seg'] =~/\S+/; title+text - else text - end - elsif cgi['view']=~/index/ #% idx body - if c['suffix'] !~/1/ #seg - index=%{#{c['ocn']}, } if @text_search_flag - elsif c['suffix'] =~/1/ #doc - index=%{#{c['ocn']}, } - end - if c['seg'] =~/\S+/ - if @text_search_flag - @counter_txt_ocn+=1 - output=title+index - end - else - @counter_txt_ocn+=1 - output=unless c['suffix'] =~/1/; title+index - else %{#{title}#{c['ocn'].sort}, } - end - end - end - else output=title - end - @counters_txt=if @counter_txt_doc > 0 - %{Found in the main body of #@counter_txt_doc documents, and at #@counter_txt_ocn locations within.
} - else '' - end - @body_main << output #+ details - end - #text_objects_endnote - oldtid = 0 - s_endnotes.each do |e| #% endnotes - location=e['filename'][/(.+?)\.(?:_?sst|ssm)$/,1] - file_suffix=e['filename'][/.+?\.(_?sst|ssm)$/,1] - lang=if location =~ /\S+?~(\S\S\S?)$/ - l=location[/\S+?~(\S\S\S?)$/,1] - location.gsub!(/(\S+?)~\S\S\S?/,'\1') - l=".#{l}" - else '' - end - #metadata_found_endnotes - if @text_search_flag - if e['metadata_tid'].to_i != oldtid.to_i - title=%{


#{e['title']} by #{e['creator']} pdf portraitpdf landscape manifest ?
} if file_suffix=~/s/ - @counter_endn_doc+=1 - oldtid=e['metadata_tid'].to_i - else title = '' - end - if cgi['view']=~/text/ #% txt endnotes - @counter_endn_ocn+=1 - matched_endnote=(@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) ? (e['body'].to_s.gsub(/(#@search_regx)/,'\1')) : e['body'] #check - output=%{#{title}
note #{e['nr']} referred to from ocn #{e['ocn']}: #{matched_endnote}} - elsif cgi['view']=~/index/ #% idx endnotes - @counter_endn_ocn+=1 - output=%{#{title}#{e['nr']}#{e['ocn']}], } - end - @counters_endn=if @counter_endn_doc > 0 - %{Found in the endnotes of #@counter_endn_doc documents, and at #@counter_endn_ocn locations within.
} - end - @endnotes << output #+ details - else @endnotes=[] #does not take out yet - end - end - offset=dbi_statement.sql_offset.to_s - limit=dbi_statement.sql_limit.to_s - canned=dbi_statement.sql_canned_search_url.to_s - limit=dbi_statement.sql_limit.to_s - cgi.out{@header + @counters_txt + @counters_endn + @body_main.join + @endnotes.join + canned + @tail} #% print cgi_output_header+counters+body+endnotes - end - rescue Exception => e - s='
' + CGI::escapeHTML(e.backtrace.reverse.join("\n"))
-          s << CGI::escapeHTML(e.message) + '
' - cgi.out{s} - next - ensure # eg. disconnect from server - @conn.disconnect if @conn - end - end - WOK_SQL - end - end -end -__END__ -#@counter_txt_ocn -#@counter_endn_ocn - - - if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1 - checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql='checked' - checked_none='' - #elsif cgi['checks'] =~/check_fixed/ or cgi['check_fixed'] =~/\S/ - # #checked_ignore='checked' - # checked_fixed='checked' - # checked_url='checked' - # checked_searched='checked' - # checked_echo='checked' - # #checked_tip='checked' - # #checked_sql='checked' - # checked_tip=checked_sql=checked_none='' - #elsif cgi['checks'] =~/check_ignore/ or cgi['check_ignore'] =~/\S/ - # checked_ignore='checked' - # checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1 - # checked_searched='checked' if cgi['searched'] =~/\S/ - # checked_tip='checked' if cgi['tip'] =~/\S/ - # checked_echo='checked' if cgi['echo'] =~/\S/ - # checked_sql='checked' if cgi['sql'] =~/\S/ - # checked_none='' - elsif cgi['checks'] =~/check_none/ or cgi['a'].to_i==0 - checked_none='checked' - checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql='' - else checked_ignore='checked' - end diff --git a/lib/sisu/0.52/cgi_sqlite.rb b/lib/sisu/0.52/cgi_sqlite.rb deleted file mode 100644 index d00237af..00000000 --- a/lib/sisu/0.52/cgi_sqlite.rb +++ /dev/null @@ -1,207 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: generates naive cgi search form for search of sisu database (pgsql sqlite) - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah mailto:ralph@amissah.com - Ralph Amissah mailto:amissah@gmail.com - -=end -module SiSU_CGI_sqlite #% database building documents - require SiSU_lib + '/sysenv' - require SiSU_lib + '/cgi_sql_common' - include SiSU_CGI_sql - class SiSU_search_sqlite < SiSU_CGI_common - def initialize(opt,webserv) - @opt,@webserv=opt,webserv - @env=SiSU_Env::Info_env.new('',opt) - @image_src="#{@env.url.webserv_cgi}/_sisu/image" - @common=SiSU_CGI_sql::SiSU_CGI_common.new(@webserv,@opt.cmd,@image_src,@env) - end - def sqlite - serve=[] - Dir.foreach(@env.path.webserv) do |x| - if x !~/^\./ and FileTest.directory?("#{@env.path.webserv}/#{x}") - if FileTest.file?("#{@env.path.webserv}/#{x}/sisu_sqlite.db"); serve << x unless x =~/^_\S+/ - end - end - end - serve.sort! - f1,f2,f3=[],[],[] - serve.each do |x| - f1 << %{ \n} - end - f2 << %{ selected_db=case cgi['db']\n} - serve.each do |x| - f2 << %{ when /SiSU_#{x}/; ''\n} - end - f2 << " end\n" - #f3 - f3 << %{ db_name='sisu_sqlite.db'\n} - f3 << %{ db_sqlite=case cgi['db']\n} - serve.each do |x| - f3 << %{ when /SiSU_#{x}/; "#{@env.path.webserv}/#{x}/sisu_sqlite.db"\n} - end - f3 << " end\n" - if FileTest.writable?('.') - output=File.open('sisu_sqlite.cgi','w') - output << header0 << header1 << header_desc << header2 << f1 << buttons1 << buttons2 << search_request << search_statement << search_statement_common << search_query1 << @common.pages << search_query2 << @common.tail << @common.main1 << f2 << f3 << dbi_connect << @common.main2 - a=%{ generated sisu_sqlite.cgi, - BASED ON ALREADY CREATED sisu_sqlite.db OUTPUT, (-d) - } - tell=SiSU_Screen::Ansi.new(@opt.cmd,a) - tell.print_grey - c=case @webserv - when /pwd/; '' - else "if necessary make the directory /usr/lib/cgi-bin : - sudo cp -vi #{Dir.pwd}/sisu_sqlite.cgi /usr/lib/cgi-bin/. - sudo chmod -v 755 /usr/lib/cgi-bin/sisu_sqlite.cgi - (copy sisu_sqlite.cgi to your cgi directory) and set file permissions to 755" - end - a=%{#{c} - #{@env.webserv_base_cgi}/cgi-bin/sisu_sqlite.cgi - } - b='(to create and populate sisu sqlite database see "man sisu" and in particular the -d flag)' - tell=SiSU_Screen::Ansi.new(@opt.cmd,a,b) - tell.warn - else puts 'failed in attempt to write sisu_sqlite.cgi to present directory, is directory writable?' - end - end - def header0 - <<-WOK_SQL -#!/usr/bin/env ruby -=begin -#{about} - * Description: generates naive cgi search form for search of sisu database (sqlite) -#{gpl} -=end - require 'cgi' - require 'fcgi' - require 'dbi' - @version='sisu_sqlite' - @image_src="#{@env.url.webserv_cgi}/_sisu/image" - @hosturl_db="#{@env.url.webserv_base_cgi}" - @hosturl_files="#{@env.url.webserv_files_from_db}" - WOK_SQL - end - def search_statement - <<-'WOK_SQL' - class Dbi_search_string - def initialize(l,t,q) - @l,@t,@q=l,t,q - end - def string - search={ :search => [] } - search[:flag]=false - if @t =~/\S+/ or @q =~/\S+/ - if @t =~/\S+/; unescaped_search=CGI.unescape(@t) - elsif @q =~/\S+/; unescaped_search=CGI.unescape(@q) - end - search_construct=[] - unescaped_search.gsub!(/\s*(AND|OR)\s*/,"%' \) \\1 #@l LIKE \( '%") - unescaped_search.gsub!(/(.+)/,"#@l LIKE \( '%\\1%' \)") - search_construct << unescaped_search - search_construct=search_construct.join(' ') - search[:search] << search_construct - search[:flag]=true - search - end - search - end - end - WOK_SQL - end - def search_query1 - <<-'WOK_SQL' - @search_text,@search_endnotes=[],[] - #% - search[:text].each{|x| @search_text << "#{x} AND " } - @search_text=@search_text.to_s.gsub!(/AND\s+$/,'') - @search_text.gsub!(/(documents\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+documents\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)') - search[:endnotes].each{|x| @search_endnotes << "#{x} AND " } - @search_endnotes=@search_endnotes.to_s.gsub!(/AND\s+$/,'') - @search_text.gsub!(/(endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)') - end - WOK_SQL - end - def search_query2 - <<-'WOK_SQL' - def sql_select_body - limit ||=@@limit - offset ||=@@offset - @sql_statement[:body]=%{SELECT metadata.title, metadata.creator, metadata.filename, metadata.suffix, documents.body, documents.seg, documents.ocn, metadata.tid FROM documents, metadata WHERE #{@search_text} AND documents.metadata_tid = metadata.tid ORDER BY metadata.title, documents.ocn} - @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;} - select=@sql_statement[:body] + ' ' + @sql_statement[:range] - select - end - def sql_select_endnotes - limit ||=@@limit - offset ||=@@offset - @sql_statement[:endnotes]= %{SELECT metadata.title, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE #{@search_endnotes} AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, endnotes.nr} - @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;} - select=@sql_statement[:endnotes] + ' ' + @sql_statement[:range] - select - end - def sql_select_body_format - %{#{sql_select_body}} - end - def sql_select_endnotes_format - %{#{sql_select_endnotes}} - end - def contents - @conn.select_all(sql_select_body) - end - def endnotes - @conn.select_all(sql_select_endnotes) - end - end - WOK_SQL - end - def dbi_connect - <<-'WOK_SQL' - @dbi="DBI:SQLite:#{db_sqlite}" #sqlite3 ? - @conn=DBI.connect(@dbi) - WOK_SQL - end - end -end -__END__ diff --git a/lib/sisu/0.52/character_encoding.rb b/lib/sisu/0.52/character_encoding.rb deleted file mode 100644 index 743eac82..00000000 --- a/lib/sisu/0.52/character_encoding.rb +++ /dev/null @@ -1,369 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: modules related to locales, character encoding for different output generators [requires kirbybase] - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_character_encode - require 'kirbybase' - require SiSU_lib + '/sysenv' - class Characters - attr_accessor(:character_encoding,:glyph,:dec,:hex,:rb,:html,:html_name,:tex,:tex_licr,:tex_alt,:name) - def initialize(&block) - instance_eval(&block) - end - end - class Create ', 62, '76', '\76', '>', '>', '', '', '', 'Greater than >' ], - ['?', 63, '77', '\77', '?', nil, '?', '?', '?', 'Punctuation Question mark ?' ], - ['@', 64, '100', '\100', '@', nil, '', '', '', 'Commercial at sign @' ], - ['A', 65, '101', '\101', 'A', nil, 'A', 'A', 'A', 'Captial A' ], - ['B', 66, '102', '\102', 'B', nil, 'B', 'B', 'B', 'Captial B' ], - ['C', 67, '103', '\103', 'C', nil, 'C', 'C', 'C', 'Captial C' ], - ['D', 68, '104', '\104', 'D', nil, 'D', 'D', 'D', 'Captial D' ], - ['E', 69, '105', '\105', 'E', nil, 'E', 'E', 'E', 'Captial E' ], - ['F', 70, '106', '\106', 'F', nil, 'F', 'F', 'F', 'Captial F' ], - ['G', 71, '107', '\107', 'G', nil, 'G', 'G', 'G', 'Captial G' ], - ['H', 72, '110', '\110', 'H', nil, 'H', 'H', 'H', 'Captial H' ], - ['I', 73, '111', '\111', 'I', nil, 'I', 'I', 'I', 'Captial I' ], - ['J', 74, '112', '\112', 'J', nil, 'J', 'J', 'J', 'Captial J' ], - ['K', 75, '113', '\113', 'K', nil, 'K', 'K', 'K', 'Captial K' ], - ['L', 76, '114', '\114', 'L', nil, 'L', 'L', 'L', 'Captial L' ], - ['M', 77, '115', '\115', 'M', nil, 'M', 'M', 'M', 'Captial M' ], - ['N', 78, '116', '\116', 'N', nil, 'N', 'N', 'N', 'Captial N' ], - ['O', 79, '117', '\117', 'O', nil, 'O', 'O', 'O', 'Captial O' ], - ['P', 80, '120', '\120', 'P', nil, 'P', 'P', 'P', 'Captial P' ], - ['Q', 81, '121', '\121', 'Q', nil, 'Q', 'Q', 'Q', 'Captial Q' ], - ['R', 82, '122', '\122', 'R', nil, 'R', 'R', 'R', 'Captial R' ], - ['S', 83, '123', '\123', 'S', nil, 'S', 'S', 'S', 'Captial S' ], - ['T', 84, '124', '\124', 'T', nil, 'T', 'T', 'T', 'Captial T' ], - ['U', 85, '125', '\125', 'U', nil, 'U', 'U', 'U', 'Captial U' ], - ['V', 86, '126', '\126', 'V', nil, 'V', 'V', 'V', 'Captial V' ], - ['W', 87, '127', '\127', 'W', nil, 'W', 'W', 'W', 'Captial W' ], - ['X', 88, '130', '\130', 'X', nil, 'X', 'X', 'X', 'Captial X' ], - ['Y', 89, '131', '\131', 'Y', nil, 'Y', 'Y', 'Y', 'Captial Y' ], - ['Z', 90, '132', '\132', 'Z', nil, 'Z', 'Z', 'Z', 'Captial Z' ], - ['[', 91, '133', '\133', '[', nil, '', '', '', 'Left square bracket [' ], - ['\\', 92, '134', '\134', '\', nil, '', '\textbackslash', '', 'Backslash \\'], - [']', 93, '135', '\135', ']', nil, '', '', '', 'Right square bracket ]' ], - ['^', 94, '136', '\136', '^', nil, '', '', '', 'Caret ^' ], - ['_', 95, '137', '\137', '_', nil, '{\_}', '\textunderscore', '', 'Underscore _' ], - ['`', 96, '140', '\140', '`', nil, '', '', '', 'Grave accent `' ], - ['a', 97, '141', '\141', 'a', nil, 'a', 'a', 'a', 'Small a' ], - ['b', 98, '142', '\142', 'b', nil, 'b', 'b', 'b', 'Small b' ], - ['c', 99, '143', '\143', 'c', nil, 'c', 'c', 'c', 'Small c' ], - ['d', 100, '144', '\144', 'd', nil, 'd', 'd', 'd', 'Small d' ], - ['e', 101, '145', '\145', 'e', nil, 'e', 'e', 'e', 'Small e' ], - ['f', 102, '146', '\146', 'f', nil, 'f', 'f', 'f', 'Small f' ], - ['g', 103, '147', '\147', 'g', nil, 'g', 'g', 'g', 'Small g' ], - ['h', 104, '150', '\150', 'h', nil, 'h', 'h', 'h', 'Small h' ], - ['i', 105, '151', '\151', 'i', nil, 'i', 'i', 'i', 'Small i' ], - ['j', 106, '152', '\152', 'j', nil, 'j', 'j', 'j', 'Small j' ], - ['k', 107, '153', '\153', 'k', nil, 'k', 'k', 'k', 'Small k' ], - ['l', 108, '154', '\154', 'l', nil, 'l', 'l', 'l', 'Small l' ], - ['m', 109, '155', '\155', 'm', nil, 'm', 'm', 'm', 'Small m' ], - ['n', 110, '156', '\156', 'n', nil, 'n', 'n', 'n', 'Small n' ], - ['o', 111, '157', '\157', 'o', nil, 'o', 'o', 'o', 'Small o' ], - ['p', 112, '160', '\160', 'p', nil, 'p', 'p', 'p', 'Small p' ], - ['q', 113, '161', '\161', 'q', nil, 'q', 'q', 'q', 'Small q' ], - ['r', 114, '162', '\162', 'r', nil, 'r', 'r', 'r', 'Small r' ], - ['s', 115, '163', '\163', 's', nil, 's', 's', 's', 'Small s' ], - ['t', 116, '164', '\164', 't', nil, 't', 't', 't', 'Small t' ], - ['u', 117, '165', '\165', 'u', nil, 'u', 'u', 'u', 'Small u' ], - ['v', 118, '166', '\166', 'v', nil, 'v', 'v', 'v', 'Small v' ], - ['w', 119, '167', '\167', 'w', nil, 'w', 'w', 'w', 'Small w' ], - ['x', 120, '170', '\170', 'x', nil, 'x', 'x', 'x', 'Small x' ], - ['y', 121, '171', '\171', 'y', nil, 'y', 'y', 'y', 'Small y' ], - ['z', 122, '172', '\172', 'z', nil, 'z', 'z', 'z', 'Small z' ], - ['{', 123, '173', '\173', '{', nil, '{\{}', '\{', '', 'Left curly brace {' ], - ['|', 124, '174', '\174', '|', nil, '', '', '', 'Vertical bar / pipe |' ], - ['}', 125, '175', '\175', '}', nil, '{\}}', '\}', '', 'Right curly brace }' ], - ['~', 126, '176', '\176', '~', nil, '', '', '', 'Tilde ~' ], - ['', 127, '177', '', '', nil, '', '', '', ' ' ], - ['', 128, '200', '', '€', nil, '', '', '', ' ' ], - ['', 129, '201', '', '', nil, '', '', '', ' ' ], - ['\'', 130, '202', '', '‚', nil, '', '', '', 'Low left single quote \''], - [' ', 131, '203', '', 'ƒ', nil, '', '', '', 'Florin ' ], - ['"', 132, '204', '', '„', nil, '', '', '', 'Low left double quote "' ], - ['…', 133, '205', '\342\200\246', '…', nil, '…', '\textellipsis', '', 'Ellipsis …' ], - ['†', 134, '206', '\342\200\240', '†', nil, '†', '\textdagger', '', 'Dagger †' ], - ['‡', 135, '207', '\342\200\241', '‡', nil, '‡', '\textdaggerbl', '', 'Double dagger ‡' ], - ['^', 136, '210', '', 'ˆ', nil, '', '', '', 'Circumflex ^' ], - ['', 137, '211', '', '‰', nil, '', '', '', 'Permil ' ], - ['', 138, '212', '', 'Š', nil, '', '', '', 'Capital S, caron ' ], - ['<', 139, '213', '', '‹', nil, '', '', '', 'Less than sign (see &060;) <' ], - ['', 140, '214', '', 'Œ', nil, '', '', '', 'Capital OE ligature ' ], - ['', 141, '215', '', '', nil, '', '', '', ' ' ], - ['', 142, '216', '', 'Ž', nil, '', '', '', 'Capital Z, caron ' ], - ['', 143, '217', '', '', nil, '', '', '', ' ' ], - ['', 144, '220', '', '', nil, '', '', '', ' ' ], - ['', 145, '221', '', '‘', nil, '', '', '', 'Left single quote ' ], - ['', 146, '222', '', '’', nil, '', '', '', 'Right single quote ' ], - ['', 147, '223', '', '“', nil, '', '', '', 'Left double quote ' ], - ['', 148, '224', '', '”', nil, '', '', '', 'Right double quote ' ], - ['', 149, '225', '', '•', nil, '', '', '', 'Bullet ' ], - ['-', 150, '226', '', '–', nil, '', '', '', 'En dash -' ], - ['', 151, '227', '', '—', nil, '', '', '', 'Em dash -' ], - ['~', 152, '230', '', '˜', nil, '', '', '', 'Tilde (see &126;) ~' ], - ['t', 153, '231', '', '™', nil, '', '', '', 'Trademark t' ], - ['', 154, '232', '', 'š', nil, '', '', '', 'small s, caron ' ], - ['', 155, '233', '', '›', nil, '', '', '', 'Greater than sign (see &062;) ' ], - ['', 156, '234', '', 'œ', nil, '', '', '', 'Small oe ligature ' ], - ['', 157, '235', '', '', nil, '', '', '', ' ' ], - ['', 158, '236', '', 'ž', nil, '', '', '', 'Small z, caron ' ], - ['', 159, '237', '', 'Ÿ', nil, '', '', '', 'Capital Y, umlaut ' ], - ['', 160, '240', '', ' ', ' ', '', '', '', 'Non-breaking space ' ], - ['¡', 161, '241', '\302\241', '¡', '¡', '¡', '', '', 'Inverted exclamation ' ], - ['¢', 162, '242', '\302\242', '¢', '¢', '¢', '', '', 'Cent sign ¢' ], - ['£', 163, '243', '\302\243', '£', '£', '£', '\textsterling', '', 'Pound sign £' ], - ['¤', 164, '244', '\302\244', '¤', '¤', '¤', '\textcurrency', '', 'General currency sign ' ], - ['¥', 165, '245', '\302\245', '¥', '¥', '¥', '', '', 'Yen sign ¥' ], - ['¦', 166, '246', '\302\246', '¦', '¦', '¦', '', '', 'Broken vertical bar ' ], - ['§', 167, '247', '\302\247', '§', '§', '§', '\textsection', '', 'Section sign §' ], - ['¨', 168, '250', '\302\250', '¨', '¨', '¨', '\"', '', 'Umlaut ' ], - ['©', 169, '251', '\302\251', '©', '©', '©', '\copyright', '\textcopyright', 'Copyright ©' ], - ['ª', 170, '252', '\302\252', 'ª', 'ª', 'ª', '', '', 'Feminine ordinal ª' ], - ['«', 171, '253', '\302\253', '«', '«', '«', '', '', 'Left angle quote «' ], - ['¬', 172, '254', '\302\254', '¬', '¬', '¬', '', '', 'Not sign ' ], - ['­', 173, '255', '\302\255', '­', '­', '­', '', '', 'Soft hyphen ' ], - ['®', 174, '256', '\302\256', '®', '®', '®', '', '', 'Registered trademark ®' ], - ['¯', 175, '257', '\302\257', '¯', '¯', '¯', '', '', 'Macron accent ' ], - ['°', 176, '260', '\302\260', '°', '°', '°', '', '', 'Degree sign °' ], - ['±', 177, '261', '\302\261', '±', '&plusmin;', '±', '', '', 'Plus or minus ±' ], - ['²', 178, '262', '\302\262', '²', '²', '²', '', '', 'Superscript 2 ²' ], - ['³', 179, '263', '\302\263', '³', '³', '³', '', '', 'Superscript 3 ³' ], - ['', 180, '264', '\302\264', '´', '´', ''', '', '', 'Acute accent ' ], - ['µ', 181, '265', '\302\265', 'µ', 'µ', 'µ', '', '', 'Micro sign (Greek mu) µ' ], - ['¶', 182, '266', '\302\266', '¶', '¶', '¶', '\textparagraph', '', 'Paragraph sign ¶' ], - ['·', 183, '267', '\302\267', '·', '·', %q{·}, '', %q{}, 'Middle dot ' ], - ['¸', 184, '270', '\302\270', '¸', '¸', '¸', '', '', 'Cedilla ' ], - ['¹', 185, '271', '\302\271', '¹', '¹', '¹', '', '', 'Superscript 1 ¹' ], - ['º', 186, '272', '\302\272', 'º', 'º', 'º', '', '', 'Masculine ordinal º' ], - ['»', 187, '273', '\302\273', '»', '»', '»', '', '', 'Right angle quote ' ], - ['¼', 188, '274', '\302\274', '¼', '¼', '¼', '', '', 'Fraction one quarter ¼' ], - ['½', 189, '275', '\302\275', '½', '½', '½', '', '', 'Fraction on half ½' ], - ['¾', 190, '276', '\302\276', '¾', '¾', '¾', '', '', 'Fraction three quarters ¾' ], - ['¿', 191, '277', '\302\277', '¿', '¿', '¿', '', '', 'Inverted question mark ¿' ], - ['À', 192, '300', '\303\200', 'À', 'À', 'À', '\`{A}', '', 'Capital A, grave accent À' ], - ['Á', 193, '301', '\303\201', 'Á', 'Á', 'Á', %q{\'{A}}, '', 'Capital A, acute accent Á' ], - ['Â', 194, '302', '\303\202', 'Â', 'Â', 'Â', '^{A}', '', 'Capital A, circumflex accent Â' ], - ['Ã', 195, '303', '\303\203', 'Ã', 'Ã', 'Ã', '~{A}', '', 'Capital A, tilde Ã' ], - ['Ä', 196, '304', '\303\204', 'Ä', 'Ä', 'Ä', '"{A}', '', 'Capital A, umlaut Ä' ], - ['Å', 197, '305', '\303\205', 'Å', 'Å', 'Å', 'r{A}', '', 'Capital A, ring Å' ], - ['Æ', 198, '306', '\303\206', 'Æ', 'Æ', 'Æ', 'AE', '', 'Capital AE ligature Æ' ], - ['Ç', 199, '307', '\303\207', 'Ç', 'Ç', 'Ç', '', '', 'Capital C, cedilla Ç' ], - ['È', 200, '310', '\303\210', 'È', 'È', 'È', '`{E}', '', 'Capital E, grave accent È' ], - ['É', 201, '311', '\303\211', 'É', 'É', 'É', ''{E}', '', 'Capital E, acute accent É' ], - ['Ê', 202, '312', '\303\212', 'Ê', 'Ê', 'Ê', '^{E}', '', 'Capital E, circumflex accent Ê' ], - ['Ë', 203, '313', '\303\213', 'Ë', 'Ë', 'Ë', '"{E}', '', 'Capital E, umlaut Ë' ], - ['Ì', 204, '314', '\303\214', 'Ì', 'Ì', 'Ì', '`{I}', '', 'Capital I, grave accent Ì' ], - ['Í', 205, '315', '\303\215', 'Í', 'Í', 'Í', ''{I}', '', 'Capital I, acute accent Í' ], - ['Î', 206, '316', '\303\216', 'Î', 'Î', 'Î', '^{I}', '', 'Capital I, circumflex accent Î' ], - ['Ï', 207, '317', '\303\217', 'Ï', 'Ï', 'Ï', '"{I}', '', 'Capital I, umlaut Ï' ], - ['Ð', 208, '320', '\303\220', 'Ð', 'Ð', 'Ð', '', '', 'Capital eth, Icelandic ' ], - ['Ñ', 209, '321', '\303\221', 'Ñ', 'Ñ', 'Ñ', '', '', 'Capital N, tilde Ñ' ], - ['Ò', 210, '322', '\303\222', 'Ò', 'Ò', 'Ò', '`{O}', '', 'Capital O, grave accent Ò' ], - ['Ó', 211, '323', '\303\223', 'Ó', 'Ó', 'Ó', ''{O}', '', 'Capital O, acute accent Ó' ], - ['Ô', 212, '324', '\303\224', 'Ô', 'Ô', 'Ô', '^{O}', '', 'Capital O, circumflex accent Ô' ], - ['Õ', 213, '325', '\303\225', 'Õ', 'Õ', 'Õ', '~{O}', '', 'Capital O, tilde Õ' ], - ['Ö', 214, '326', '\303\226', 'Ö', 'Ö', 'Ö', '"{O}', '', 'Capital O, umlaut Ö' ], - ['×', 215, '327', '\303\227', '×', '×', '×', '', '', 'Multiply sign ×' ], - ['Ø', 216, '330', '\303\230', 'Ø', 'Ø', 'Ø', 'O', '', 'Capital O, slash Ø' ], - ['Ù', 217, '331', '\303\231', 'Ù', 'Ù', 'Ù', '', '', 'Capital U, grave accent Ù' ], - ['Ú', 218, '332', '\303\232', 'Ú', 'Ú', 'Ú', '', '', 'Capital U, acute accent Ú' ], - ['Û', 219, '333', '\303\233', 'Û', 'Û', 'Û', '', '', 'Capital U, circumflex accent Û' ], - ['Ü', 220, '334', '\303\234', 'Ü', 'Ü', 'Ü', '', '', 'Capital U, umlaut Ü' ], - ['Ý', 221, '335', '\303\235', 'Ý', 'Ý', 'Ý', '', '', 'Capital Y, acute accent Ý' ], - ['Þ', 222, '336', '\303\236', 'Þ', 'Þ', 'Þ', '', '', 'Capital thorn, Icelandic Þ' ], - ['ß', 223, '337', '\303\237', 'ß', 'ß', 'ß', '', '', 'Small sz ligature, German ß' ], - ['à', 224, '340', '\303\240', 'à', 'à', 'à', '\`{a}', '', 'Small a, grave accent à' ], - ['á', 225, '341', '\303\241', 'á', 'á', 'á', %q{\'{a}}, '', 'Small a, acute accent á' ], - ['â', 226, '342', '\303\242', 'â', 'â', 'â', '\^{a}', '', 'Small a, circumflex accent â' ], - ['ã', 227, '343', '\303\243', 'ã', 'ã', 'ã', '\~{a}', '', 'Small a, tilde ã' ], - ['ä', 228, '344', '\303\244', 'ä', 'ä', 'ä', '\"{a}', '', 'Small a, umlaut ä' ], - ['å', 229, '345', '\303\245', 'å', 'å', 'å', '\r{a}', '', 'Small a, ring å' ], - ['æ', 230, '346', '\303\246', 'æ', 'æ', 'æ', '\ae', '', 'Small ae ligature æ' ], - ['ç', 231, '347', '\303\257', 'ç', 'ç', 'ç', '', '', 'Small c, cedilla ç' ], - ['è', 232, '350', '\303\250', 'è', 'è', 'è', '\`{e}', '', 'Small e, grave accent è' ], - ['é', 233, '351', '\303\251', 'é', 'é', 'é', %q{\'{e}}, '', 'Small e, acute accent é' ], - ['ê', 234, '352', '\303\252', 'ê', 'ê', 'ê', '\^{e}', '', 'Small e, circumflex accent ê' ], - ['ë', 235, '353', '\303\253', 'ë', 'ë', 'ë', '\"{e}', '', 'Small e, umlaut ë' ], - ['ì', 236, '354', '\303\254', 'ì', 'ì', 'ì', '\`{i}', '', 'Small i, grave accent ì' ], - ['í', 237, '355', '\303\255', 'í', 'í', 'í', '\'{i}', '', 'Small i, acute accent í' ], - ['î', 238, '356', '\303\256', 'î', 'î', 'î', '\^{i}', '', 'Small i, circumflex accent î' ], - ['ï', 239, '357', '\303\257', 'ï', 'ï', 'ï', '\"{i}', '', 'Small i, umlaut ï' ], - ['ð', 240, '360', '\303\260', 'ð', 'ð', 'ð', '', '', 'Small eth, Icelandic ð' ], - ['ñ', 241, '361', '\303\261', 'ñ', 'ñ', 'ñ', '', '', 'Small n, tilde ñ' ], - ['ò', 242, '362', '\303\262', 'ò', 'ò', 'ò', '\`{o}', '', 'Small o, grave accent ò' ], - ['ó', 243, '363', '\303\263', 'ó', 'ó', 'ó', %q{\'{o}}, '', 'Small o, acute accent ó' ], - ['ô', 244, '364', '\303\264', 'ô', 'ô', 'ô', '\^{o}', '', 'Small o, circumflex accent ô' ], - ['õ', 245, '365', '\303\265', 'õ', 'õ', 'õ', '\^{o}', '', 'Small o, tilde õ' ], - ['ö', 246, '366', '\303\266', 'ö', 'ö', 'ö', '\"{o}', '', 'Small o, umlaut ö' ], - ['÷', 247, '367', '\303\267', '÷', '÷', '÷', '', '', 'Divide sign ÷' ], - ['ø', 248, '370', '\303\270', 'ø', 'ø', 'ø', '', '', 'Small o, slash ø' ], - ['ù', 249, '371', '\303\271', 'ù', 'ù', 'ù', '\`{u}', '', 'Small u, grave accent ù' ], - ['ú', 250, '372', '\303\272', 'ú', 'ú', 'ú', %q{\'{u}}, '', 'Small u, acute accent ú' ], - ['û', 251, '373', '\303\273', 'û', 'û', 'û', '\^{u}', '', 'Small u, circumflex accent û' ], - ['ü', 252, '374', '\303\274', 'ü', 'ü', 'ü', '\"{u}', '', 'Small u, umlaut ü' ], - ['ý', 253, '375', '\303\275', 'ý', 'ý', 'ý', '', '', 'Small y, acute accent ý' ], - ['þ', 254, '376', '\303\276', 'þ', 'þ', 'þ', '', '', 'Small thorn, Icelandic þ' ], - ['ÿ', 255, '377', '\303\277', 'ÿ', 'ÿ', 'ÿ', '', '', 'Smally y, umlaut ÿ' ] -] - end - end -end -__END__ diff --git a/lib/sisu/0.52/composite.rb b/lib/sisu/0.52/composite.rb deleted file mode 100644 index 99069b8f..00000000 --- a/lib/sisu/0.52/composite.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: composite documents, assemble/build documents from other documents or parts of marked up text - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_Assemble - require SiSU_lib + '/sysenv' - class Remote_image - def initialize - @env=SiSU_Env::Info_env.new - end - def image(dir) - images=[] - images[0]=dir - images - end - def download_images(images_array) #first element in array is source url - path="#{@env.path.processing}/external_document/image" - File.mkpath(path) unless FileTest.directory?(path) - download_from=images_array.shift - images_array.each do |i| - image="#{path}/#{i}" - #unless FileTest.exists?(image) - imagefile=File.new(image,'w+') - open("#{download_from}/#{i}") do |g| - imagefile << g.read - end - imagefile.close - #end - end - end - def download_doc_skin(doc_skin) #first element in array is source url - path="#{@env.path.processing}/external_document/skin/doc" - File.mkpath(path) unless FileTest.directory?(path) - download_from=doc_skin.shift - doc_skin.each do |i| - skin="#{path}/#{i}.rb" - unless FileTest.exists?(skin) - skinfile=File.new(skin,'w+') - open("#{download_from}/#{i}.rb") do |g| - skinfile << g.read - end - skinfile.close - end - end - end - end - class Composite - @@imager={} - def initialize(opt) - @opt=opt - @env=SiSU_Env::Info_env.new - end - def read - begin - @fns_array=IO.readlines(@opt.fns,'') - assembled=insertions? - write(assembled) - rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error - ensure - end - end - def write(assembled) - m=/(.+)?(\.ssm$)/m - assembled_file=File.new("#{@opt.fnb}._sst",'w+') - assembled.each{|a| assembled_file << a } - assembled_file.close - end - def download_images(download_from,images_array) - path="#{@env.path.processing}/external_document/image" - File.mkpath(path) unless FileTest.directory?(path) - images_array.each do |i| - image="#{path}/#{i}" - unless FileTest.exists?(image) - imagefile=File.new(image,'w+') - open("#{download_from}/#{i}") do |g| - imagefile << g.read - end - imagefile.close - end - end - end - def download_doc_skin(doc_skin) #first element in array is source url - path="#{@env.path.processing}/external_document/skin/doc" - File.mkpath(path) unless FileTest.directory?(path) - download_from=doc_skin.shift - doc_skin.each do |i| - skin="#{path}/#{i}.rb" - unless FileTest.exists?(skin) - skinfile=File.new(skin,'w+') - open("#{download_from}/#{i}.rb") do |g| - skinfile << g.read - end - skinfile.close - end - end - end - def insertion(fni,insert_array) - file={ :prepared=>[],:images=>[] } - rgx_image=/([a-zA-Z0-9._-]+?\.(?:png|jpg|gif))/ - #file[:prepared] << "#% Date " << "\n" - file[:prepared] << "\n% |#{fni}|@|^|>>ok\n" - insert_array.each do |i| - i.gsub!(/^([12]|:?[AB])~\? /,'% [conditional heading:] \1~ ') #off conditional heading (consider syntax) - if i =~/^0~|^@\S+?:/ - i.gsub!(/\n/m,"\n% ") - i.gsub!(/\n%\s+$/m,'') - i.gsub!(/^0~|^@\S+?:/m,"\n% [imported header:] ") #off imported headers - end - file[:prepared] << i - file[:images] << i.scan(rgx_image).uniq if i =~rgx_image #flag - end - file[:prepared] << "\n% end import" << "\n\n" - file[:images].uniq! if file[:images].length > 0 - file[:images].flatten! if file[:images].length > 0 - file - end - def insertions? - data=@fns_array - tuned_file,imagedir=[],[] - tell=SiSU_Screen::Ansi.new(@opt.cmd,'Composite Document',@opt.fns) - tell.grey_title_hi unless @opt.cmd =~/q/ - para=data.each do |para| - if para =~/^r\{(.+?)\}/ \ - or para =~/^(?:<<\s*)\{(.+?)\}(?:req(?:quire)?\b|\s*\})?/ \ - or para =~/^(?:<<\s*)\|(\S+?)\|@\|.+?\|(?:req(?:quire)?\b|\s*\})?/ \ - or para =~/^(?:<<\s*)<(?:URL|url):(\S+?)>(?:req(?:require)\b|\s*\})?/ \ - or para =~/^\{(.+?)\}(?:req(?:require)?)\b/ \ - or para =~/^\|(\S+?)\|@\|.+?\|(?:req(?:require)?)\b/ \ - or para =~/^<(?:URL|url):(\S+?)>(?:req(?:require))\b/ - loadfile=$1.strip - tell=SiSU_Screen::Ansi.new(@opt.cmd,'loading:',loadfile) - tell.txt_grey if @opt.cmd =~/[MVv]/ - tuned_file << if loadfile =~ /http:\/\/\S+?\.ss[ti]$/ # and NetTest - imagedir = /(http:\/\/\S+?)\/[^\/]+?\.ss[ti]$/.match(loadfile).captures.join + '/_sisu/image' #watch - require 'uri' - image_uri=URI.parse(imagedir) - require 'open-uri' - require 'pp' - insert=open(loadfile) - insert_array=insert.dup - insert.close - file=insertion(loadfile,insert_array) - @@imager[image_uri] ||=[] - @@imager[image_uri] << file[:images] - file[:prepared] - elsif loadfile =~ /\.ss[ti]$/ and FileTest.file?(loadfile) - insert_array=IO.readlines(loadfile,'') - file=insertion(loadfile,insert_array) - file[:prepared] - else - cX=SiSU_Screen::Ansi.new(@opt.cmd).cX - puts "\t #{cX.fuschia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuschia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" - para - end - else tuned_file << para - end - tuned_file.compact! - end - if @@imager.length >0 - @@imager.each do |d,i| - i.flatten! - i.uniq! - download_images(d,i) - end - end - tuned_file - end - end -end -__END__ - diff --git a/lib/sisu/0.52/concordance.rb b/lib/sisu/0.52/concordance.rb deleted file mode 100644 index 5f251830..00000000 --- a/lib/sisu/0.52/concordance.rb +++ /dev/null @@ -1,311 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: concordance file (html concordance, wordmap, linked index of words in document) - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_Concordance - require SiSU_lib + '/param' - require SiSU_lib + '/sysenv' - require SiSU_lib + '/defaults' - require SiSU_lib + '/dal' - include SiSU_Param - include SiSU_Env - include SiSU_Viz - require SiSU_lib + '/html_format_css' - include SiSU_HTML_Format - class Source - def initialize(opt) - @opt=opt - end - def read - begin - @md=SiSU_Param::Parameters.new(@opt).get - @env=SiSU_Env::Info_env.new(@md.fns) - loc=@env.url.output_tell - tool=if @md.cmd =~/[MVv]/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:concordance]}" - else '' - end - tell=SiSU_Screen::Ansi.new(@md.cmd,"Concordance",tool) - tell.grey_title_hi unless @md.cmd =~/q/ - wordmax=200000 - unless @md.wc_words.nil? - if @md.wc_words < wordmax - SiSU_Concordance::Source::Words.new(@md).songsheet - else - tell=SiSU_Screen::Ansi.new(@md.cmd,"concordance skipped, large document has over #{wordmax} words (#{@md.wc_words})") - tell.warn unless @md.cmd =~/q/ - end - else - tell=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") - tell.warn unless @md.cmd =~/q/ - SiSU_Concordance::Source::Words.new(@md).songsheet - end - rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error - ensure - end - end - private - class Doc_title - require SiSU_lib + '/param' - include SiSU_Param - include SiSU_Viz - def initialize(lnk,md) - @md=md - @vz=SiSU_Env::Get_init.instance.skin - file_array=IO.readlines(@md.fns,'') - txt_path=%{#{@md.dir_out}} - SiSU_Env::Info_skin.new(@md).select - @md_title=@md.title - @fnb=@md.fnb - @env=SiSU_Env::Info_env.new - @lex_button=%{SiSU home -->} - @lnk=lnk - @doc_details =<
 

Manifest #{@md.title}

            TOC TOC - table of contents for individual articles

            Full Text Full text (with indexed table of contents)

            PDF portrait pdf version of the document (portrait)

            PDF landscape pdf version of the document (landscape)

Word index links are to html versions of the text the segmented version followed by the scroll (single document) version.
[For segmented text references [T1], [T2] or [T3] appearing without a link, indicates that the word appears in a title (or subtitle) of the text (that is identifiable by the appended object citation number).]

-WOK - end - def create - < - - - - SiSU created WordIndex for: #{@md.dc_title} - - - - - - - - - #{@vz.js_head} - - - #{@vz.js_top} - - - -
- #{@vz.banner_home_button_only} - - #{@env.widget_static.search_form} -
- #@doc_details

(The word listing/index is Case sensitive: Capitalized words appear before lower case)

-

- word (number of occurences)
linked references to word within document
- [if number of occurences exceed number of references - word occurs more than once in at least one reference. Footnote/endnotes are either assigned to the paragraph from which they are referenced or ignored, so it is relevant to check the footnotes referenced from within a paragraph as well.] -

-

- (After the page is fully loaded) you can jump directly to a word by appending a hash (#) and the word to the url for this text, (do not forget that words are case sensitive, and may be listed twice (starting with and without an upper case letter)), #your_word # [ http://[web host]/#@fnb/concordance.html#your_word ] -

-WOK - end - end - class Word - @@word_previous='' - def initialize(word,freq) - @word,@freq=word,freq - end - def html - w=if @word.capitalize==@@word_previous - %{\n

#@word

(#@freq)

\n\t

} - else n=@word.strip.gsub(/\s+/,'_') #also need to convert extended character set to html - %{\n

#@word

(#@freq)

\n\t

} - end - @@word_previous=@word.capitalize - w - end - end - class Words - require SiSU_lib + '/defaults' - require SiSU_lib + '/param' - include SiSU_Viz - include SiSU_Param - require SiSU_lib + '/html_format_css' - include SiSU_HTML_Format - require SiSU_lib + '/vocab' - require SiSU_lib + '/sysenv' - include SiSU_Screen - include Wordlists - @@dp=nil - def initialize(md) - begin - @vz=SiSU_Env::Get_init.instance.skin - @md=md - @env=SiSU_Env::Info_env.new(@md.fns) - @path="#{@env.path.output}/#{@md.fnb}" - @dal_array=SiSU_DAL::Source.new(@md).get # dal file drawn here - @freq=Hash.new(0) - @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern - @rxp_to=Regexp.new("<~(\\d+);(?:[oh]|[0-6]:)\\d+;\\w\\d+><#@dp:#@dp>$") - @rxp_lv1=Regexp.new('^1~') #line start markers removed, ('^1~') for exceptions \n\n4{{{ - @rxp_lv2=Regexp.new('^2~') - @rxp_lv3=Regexp.new('^3~') - @rxp_seg=Regexp.new('^4~(.+?)\s+') - @rxp_title=Regexp.new('^0~title\s*(.+?)\s*$') - @rxp_t1=Regexp.new('^T1') - @rxp_t2=Regexp.new('^T2') - @rxp_t3=Regexp.new('^T3') - @rxp_excluded1=Regexp.new(/(?:https?|ftp):\/\/\S+/mi) - @rxp_excluded0=Regexp.new(/^(?:to\d+|\d+| \s*| |EOF|thumb_\S+|snap_\S+|_+|-+|\S+?_\S+|[\d_]+\w\S+|[\w\d]{1,2}|\d{1,3}\w?|ii|iii|iv|vi|vii|viii|ix|xi|xii|xiii|xiv|xv|xvi|xvii|xviii|xix|xx|#@dp|[0-9a-f]{24,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\.?)$/mi) - rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error - end - end - def songsheet - begin - File.mkpath(@path) unless FileTest.directory?(@path) - @file_index_all=File.open("#@path/#{@md.fn[:concordance]}",'w') - map_para - rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error - ensure - @file_index_all.close - end - end - protected - def location_scroll(wordlocation,show) - @wordlocation=wordlocation - %{#@wordlocation; } - end - def location_seg(wordlocation,show) - @wordlocation,@show=wordlocation,show - @sfx='.html' #used for hardlinks, previous setting @sfx='', web server takes care of suffix - @word_location_seg=wordlocation.gsub(/(.+?)\#(\d+)/,"#{@md.fnl[:pre]}\\1#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}#\\2") unless wordlocation.nil? - case @wordlocation - when @rxp_t1 - %{[H]#@show, } - when @rxp_t2 - %{[H]#@show, } - when @rxp_t3 - %{[H]#@show, } - else %{#@show, } - end - end - def map_para - @seg,toy=nil,nil - @word_map={} - wordlist=Wordlists::Lists.new - lesser,greater,scanlist,special=wordlist.lesser,wordlist.greater,wordlist.scanlist,wordlist.special - #lesser,greater,scanlist=wordlist.lesser,wordlist.greater,wordlist.scanlist - @dal_array.each do |line| - if line !~/<~(\d+);[um]\d+;\w\d+><#@dp:#@dp>$/ # lines to ignore: # are added but not part of authors substantive text; 0 are mostly machine generated - if line =~/^0~vocabulary\s+(.+)/ - vocab=$1 - unless vocab =~/none/ - load SiSU_lib + "/vocab_#{vocab}.rb" - lesser,greater,scanlist=wordlist.lesser,wordlist.greater,wordlist.scanlist - #special=wordlist.special ##KEEP did two loops - tell=SiSU_Screen::Ansi.new(@md.cmd,"\tloaded vocabulary: #{vocab}") - tell.puts_grey unless @md.cmd =~/q/ #check - end - end - if line =~@rxp_seg; @seg=line[@rxp_seg,1] - end - if line =~@rxp_to; toy=line[@rxp_to,1] - end - if toy =~/\d+/ and toy !~/^0$/ - for word in line.scan(scanlist) #%take in word or other match - #for word in line.scan(special) #%take in word or other match #KEEP was second loop - word=nil if word =~@rxp_excluded0 #watch - word=nil if word =~@rxp_excluded1 #watch - if word - #word.gsub!(/<\/?[i]>/,'') - word.gsub!(/<\/?\S+?>/,'') - word.strip! - word.gsub!(/[\.,;:"]$/,'') - word.gsub!(/["]/,'') - word.gsub!(/^\s*[\(]/,'') - word.gsub!(/[\(]\s*$/,'') - word.gsub!(/^(?:See|e\.?g\.?).+/,'') - word.gsub!(/^\s*[.,;:]\s*/,'') - word.strip! - word.gsub!(/^\d+(st|nd|rd|th)$/,'') - word.gsub!(/^(\d+\.?)+$/, '') - word = nil if word =~/^\s*$/ #watch - if word - word.capitalize! unless word =~/[A-Z][A-Z]/ or word =~/\w+\s\w+/ - #word.downcase! if word =~lesser - #word.capitalize! if word =~greater - @freq[word] +=1 - @word_map[word] ||= [] - if line !~@rxp_lv1 and line !~@rxp_lv2 and line !~@rxp_lv3 - @word_map[word] << location_seg("#@seg\##{toy}",toy) - else - @word_map[word] << case line - when @rxp_lv1; location_seg('T1',toy) - when @rxp_lv2; location_seg('T2',toy) - when @rxp_lv3; location_seg('T3',toy) - end - end - end - end - end - end - end - end - scr='Full Text scroll: doc#  ' - seg='' - @file_index_all << SiSU_Concordance::Source::Doc_title.new('toc',@md).create - for word in @freq.keys.sort! {|a,b| a.downcase<=>b.downcase} - keyword=SiSU_Concordance::Source::Word.new(word,@freq[word]).html - if keyword !~ @rxp_excluded0 - if @word_map[word][0] =~ /\d+/ - wm=[] - @file_index_all << %{#{keyword}#{seg}#{@word_map[word].uniq.compact}} - end - @file_index_all << '

' - end - # special cases endnotes and header levels 1 - 3 - end - credits=@vz.credits_splash - @file_index_all << "#{credits}\n" # footer - tell=SiSU_Screen::Ansi.new(@md.cmd,@md.fns,"#{@env.path.output_tell}/#{@md.fn[:concordance]}") - tell.flow if @md.cmd =~/[MV]/ - end - end - end -end -__END__ diff --git a/lib/sisu/0.52/conf.rb b/lib/sisu/0.52/conf.rb deleted file mode 100644 index 192ffe2f..00000000 --- a/lib/sisu/0.52/conf.rb +++ /dev/null @@ -1,245 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: configuration - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_Initialize - require SiSU_lib + '/sysenv' - include SiSU_Env - include SiSU_Screen - require SiSU_lib + '/relaxng' - include SiSU_relaxng - require SiSU_lib + '/css' - include SiSU_Style - class Source - def initialize(opt) - @opt=opt - end - def read - SiSU_Config.new(@opt).make_homepage - SiSU_Config.new(@opt).css - SiSU_Config.new(@opt).dtd - SiSU_Config.new(@opt).cp_local_images - SiSU_Config.new(@opt).cp_external_images - SiSU_Config.new(@opt).cp_webserver_images if @opt.mod.inspect =~/--init(?:ialize)?=site/ - end - end - class SiSU_Config #config files such as css are not updated if they already exist unless forced using the --init=site modifier - require 'fileutils' - require SiSU_lib + '/sysenv' - include FileUtils #::Verbose - def initialize(opt) - @opt=opt - @env=SiSU_Env::Info_env.new(@opt.fns) - @suffix,@path={},{} - @suffix[:rnc]='rnc' - @suffix[:rng]='rng' - @suffix[:xsd]='xsd' - @path[:xml]= @env.path.output + '/_sisu/xml' - @path[:xsd]= @env.path.output + '/_sisu/xml/xsd' - @path[:rnc]= @env.path.output + '/_sisu/xml/rnc' - @path[:rng]= @env.path.output + '/_sisu/xml/rng' - #@path_dtd= @env.path.output + '/_sisu/dtd' - @pwd,@home=Dir.pwd,@env.path.home - end - def make_homepage - tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Make homepage','') - tell.colorize unless @opt.cmd =~/q/ - SiSU_Env::Create_site.new(@opt.cmd).homepage - end - def cp_local_images - tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Copy images','') - tell.colorize unless @opt.cmd =~/q/ - SiSU_Env::Create_site.new(@opt.cmd).cp_local_images - SiSU_Env::Create_site.new(@opt.cmd).cp_base_images #base images (nav etc.) used by all html - end - def cp_external_images - tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Copy external images','') - tell.colorize if @opt.cmd =~/V/ - SiSU_Env::Create_site.new(@opt.cmd).cp_external_images - end - def cp_webserver_images - tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Copy webserver/output file images','') - tell.colorize unless @opt.cmd =~/q/ - SiSU_Env::Create_site.new(@opt.cmd).cp_webserver_images - end - def css - tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Configuring CSSs','') - tell.colorize unless @opt.cmd =~/q/ - SiSU_Env::Create_site.new(@opt.cmd).cp_css - end - def dtd - tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Configuring DTDs','') - tell.colorize unless @opt.cmd =~/q/ - @rxng=SiSU_relaxng::RelaxNG.new - @path.each { |d| File.mkpath(d[1]) unless FileTest.directory?(d[1]) } - #ugly code, sort later - if @rxng.methods.join =~/[^_]dtd_sax\b/ - if @rxng.dtd_sax.length > 200 - dtd=File.new("#{@env.path.output}/#{@env.path.style}/#{@rxng.rng_name.output_sax}",'w') - dtd << @rxng.dtd_sax - dtd.close - else trang_rnc_model_output_sax - end - else trang_rnc_model_output_sax - end - if @rxng.methods.join =~/[^_]dtd_dom\b/ - if @rxng.dtd_dom.length > 200 - dtd=File.new("#{@env.path.output}/#{@env.path.style}/#{@rxng.rng_name.output_dom}",'w') - dtd << @rxng.dtd_dom - dtd.close - else trang_rnc_model_output_dom - end - else trang_rnc_model_output_dom - end - if @rxng.methods.join =~/[^_]dtd_node\b/ - if @rxng.dtd_node.length > 200 - dtd=File.new("#{@env.path.output}/#{@env.path.style}/#{@rxng.rng_name.input_node}",'w') - dtd << @rxng.dtd_node - dtd.close - else trang_rnc_model_input_node - end - else trang_rnc_model_input_node - end - if @rxng.methods.join =~/[^_]dtd_xhtml\b/ - if @rxng.dtd_xhtml.length > 200 - #use dtd - dtd=File.new("#{@env.path.output}/#{@env.path.style}/#{@rxng.rng_name.output_xhtml}",'w') - dtd << @rxng.dtd_xhtml - dtd.close - else trang_rnc_model_output_xhtml - end - else trang_rnc_model_output_xhtml - end - end - def trang_rnc_model_output_sax - s=@suffix - rnc_src=@env.path.dal + '/sax.' + s[:rnc] - rnc_file=@path[:rnc] + '/' + @rxng.rnc_name.output_sax - rng_file=@path[:rng] + '/' + @rxng.rng_name.output_sax - xsd_file=@path[:xsd] + '/' + @rxng.xsd_name.output_sax - rnc=File.new(rnc_src,'w') - rnc << @rxng.rnc_model_output_sax - rnc.close - #xsd - schema=SiSU_Env::System_call.new(rnc_src,xsd_file) - schema.relaxng(@opt.cmd) - #rng - schema=SiSU_Env::System_call.new(rnc_src,rng_file) - schema.relaxng(@opt.cmd) - #rnc - cp(rnc_src,rnc_file) - chmod(0644,rnc_file) - end - def trang_rnc_model_output_dom - s=@suffix - rnc_src=@env.path.dal + '/dom.' + s[:rnc] - rnc_file=@path[:rnc] + '/' + @rxng.rnc_name.output_dom - rng_file=@path[:rng] + '/' + @rxng.rng_name.output_dom - xsd_file=@path[:xsd] + '/' + @rxng.xsd_name.output_dom - rnc=File.new(rnc_src,'w') - rnc << @rxng.rnc_model_output_dom - rnc.close - #xsd - schema=SiSU_Env::System_call.new(rnc_src,xsd_file) - schema.relaxng(@opt.cmd) - #rng - schema=SiSU_Env::System_call.new(rnc_src,rng_file) - schema.relaxng(@opt.cmd) - #rnc - cp(rnc_src,rnc_file) - chmod(0644,rnc_file) - end - def trang_rnc_model_output_xhtml - s=@suffix - rnc_src=@env.path.dal + '/xhtml.' + s[:rnc] - rnc_file=@path[:rnc] + '/' + @rxng.rnc_name.output_xhtml - rng_file=@path[:rng] + '/' + @rxng.rng_name.output_xhtml - xsd_file=@path[:xsd] + '/' + @rxng.xsd_name.output_xhtml - rnc=File.new(rnc_src,'w') - rnc << @rxng.rnc_model_output_xhtml - rnc.close - #xsd - schema=SiSU_Env::System_call.new(rnc_src,xsd_file) - schema.relaxng(@opt.cmd) - #rng - schema=SiSU_Env::System_call.new(rnc_src,rng_file) - schema.relaxng(@opt.cmd) - #rnc - cp(rnc_src,rnc_file) - chmod(0644,rnc_file) - end - def trang_rnc_model_input_sax - rnc_file=@env.path.dal + '/sax.rnc' - dtd_file=@path[:xsd] + '/' + @rxng.rng_name.input_sax - rnc=File.new(rnc_file,'w') - rnc << @rxng.rnc_model_output_sax - rnc.close - schema=SiSU_Env::System_call.new(rnc_file,dtd_file) - schema.relaxng(@opt.cmd) - end - def trang_rnc_model_input_dom - rnc_file=@env.path.dal + '/dom.rnc' - dtd_file=@path[:xsd] + '/' + @rxng.rng_name.input_dom - rnc=File.new(rnc_file,'w') - rnc << @rxng.rnc_model_output_dom - rnc.close - schema=SiSU_Env::System_call.new(rnc_file,dtd_file) - schema.relaxng(@opt.cmd) - end - def trang_rnc_model_input_node - rnc_file=@env.path.dal + '/node.rnc' - rng_file=@env.path.dal + '/node.rng' - dtd_file=@path[:xsd] + '/' + @rxng.rng_name.input_node - rnc=File.new(rnc_file,'w') - rnc << @rxng.rnc_model_input_node - rnc.close - schema=SiSU_Env::System_call.new(rnc_file,dtd_file) - schema.relaxng(@opt.cmd) - end - end -end -__END__ diff --git a/lib/sisu/0.52/css.rb b/lib/sisu/0.52/css.rb deleted file mode 100644 index 47f7e375..00000000 --- a/lib/sisu/0.52/css.rb +++ /dev/null @@ -1,1939 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: css stylesheets - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_Style - require SiSU_lib + '/sysenv' - require SiSU_lib + '/defaults' - class CSS - def initialize - @vz=SiSU_Env::Get_init.instance.skin - #@vz=SiSU_Viz::Skin.new - end - def fonts - @vz.font_fonts - end - def html_tables #stylesheet for css table_pages -< */ - h1.microtoc { - margin-left: 0mm; - font-size: 115%; - margin-top: 2px; - margin-bottom: 2px; - } - h2.microtoc { - margin-left: 5mm; - font-size: 110%; - margin-top: 2px; - margin-bottom: 2px; - } - h3.microtoc { - margin-left: 10mm; - font-size: 105%; - margin-top: 2px; - margin-bottom: 2px; - } - h4.microtoc { - margin-left: 15mm; - font-weight: normal; - font-size: 100%; - margin-top: 2px; - margin-bottom: 2px; - } - h5.microtoc { - margin-left: 20mm; - font-weight: normal; - font-size: 95%; - margin-top: 2px; - margin-bottom: 2px; - } - h6.microtoc { - margin-left: 25mm; - font-weight: normal; - font-size: 90%; - margin-top: 2px; - margin-bottom: 2px; - } -/* subtoc --> */ - h5.subtoc { - margin-left: 20mm; - margin-right: 34%; - font-weight: normal; - font-size: 80%; - margin-top: 2px; - margin-bottom: 2px; - } - h6.subtoc { - margin-left: 25mm; - margin-right: 34%; - font-weight: normal; - font-size: 75%; - margin-top: 0px; - margin-bottom: 0px; - } - h1.c, h2.c, h3.c, h4.c, h5.c, h6.c, p.c { - text-align: center - } - h1.red, h2.red, h3.red, h4.red, h5.red, h6.red { - text-align: center; - color: #ff0000; - margin-left: 5mm; - text-indent: 5mm; - margin-top: 30px; - margin-bottom: 20px; - margin-right: 15mm; - } - h1.ruby, h2.ruby, h3.ruby, h4.ruby, h5.ruby, h6.ruby { - text-align: center; - color: #990000; - margin-left: 5mm; - text-indent: 5mm; - margin-top: 30px; - margin-bottom: 20px; - margin-right: 15mm; - } -/* - table.hidden { - color: #ffffff; - text-decoration: none; - } - td.hidden { - color: #ffffff; - background-color: #000000; - } - td.hidden a.active, div.hidden a:hover { - color: #ffffff; - background-color: #000000; - } - td.hidden a:hover { - text-decoration: none; - } - div.hidden a { - line-height: 12px; - margin: 0 0 0 0; - text-decoration: none; - color: #000077; - } - div.hidden a.active, div.hidden a:hover { - text-decoration: none; - } - div.hidden a:hover { - text-decoration: none; - } -*/ -WOK - end - def homepage #stylesheet for index, home page -< */ -/* - -*/ -/* subtoc --> */ - p.subtoc4 { - font-size: x-small; - text-align: left; - line-height: 100%; - margin-left: 10%; - margin-right: 10%; - margin-top: 5px; - margin-bottom: 5px; - } - p.subtoc5 { - font-size: x-small; - text-align: left; - line-height: 100%; - margin-left: 15%; - margin-right: 10%; - margin-top: 5px; - margin-bottom: 5px; - } - p.subtoc6 { - font-size: x-small; - text-align: left; - line-height: 100%; - margin-left: 20%; - margin-right: 10%; - margin-top: 5px; - margin-bottom: 5px; - } - p.ocn { - display: block; - text-align: right; - vertical-align: super; - color: #999999; - font-size: xx-small; - margin-right: 0mm; - margin-top: 0px; - margin-bottom: 0px; - } - p.note { - display: block; - font-size: small; - font-family: #{fonts}; - font-weight: normal; - line-height: 150%; - text-align: justify; - margin-left: 10%; - margin-right: 5%; - margin-top: 4px; - margin-bottom: 0px; - } - en { - font-size: xx-small; - vertical-align: super; - } - i { font-style: italic; } - b { font-style: bold; } - u { text-decoration: underline; } - br { display: block; } -WOK - end - def xhtml #stylesheet for xhtml -< #{@my_make_fns.meta}") if @md.cmd =~/M/ - tell.txt_grey unless @md.cmd =~/q/ - dal.each{|s| dal_array << "#{s.strip}\n\n" unless s.strip.empty?} - dal_array - end - def read_fnm - dal=[] - dal=if FileTest.file?(@fnm); File.open(@fnm){ |f| dal=Marshal.load(f)} - else SiSU_DAL::Source.new(@opt).create_dal - end - end - end - class Output - def initialize(md,data) - @md,@data=md,data - @my_make=SiSU_Env::Create_file.new(@md.cmd,@md.fns) - dir=SiSU_Env::Info_env.new(@md.fns) - @hard="#{dir.path.dal}/#{@md.fns}.meta" - end - def hard_output - if @md.cmd =~/M/ - filename_meta=@my_make.file_meta - @data.each {|s| filename_meta.puts s.strip + "\n\n" unless s.strip.empty?} - else File.unlink(@hard) if FileTest.file?(@hard) - end - end - def marshal - marshal_meta=@my_make.marshal_meta - File.open(marshal_meta,'w'){|f| Marshal.dump(@data.to_a,f)} - end - end - class Make - @@endnote={} - @@endnote_array=@@word_mode=[] - @@endnote_counter,@@endnote_counter_asterisk,@@endnote_counter_dag=1,1,1 - @@comment='%' - @@dp=nil - def initialize(md,data) - @md,@data=md,data - @@word_mode=[] - @env=SiSU_Env::Info_env.new(@md.fns) - @skin=SiSU_Env::Info_skin.new(@md) - @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern - l=SiSU_Env::Standardise_language.new.file_to_language(@md.fns) - @language=l[:l] - @tr=SiSU_Translate::Source.new(@md,@language) - end - def reset - @@flag_vocab=0 - @@endnote={} - @@endnote_array=@@word_mode=[] - @@endnote_counter,@@endnote_counter_asterisk,@@endnote_counter_dag=1,1,1 - @@line_mode='' - end - def song - reset - data=@data - @metafile="#{@env.path.dal}/#{@md.fns}.meta" - my_make_source_file=SiSU_Env::Create_file.new(@md.cmd,@md.fns) - data=data.join.split("\n\n") - data=SiSU_document_structure::Code.new(@md,data).code - data_new=[] - data.each do |x| - data_new << if x =~ /\n\n/m; x.split(/\n\n+/) - else x - end - end - data=data_new.flatten - data=SiSU_DAL::Make.new(@md,data).substitutions_and_insertions? - data=Syntax::Markup.new(@md,data).songsheet - data=SiSU_DAL::Make.new(@md,data).character_check - data=SiSU_DAL::Make.new(@md,data).images - data=SiSU_document_structure::Tables.new(@md,data).tables - data=SiSU_DAL::Make.new(@md,data).numbering_song - data=SiSU_DAL::Make.new(@md,data).endnotes - data=SiSU_DAL::Make.new(@md,data).object_digest - meta=SiSU_DAL::Make.new(@md,data).metadata - outputdata=data + meta - if @md.cmd =~/[mM]/ - SiSU_DAL::Output.new(@md,outputdata).hard_output - SiSU_DAL::Output.new(@md,outputdata).marshal - end - reset - outputdata - end - protected - def vocabulary - data=@data - vocab_insert,tuned_file=[],[] - data.each do |para| - if para =~/^1~/ and @@flag_vocab == 0 - vocab_insert << '0~vocabulary lex' << "\n\n" << para #watch consider - tuned_file << vocab_insert unless para.nil? - @@flag_vocab=1 - else tuned_file << para unless para.nil? - end - end - tuned_file - end - def character_check - require 'iconv' - reset - data=@data - @tuned_file=[] - endnote_no=1 - data.each do |para| - para.strip! - para.gsub!(/^([12])~\?\s+/,'\1~ ') #conditional header for incorporated document 2004w12 - para.gsub!(/^[{~}]\s*$/,'') - para.gsub!(/^#{@@comment}.*/,'') #remove comment and divider #% - para.gsub!(/<~#>|~#\s*/,'<~#>') - para.gsub!(/-#\s*/,'<-#><~#>') - #para.gsub!(/(#\{{3} arch-tag:|0\{{3}~cvs)\s+/, "0{{~rcs ") #KEEP ... ENABLE WIDER USE OF REVISION CONTROL - para.gsub!(/(~\{ )\s+/,'\1') - para.gsub!(/ \/\//,'
') #added 2004w29 - para.gsub!(/
/,'
') #needed by xml, xhtml etc. - #para.gsub!(/

/,'

') #consider - para.gsub!(/`/,"'") - para.gsub!(/\342\200\231/,"'") #if para =~/’/ #Avoid #‘ ’ #“ ” - para.gsub!(/\t/,' ') - para.gsub!(/�/,' ') #watch, replace with char code - para.gsub!(/[“”]/,'""') - para.gsub!(/[­–—]/,'-') #— – chk - para.gsub!(/·/,'*') - para.gsub!(/\\copy(?:right)?\b/,'©') - para.gsub!(/\\trademark\b|\\tm\b/,'®') - #non_utf8(para) - para=para + "\n" - case para - when /\^~/ # endnotes - #% Note must do this first (earlier loop) and then enter gathered data into ~^\d+ - sub_para=para.dup - @@endnote_array << sub_para.gsub!(/\n/,'').gsub!(/\^~\s+(.+)\s*/, %{~\{#{endnote_no} \\1 \}~}).strip - endnote_no+=1 - para=nil if para =~/\^~ .+/ #removes 'binary' endnote now in endnote array for later insertion - end - @tuned_file << para unless para.nil? - end - @tuned_file - end - def images - data=@data - tuned_file=[] - @rmgk=false - if SiSU_Env::Info_settings.new.program?('rmagick'); @rmgk=SiSU_Env::Load.new('RMagick').prog - else tell=SiSU_Screen::Ansi.new(@md.cmd,'use of RMagick is not enabled in sisurc.yml') - tell.warn if @md.cmd =~/[vVM]/ - end - data.each do |para| - para.strip! - if para =~/\{\s*\S+\.(?:png|jpg|gif)(?:\s*|\s+.+)?\}(?:(?:https?|ftp):\S+|image)/ - if para !~/\{\s*\S+\.(?:png|jpg|gif)\s+\d+x\d+\s+/ - m=/\{\s*(\S+\.(?:png|jpg|gif))/ - if @rmgk - imgs=para.scan(m).flatten - images=imgs.each do |image| - dir=SiSU_Env::Info_env.new(@md.fns) - path_image=[dir.path.image_source_local_tex,dir.path.image_source_remote_tex,dir.path.image_source_tex] - image_path=nil - path_image.each do |image_path| - break if FileTest.exist?("#{image_path}/#{image}") - end - if FileTest.exist?("#{image_path}/#{image}") - img=Magick::ImageList.new("#{image_path}/#{image}") - img_col,img_row=img.columns,img.rows - if img_col > img_row #landscape - if img_col> 640 #480 - img_col=640 #480 - img_row=((1.00*img_col/img.columns)*img.rows).round - end - else #portrait - if img_col> 640 #480 - img_col=640 #480 - img_row=((1.00*img_col/img.columns)*img.rows).round - end - if img_row > 640 - img_row=640 - img_col=((1.00*img_row/img.rows)*img.columns).round - end - end - para.gsub!(/(#{image})/,"#{image} #{img_col}x#{img_row}") - else para.gsub!(/\{\s*(\S+)\.(png|jpg|gif).+?\}((?:https?|ftp):\S+|image)/,'[ \1 (\2 missing) ]') - end - end - else - images=para.scan(m) do |image| - tell=SiSU_Screen::Ansi.new(@md.cmd,'where image dimensions have not been provided RMagick is required',image) - tell.warn #unless @opt.cmd =~/q/ - end - end - end - end - para.gsub!(/\{\s+(\S+\.(?:png|jpg|gif))\s+/i,'{\1 ') if para =~/\{\s+\S+\.(?:png|jpg|gif).+?\}(?:(?:https?|ftp):\S+|image)/ - tuned_file << para unless para.nil? - end - tuned_file - end - def output_filetypes_in_cmd(cmd_shortcut,source=nil) - #make list of file types in shortcut command (as configured), e.g. when sisu -3 is used - cf_defaults=SiSU_Env::Info_processing_flag.new - cmd_list=case cmd_shortcut.to_s - when /0/; cf_defaults.cf_0 - when /1/; cf_defaults.cf_1 - when /2/; cf_defaults.cf_2 - when /3/; cf_defaults.cf_3 - when /4/; cf_defaults.cf_4 - when /5/; cf_defaults.cf_5 - end - file_type_names=[] - file_type_names <<= if cmd_list =~ /y/; 'sisu_manifest.html' - end - file_type_names <<= if cmd_list =~ /h/; ['toc.html', 'doc.html'] - end - file_type_names <<= if cmd_list =~ /p/; ['landscape.pdf', 'portrait.pdf'] - end - file_type_names <<= if cmd_list =~ /o/; 'opendocument.odt' - end - file_type_names <<= if cmd_list =~ /b/; 'scroll.xhtml' - end - file_type_names <<= if cmd_list =~ /x/; 'sax.xml' - end - file_type_names <<= if cmd_list =~ /X/; 'dom.xml' - end - file_type_names <<= if cmd_list =~ /a/; 'plain.txt' - end - file_type_names <<= if cmd_list =~ /g/; 'wiki.txt' - end - file_type_names <<= if cmd_list =~ /w/; 'concordance.html' - end - file_type_names <<= if cmd_list =~ /N/; 'digest.txt' - end - file_type_names <<= if source and cmd_shortcut =~ /s/; source - end - file_type_names <<= if cmd_shortcut =~ /S/; 'sisupod.zip' - end - file_type_names=file_type_names.flatten - end - def substitutions_and_insertions? - data=@data - tuned_file=[] - if data[0] =~ /^#!\s*(?:\/usr\/bin\/env sisu|\/usr\/bin\/sisu)/ # remove bang from top #! (however file is stripped, so will be removed provided no content preceeds it) - data[0].gsub!(/^#!\s*\/usr\/bin\/sisu/,'') - data[0].gsub!(/^#!\s*\/usr\/bin\/env sisu/,'') - end - if data[0] =~ /^(SiSU\s+[\d.]*|sisu-[\d.]+)$/ # SiSU identifier - data[0].gsub!(/^(SiSU\s*[\d.]*)$/,'% \1') - data[0].gsub!(/^(sisu-[\d.]+)$/,'% \1') - end - data.each do |para| - para=if @md.markup_version.to_f >= 0.38 - SiSU_document_structure::Structure.new(@md,para).structure_markup_normalize - else para - end - #para.gsub!(//,'\1') #consider, would permit use of text hyperlinks if desired, dal_syntax more appropriate? - para.gsub!(/^((?:[1-9]|:?[A-C])~\S*)\s*$/,'\1~ [Note: heading marker::required title missing]~#') #conditional header for incorporated document 2004w12 - if para =~/^@\S+?:/ - para.gsub!(/^@(\S+?):\s+/,'0~\1 ') - para.gsub!(/^@(\S+?):([+-])\s+/,'0~\1\2 ') - end - if para !~/^%+\s/ and - para =~/^(?:_\*\s+)?\{(?:~\^\s+)?(.+?)\s\[(?:\d(?:[sS]+))\]\}(?:\.\.\/\S+?\/|\S+?\.(?:sst|ssm)\b)(?:\s+~\{.+?\}~)?(?:\s+\*~\S+)*\s*$/ - txt,cmd,source,url_dir,note,manifest=nil,nil,nil,nil,nil,nil - url_and_stub=SiSU_Env::Info_env.new.url - if defined? url_and_stub.remote - @output_url="#{url_and_stub.remote}" - if para =~/\{(.+?)\s\[(\d[sS]*)\]\}((\S+?)\.ss[tm])(\s+~\{.+?\}~)?/ - #syntax e.g.: { "Sphinx or Robot", Leena Krohn [3sS]}sphinx_or_robot.leena_krohn.1996.sst - txt,cmd,source,url_dir,note=$1,$2,$3,$4,$5 - elsif para =~/\{(.+?)\s\[(\d[sS]*)\]\}\.\.\/(\S+?)\/(\s+~\{.+?\}~)?/ - #syntax e.g.: { "Sphinx or Robot", Leena Krohn [3sS]}../sphinx_or_robot.leena_krohn.1996/ - txt,cmd,url_dir,note=$1,$2,$3,$4 - end - manifest="{#{txt} }#@output_url/#{url_dir}/toc.html#{note}\n\n" - else - puts "error, does currently support relative paths (reltive paths were removed, as had problems for citation, and was not suited to all output types should possibly reconsider) #{__FILE__} #{__LINE__}" - if para =~/\{(?:~\^\s+)?(.+?)\s\[(\d[sS]*)\]\}\.\.\/(\S+?)\/(\s+~\{.+?\}~)?/ - txt,cmd,url_dir,note=$1,$2,$3,$4 - manifest="{ #{txt} }../#{url_dir}/toc.html#{note}\n\n" - end - end - tuned_file << manifest - output_filetypes_in_cmd(cmd,source).each do |o_f| - describe = case o_f - when /sisu_manifest.html/; '~^ document manifest' - when /toc.html/; ' html, segmented text' - when /doc.html/; ' html, scroll, document in one' - when /landscape.pdf/; ' pdf, landscape' - when /portrait.pdf/; ' pdf, portrait' - when /opendocument.odt/; ' open document' - when /scroll.xhtml/; ' xhtml scroll' - when /sax.xml/; ' xml, sax' - when /dom.xml/; ' xml, dom' - when /plain.txt/; ' plain text utf-8' - when /wiki.txt/; ' wiki text' - when /concordance.html/; ' concordance' - when /digest.txt/; ' dcc, document content certificate (digests)' - when /#{source}/; ' markup source text' - when /sisupod.zip/; ' zipped markup source pod' - else nil - end - if describe - if @output_url - tuned_file << "_1 {#{describe} }#@output_url/#{url_dir}/#{o_f}\n\n" if describe - else - tuned_file << "_1 { #{describe} }../#{url_dir}/#{o_f}\n\n" - end - end - end - elsif para =~/<:insert\d+!?>/ and para !~/^%\s+/ - @skin.select - ins=SiSU_Viz::Inserts.new - case para - when /^\s*<:insert1>\s*$/ - para=[] - ins.insert1.split(/\n\n/).each{|x| para << x } - when /^\s*<:insert2>\s*$/ - para=[] - ins.insert2.split(/\n\n/).each{|x| para << x } - when /^\s*<:insert3>\s*$/ - para=[] - ins.insert3.split(/\n\n/).each{|x| para << x << "\n"} - para=ins.insert3 - when /^\s*<:insert4>\s*$/ - para=[] - ins.insert4.split(/\n\n/).each{|x| para << x << "\n"} - para=ins.insert4 - when /^\s*<:insert5>\s*$/ - para=[] - ins.insert5.split(/\n\n/).each{|x| para << x << "\n"} - when /^\s*<:insert6>\s*$/ - para=[] - ins.insert6.split(/\n\n/).each{|x| para << x << "\n"} - when /^\s*<:insert7>\s*$/ - para=[] - ins.insert7.split(/\n\n/).each{|x| para << x << "\n"} - end - para.each{|x| tuned_file << x } - else tuned_file << para - end - tuned_file.flatten! - tuned_file.compact! - end - tuned_file - end - def numbering_song - data=@data - data=SiSU_DAL::Make.new(@md,data).number_plaintext_para - data=SiSU_DAL::Make.new(@md,data).name_endnote_seg - data=SiSU_DAL::Make.new(@md,data).auto_number_heading_ie_title - data=SiSU_DAL::Make.new(@md,data).ocn unless @md.markup =~/not_to/ - data=SiSU_DAL::Make.new(@md,data).minor_numbering #unless @md.markup =~/not_to/ - data=SiSU_DAL::Make.new(@md,data).name_para_seg_filename - data=SiSU_DAL::Make.new(@md,data).set_heading_seg unless @md.set_heading_seg - data=SiSU_DAL::Make.new(@md,data).set_heading_top unless @md.set_heading_top - data=SiSU_DAL::Make.new(@md,data).set_header_title unless @md.set_header_title - data - end - def number_plaintext_para - data=@data - @tuned_file=[] - data.each do |para| - para.gsub!(/(^|[^<][^v][^>])\n/,'\1 ') #messy, but idea is that tables should retain breaks - para.gsub!(/^/,"\n") unless para =~/¡/ - para.gsub!(/^\s+|\s$/,"\n") - @tuned_file << para - end - @tuned_file - end - def name_endnote_seg - data=@data - @tuned_file=[] - data.each do |para| - para.gsub!(/<:3>\s*<:ee>/, - "#{@@endnote['special_align']}


\r " + - "#{@@endnote['seg_name_3']}

" + - "#{@@endnote['special_align_close']}") - para.gsub!(/<:2>\s*<:ee>/, - "#{@@endnote['special_align']}


\r " + - "#{@@endnote['seg_name_2']}

" + - "#{@@endnote['special_align_close']}") - para.gsub!(/<:1>\s*<:ee>/, - "#{@@endnote['special_align']}


\r " + - "#{@@endnote['seg_name_1']}

" + - "#{@@endnote['special_align_close']}") - @tuned_file << para - end - # debug 2003w46 adding revision control info - if @md.flag_auto_endnotes and @md.flag_separate_endnotes_make - @tuned_file << "\n4~endnotes Endnotes <~0;0:0;u0>" #prob numbering, revisit - end - @tuned_file << "\n" - @tuned_file - end - def owner_details_seg - data << '4~owner.details Owner Details' - end - def number_sub_heading(para,num,title_no) - case para - when /#{num}~- /; para.gsub!(/#{num}~- /,"#{title_no} ") - when /^#{num}~#\s*/; para.gsub!(/^#{num}~#\s*/,"#{title_no} ") - when /^#{num}~[a-z_\.]+ / - para.gsub!(/^#{num}~([a-z_\.]+)\s+(.+)/i,%{#{num}~\\1 #{title_no} \\2 <:name##{title_no}>}) - else para.gsub!(/^#{num}~ /,"#{num}~#{title_no} #{title_no} ") #main - end - if @md.toc_lev_limit and @md.toc_lev_limit < num - para.gsub!(/^[5-8]~(?:~\S+)?\s*/,'!_ ') - end - para - end - def auto_number_heading_ie_title #also does some segment naming - data=@data - @tuned_file=[] - if @md.markup =~/num_top/ or @md.num_top # watch, 2003w23 - input="#{@md.markup}"[/num_top\=([1-6])/,1] if @md.markup - input||=@md.num_top if @md.num_top !~/^$/ - end - num_top=input.to_i - t_no1=t_no2=t_no3=t_no4=0 - no1=num_top; no2=(num_top + 1); no3=(num_top + 2); no4=(num_top + 3) - t_not=0 - data.each do |para| #@md.seg_names << [additions to segment names] - if (@md.markup =~/num_top/ or (@md.num_top and @md.num_top !~/^$/)) and para !~/^0~/ - if (para =~/^(?:#{no1}|^#{no2}|^#{no3}#{no4})~#/ and para !~/^4~endnotes?/) - t_not+=1 #; t_no2=0; t_no3=0 - para.gsub!(/^(#{no1})~#\s*/,"\\1~ps#{t_not} ") - para.gsub!(/^(#{no2})~#\s*/,"\\1~ps#{t_not} ") - para.gsub!(/^(#{no3})~#\s*/,"\\1~ps#{t_not} ") - para.gsub!(/^(#{no4})~#\s*/,"\\1~ps#{t_not} ") - end - if para =~/#{no1}~/ - @subnumber=1 - @subnumber=0 if para =~/#{no1}~/ - end - if para =~/^[0-6]~[ \w-]/ and para !~ /(?:[0-6]~[\w-]+-|4~endnotes|^[0-6]~([a-z_\.]+)\s+[\d.]+)\s/ and para !~/<~#>|<-#>/ - if para =~/^#{no1}~/ - t_no1+=1; t_no2=0; t_no3=0 - title_no="#{t_no1}" - if not @md.seg_names.nil? and not @md.seg_names.include?(title_no) - para.gsub!(/^#{no1}~\s+(\S+)#/,"#{no1}~#{title_no} \\1 #{title_no} ") #shift placement of auto-number to after first word, e.g. Article # not # Article, added on occasion of ABF (20040329) - para.gsub!(/^#{no1}\{\s+(Article|Clause|Section)\s+#/i,%{#{no1}~#{title_no} \\1 #{title_no}. }) - unless para =~/^#{no1}~\s+[\d.]+\s/ #fix -> if the title starts with a numbering scheme, do not auto-number, review - para.gsub!(/^#{no1}~\s+/,"#{no1}~#{title_no} #{title_no}. ") - end - @md.seg_names << title_no - #else puts "warning segment name #{title_no} already exists" - end - unless para =~/^#{no1}~([a-z_\.]+)\s+[A-Z]\.?\s/ #bug -> tmp fix, excludes A. B. C. lettering, but not roman numerals, is arbitrary, review required - para.gsub!(/^#{no1}~([a-z_\.]+)\s+(.+)/i,%{#{no1}~\\1 #{title_no}. \\2 <:name##{title_no}>}) - end - para.gsub!(/^#{no1}~#\s*/,"#{title_no}. ") - end - if para =~/^#{no2}~/ - t_no2+=1; t_no3=0 - title_no="#{t_no1}.#{t_no2}" - para=number_sub_heading(para,no2,title_no) - end - if para =~/^#{no3}~/ - t_no3+=1 - title_no="#{t_no1}.#{t_no2}.#{t_no3}" - para=number_sub_heading(para,no3,title_no) - end - elsif para =~ /^[0-6]~[\w-]+-/ # endnotes, watch2005 - para.gsub!(/^#{no1}~([a-z_\.]+)- /,"#{no1}~\\1 ") - para.gsub!(/^#{no2}~([a-z_\.]+)- /,"#{no2}~\\1 ") - para.gsub!(/^#{no3}~([a-z_\.]+)- /,"#{no3}~\\1 ") - end - elsif @md.markup =~/num_extract/ #AS DANGEROUS force enable with document, note already does this type of numbering for cisg, locate and coordinate logic, is currently misplaced in code, chengwei inspired 2004w23/4 - unless para =~ /^[0-6]~\S+/ #endnotes watch? - if para =~/^[1-6]~\s+([\d\.]+)/ #risky (must be unique) consider output to 4~~\d instead of 4~\d - name_num=$1 - para.gsub!(/^([1-6]~)\s+/,"\\1#{name_num} ") - end - end - if @md.toc_lev_limit - end - end - @tuned_file << para - end - @tuned_file - end - def ocn #and auto segment numbering increment - data=@data - @tuned_file=[] - object_array=SiSU_document_structure::OCN.new(@md,data).ocn - object_array.each do |o| - @tuned_file <<= if o.ocn; "#{o.txt} <~#{o.ocn};#{o.lv};#{o.type}>" - else o.txt - end - end - @tuned_file - end - def minor_numbering #and auto segment numbering increment - data=@data - @tuned_file=[] - number_small,letter_small=0,0 - letter=%w( a b c d e f g h i j k l m n o p q r s t u v w x y z ) - data.each do |para| - if para =~/\w|\S|<|\(/ - if para !~/^%% |^0~|^4~endnotes|^<\/center>|<:ee>|<:e[:_]>|^\^~ |<:e[:_]\d+?>|^<:p[bn]>|^<:\#|<:- |<[:!]!4|^(?:alt|code|group|poem|table)\{|^\}(?:alt|code|group|poem|table)|^\}table$|||||<\/tr>|


|\[endnotes\]|<:zz>|<:isbn-|<:journal-|<:conference-|/i #ocn here #  added with Tune.code #¡ - if para=~/^[1-8]~/; number_small,letter_small=0,0 #% sub-number system, (baby numbering) reset with any change of major number (more obviously should be placed in number titles, but that is conditionally executed, check and move later) - end - if para =~/^#[ 1]/ - letter_small=0 - number_small=0 if para =~ /^#1/ - number_small+=1 - para.gsub!(/^#[ 1]/,"#{number_small}. ") #change 2004 - end - if para =~/^_# / - para.gsub!(/^_# /,"<:i1> #{letter[letter_small]}. ") #change 2004 - letter_small+=1 - end - end - end - @tuned_file << para - end - @tuned_file - end - def name_para_seg_filename - # paragraph name/numbering rules - # manual naming overrides, manual naming may be - # alpha-numeric characters mixed, - # numeric only (a number), if - # all segments have been named, - # the numbers used are over 1000 or - # it is not minded that auto-numbering uses a funny scheme for naming segments (not yet implemented) - # [for now a warning is printed for such documents on use of maintenance or very-verbose flag] - # auto-naming takes the form of giving numbers to segments - # the rules for which are as follows - # if the title/heading text starts with a numeric, then that is used (1 3.1 3rd etc.) - # otherwise the level 4 segment number from the embedded document structure info is used - # if there is none a sequential number is designated, preceded by an underscore - data=@data - @tuned_file=[] - art_filename_auto=1 - @counter=1 - @unique_auto_name=[] - puts 'manual segment names, numbers used as names, risk warning (segmented html)' if not @md.seg_autoname_safe and @md.cmd =~/[MV]/ - data.each do |para| - para=SiSU_document_structure::Structure.new(@md,para).structure_markup - if para !~/^0~/ - if para =~/^[456]~ / - if para=~/^4/ and not @md.set_heading_seg - @md.set_heading_seg=true - end - if para =~/^[456]~(?:\s\S+)?\s+([\d.,:-]+)/m #heading starts with a recognised numeric or word followed by a recognised numerical construct, use that as name - pattern=$1 - pattern.gsub!(/(?:[:,-]|\W)/,'.') - pattern.gsub!(/\.$/,'') - if not @md.seg_names.nil? and not @md.seg_names.include?(pattern) - para.gsub!(/^([456])~\s*/,"\\1~#{pattern} ") - @md.seg_names << pattern - else puts 'warn, there may be a conflicting numbering scheme' if @md.cmd =~/[VM]/ - end - end - if para =~/^4~\s.+?;4:(\d+);/m #extract segment name from embedded document structure info - pattern=$1 - pattern.gsub!(/(?:[:,-]|\W)/,'.') - pattern.gsub!(/\.$/,'') - if not @md.seg_names.nil? and not @md.seg_names.include?(pattern) - para.gsub!(/^(4)~\s*/,"\\1~#{pattern} ") - @md.seg_names << pattern - else - para.gsub!(/^(4)~\s*/,"\\1~~#{pattern} ") - @md.seg_names << "~#{pattern}" - end - end - if para =~/^4~\s+/ #if still not segment name, provide a numerical one - if not @md.seg_names.nil? and not @md.seg_names.include?(art_filename_auto) - para.gsub!(/^4~\s+/,%{4~_#{art_filename_auto} }) - @md.seg_names << art_filename_auto - else puts 'segment name (numbering) error' - end - art_filename_auto+=1 - end - end - end - @tuned_file << if para =~/^([1-6])~/m and (@md.pagenew or @md.pagebreak); m=$1 #watch ref~ - para_tmp=[] - if @md.pagenew.to_s =~/#{m}/; para_tmp << "<:pn>\n" << para - end - if @md.pagebreak.to_s =~/#{m}/; para_tmp << "<:pb>\n" << para - end - para_result=unless para_tmp.length > 0; para - else para_tmp - end - else para - end - end - if @md.seg_names.length > 0 - @md.set_heading_seg=true - end - @tuned_file=@tuned_file.flatten - 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]/ - data=@data - @tuned_file=[] - data.each do |para| - unless @md.set_heading_top - if para !~/^(?:@\S+:|0~\S+)\s/m and para !~/\A\s*\Z/m - @md.set_heading_top=true - head=if @md.title ; "1~ #{@md.title}" - else '1~ [no title provided]' - end - @tuned_file << head - end - end - @tuned_file << para - end - @tuned_file - end - 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]/ - data=@data - @tuned_file=[] - data.each do |para| - unless @md.set_heading_seg - if para !~/^(?:@\S+:|0~\S+|[123]~)/m and para !~/\A\s*\Z/m and para !~/<:p[bn]>/ - @md.set_heading_seg=true - head=if @md.title ; "4~seg [#{@md.title}]" - else '4~seg [segment]' - end - @tuned_file << head - end - end - @tuned_file << para - end - @tuned_file - end - 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]/ - data=@data - @tuned_file=[] - data.each do |para| - unless @md.set_header_title - if para !~/^%{1,2}\s/m and para !~/\A\s*\Z/m - @tuned_file << "0~title #{@md.heading_seg_first}" - @md.title=@md.heading_seg_first - @md.set_header_title=true - end - end - @tuned_file << para - end - @tuned_file - end - end - def endnotes - data=@data - @tuned_file=[] - endnote_no,endnote_ref=1,1 - #% endnote work zone - data.each do |para| - # manually numbered endnotes --> - if @md.mod.inspect =~/--no-asterisk|--no-annotate/ - para.gsub!(/~\[[*]\s.+?\]~/,'') - end - if @md.mod.inspect =~/--no-dagger|--no-annotate/ - para.gsub!(/~\[[+]\s.+?\]~/,'') - end - case para - # auto-numbered endnotes --> - when /~\{\s+.+?\}~|~\[[*+]\s+.+?\]~/ - para.gsub!(/\s*(\}~|\]~)/,' \1') # required 2003w31 - @word_mode=para.scan(/\S+/) - word_mode=SiSU_DAL::Make.new(@md,@word_mode).endnote_call_number - para=word_mode.join(' ') - endnote_ref+=1 - when /~\^(?:\s|$)|<:e>/ - #%Note inserts endnotes previously gathered from /^(|[-~]\{{3})/ (in earlier loop) - word_mode=para.scan(/\S+/) - word_mode=SiSU_DAL::Make.new(@md,word_mode).endnote_call_number - para=word_mode.join(' ') - endnote_ref+=1 - end - @tuned_file << para - end - @tuned_file - end - def endnote_call_number - data=@data - data.each do |word| - case word - when /~\{/ - unless word =~/~\{[*+]+/ - word.gsub!(/~\{/,"~\{#{@@endnote_counter} ") - @@endnote_counter+=1 - end - when /~\[/ - if word =~/~\[[+]/ - word.gsub!(/~\[[+]/,"~\[\+#{@@endnote_counter_dag} ") - @@endnote_counter_dag+=1 - else - word.gsub!(/~\[[*]?/,"~\[\*#{@@endnote_counter_asterisk} ") - @@endnote_counter_asterisk+=1 - end - when /~\^|<:e>/ - word.gsub!(/~\^|<:e>/,"#{@@endnote_array[@@endnote_counter-1]}") - @@endnote_counter+=1 - end - end - end - def metadata - data=@data - meta,@dc,@rc,@cvs,dctitle,add=Array.new(6){[]} - dir=SiSU_Env::Info_env.new(@md.fns) - base_html="#{dir.url.root}/#{@md.fnb}" - ocnm=ocnd=ocnv=0 - ocnm+=1 - header0='<:pn>' - header1="\n1~ Document Information <~0;0:0;m#{ocnm}>" - ocnm+=1 - header4="\n4~metadata MetaData <~0;m#{ocnm};m#{ocnm}>" - ocnm+=1; ocnd+=1 - head_no_dc="<~0;m#{ocnm};d#{ocnd}>" - ocnm+=1; ocnd+=1 - head_no_dc_tag="<~0;m#{ocnm};d#{ocnd}>" - data.each do |para| - case para - when /^0~(title|creator|author|translator|translated_by|illustrator|illustrated_by|prepared_by|digitized_by|description|publisher|contributor|date\.created|date\.issued|date\.available|date\.valid|date\.modified|date|type|format|rights|identifier|source|language)/i - m=$1 - ocnm+=1; ocnd+=1 - @dc << case para - when /^0~title/ - "\n#{@tr.dc_title}: #{@md.dc_title} <~0;m#{ocnm};d#{ocnd}>" - when /^0~(?:creator|author)/ - "\n#{@tr.creator}: #{@md.dc_creator} <~0;m#{ocnm};d#{ocnd}>" - when /0~(?:translator|translated_by)/ - "\n#{@tr.translator}: #{@md.translator} <~0;m#{ocnm};d#{ocnd}>" - when /^0~(?:illustrator|illustrated_by)/ - "\n#{@tr.illustrator}: #{@md.illustrator} <~0;m#{ocnm};d#{ocnd}>" - when /^0~prepared_by/ - "\n#{@tr.prepared_by}: #{@md.prepared_by} <~0;m#{ocnm};d#{ocnd}>" - when /^0~digitized_by/ - "\n#{@tr.digitized_by}: #{@md.digitized_by} <~0;m#{ocnm};d#{ocnd}>" - when /^0~description/ - "\n#{@tr.description}: #{@md.dc_description} <~0;m#{ocnm};d#{ocnd}>" - when /^0~subject/ - "\n#{@tr.subject}: #{@md.dc_subject} <~0;m#{ocnm};d#{ocnd}>" - when /^0~abstract/ - "\n#{@tr.abstract}: #{@md.dc_abstract} <~0;m#{ocnm};d#{ocnd}>" - when /^0~publisher/ - "\n#{@tr.publisher}: #{@md.dc_publisher} <~0;m#{ocnm};d#{ocnd}>" - when /^0~contributor/ - "\n#{@tr.contributor}: #{@md.dc_contributor} <~0;m#{ocnm};d#{ocnd}>" - when /^0~date.created/ - "\n#{@tr.date_created}: #{@md.dc_date_created} <~0;m#{ocnm};d#{ocnd}>" - when /^0~date.issued/ - "\n#{@tr.date_issued}: #{@md.dc_date_issued} <~0;m#{ocnm};d#{ocnd}>" - when /^0~date.available/ - "\n#{@tr.date_available}: #{@md.dc_date_available} <~0;m#{ocnm};d#{ocnd}>" - when /^0~date.modified/ - "\n#{@tr.date_modified}: #{@md.dc_date_modified} <~0;m#{ocnm};d#{ocnd}>" - when /^0~date.valid/ - "\n#{@tr.date_valid}: #{@md.dc_date_valid} <~0;m#{ocnm};d#{ocnd}>" - when /^0~date/ - "\n#{@tr.date}: #{@md.dc_date} <~0;m#{ocnm};d#{ocnd}>" - when /^0~type/ - "\n#{@tr.type}: #{@md.dc_type} <~0;m#{ocnm};d#{ocnd}>" - when /^0~format/ - "\n#{@tr.format}: #{@md.dc_format} <~0;m#{ocnm};d#{ocnd}>" - when /^0~rights/ - "\n#{@tr.rights}: #{@md.dc_rights} <~0;m#{ocnm};d#{ocnd}>" - when /^0~identifier/ - "\n#{@tr.identifier}: #{@md.dc_identifier} <~0;m#{ocnm};d#{ocnd}>" - when /^0~source/ - "\n#{@tr.source}: #{@md.dc_source} <~0;m#{ocnm};d#{ocnd}>" - when /^0~language/ - "\n#{@tr.language}: #{@md.dc_language} <~0;m#{ocnm};d#{ocnd}>" - when /^0~language.original/ - "\n#{@tr.language_original}: #{@md.language_original} <~0;m#{ocnm};d#{ocnd}>" - when /^0~relation/ - "\n#{@tr.relation}: #{@md.dc_relation} <~0;m#{ocnm};d#{ocnd}>" - when /^0~coverage/ - "\n#{@tr.coverage}: #{@md.dc_coverage} <~0;m#{ocnm};d#{ocnd}>" - when /^0~keywords/ - "\n#{@tr.keywords}: #{@md.keywords} <~0;m#{ocnm};d#{ocnd}>" - when /^0~comments/ - "\n#{@tr.comments}: #{@md.comments} <~0;m#{ocnm};d#{ocnd}>" - when /^0~cls_loc/ - "\n#{@cls_dewey}: #{@md.cls_dewey} <~0;m#{ocnm};d#{ocnd}>" - when /^0~cls_dewey/ - "\n#{@tr.cls_dewey}: #{@md.cls_dewey} <~0;m#{ocnm};d#{ocnd}>" - when /^0~cls_gutenberg|0~cls_pg/ - "\n#{@tr.cls_gutenberg}: #{@md.cls_gutenberg} <~0;m#{ocnm};d#{ocnd}>" - #"\n#{@tr.cls_gutenberg}: #{@md.cls_pg} <~0;m#{ocnm};d#{ocnd}>" - when /^0~cls_isbn/ - "\n#{@tr.cls_isbn}: #{@md.cls_isbn} <~0;m#{ocnm};d#{ocnd}>" - when /^0~prefix(?:_a)?/ - "\n#{@tr.prefix_a}: #{@md.prefix_a} <~0;m#{ocnm};d#{ocnd}>" - when /^0~prefix_b/ - "\n#{@tr.prefix_b}: #{@md.prefix_b} <~0;m#{ocnm};d#{ocnd}>" - else para.gsub(/^0~(#{m})\s+(.+)/m,"\n#{m.capitalize}: \\2 <~0;m#{ocnm};d#{ocnd}>") - end - end - end - ocnm+=1; ocnv+=1 - head_no_rc="<~0;m#{ocnm};v#{ocnv}>" - ocnm+=1; ocnv+=1 - head_no_rc_tag="<~0;m#{ocnm};v#{ocnv}>" - data.each do |para| - case para - when /^0~(?:cvs|rcs)\+\s+/ #note the + sign to turn on use of cvs id - ocnm+=1; ocnv+=1 - @cvs << "#{@tr.sc_number}: #{@md.sc_number} <~0;m#{ocnm};v#{ocnv}>" - ocnm+=1; ocnv+=1 - @cvs << "#{@tr.sc_date}: #{@md.sc_date} <~0;m#{ocnm};v#{ocnv}>" - ocnm+=1; ocnv+=1 - @cvs << "CVS/RCS time: #{@md.sc_time} <~0;m#{ocnm};v#{ocnv}>" - ocnm+=1; ocnv+=1 - when /^0~cvs[+\s]/ #enable pattern above instead if you wish the default to be to include cvs tags from all documents KEEP - when /^0~cvs\s+/ #enable pattern above instead if you wish the default to be to include cvs tags from all documents KEEP - end - end - if true #default version information - ocnm+=1; ocnv+=1 - if @md.sc_filename and @md.sc_filename.length > 3 - @rc << "#{@tr.sourcefile}: #{@md.sc_filename} <~0;m#{ocnm};v#{ocnv}>" - else @rc << "#{@tr.sourcefile}: #{@md.fns} <~0;m#{ocnm};v#{ocnv}>" - end - ocnm+=1; ocnv+=1 - if @md.file_encoding and @md.file_encoding.length > 3 #translate - @rc << "Filetype: #{@md.file_encoding} <~0;m#{ocnm};v#{ocnv}>" - end - ocnm+=1; ocnv+=1 - if @md.dgst #change. enable by default - @rc << "#{@tr.sourcefile_digest}, #{@md.dgst[0]} #{@md.dgst[1]} <~0;m#{ocnm};v#{ocnv}>" - ocnm+=1; ocnv+=1 - end - if @md.dgst_skin #change. enable by default - @rc << "Skin_Digest: #{@md.dgst_skin[0]} #{@md.dgst_skin[1]} <~0;m#{ocnm};v#{ocnv}>" - ocnm+=1; ocnv+=1 - end - @rc << "Generated #{head_no_rc}" if @rc.length > 0 - @rc << "#{@tr.last_generated}: #{Time.now} <~0;m#{ocnm};v#{ocnv}>" - ocnm+=1; ocnv+=1 - if @md.sisu_version[:version] - @rc << "#{@tr.sisu_version}: #{@md.sisu_version[:project]} #{@md.sisu_version[:version]} of #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]}) <~0;m#{ocnm};v#{ocnv}>" - ocnm+=1; ocnv+=1 - end - @rc << "#{@tr.ruby_version}: #{@md.ruby_version} <~0;m#{ocnm};v#{ocnv}>" - end - meta << header0 - meta << header1 - meta << header4 - meta << "Document Manifest @\n #{base_html}/#{@md.fn[:manifest]} <~0;m#{ocnm};m#{ocnm}>" - meta << "Dublin Core (DC) #{head_no_dc}" if @dc.length > 0 - meta << "DC tags included with this document are provided here. #{head_no_dc_tag}" if @dc.length > 0 - @dc.each { |x| meta << x } - meta << "Version Information #{head_no_rc}" if @rc.length > 0 - if @cvs.length > 0 - meta << "Note the version information provided here, is specific to the host site. #{head_no_rc_tag}" - @cvs.each { |x| meta << x } - end - @rc.each { |x| meta << x } - ## ENDNOTE RELATED endnote related - meta << "\n" - meta=SiSU_DAL::Make.new(@md,meta).object_digest - end - def stamped(para,hash_class) - @tuned=[] - para=strip_clean_extra_spaces(para) - digest_all=hash_class.hexdigest(para) # print "#{hash_class.name}: "; puts digest_all #length==32 or 64 - stripped=strip_clean_of_markup(para) - digest_strip=hash_class.hexdigest(stripped) - case para - when /~\{[\d*+]+\s+.+?\}~|~\[[*+]\d+\s+.+?\]~/ - en_and_para,en_and_para_digest=[],[] - para.gsub!(/\s*(\}~|\]~)/,' \1') #watch - para_plus_en=para.scan(/.*?~\{.+?\}~|.*?~\[.+?\]~/) - para_tail=if para =~/(?:.*?~\{.+?\}~|.*?~\[.+?\]~)+([\s\S]+)/ - /(?:.*?~\{.+?\}~|.*?~\[.+?\]~)+(.+?<~\d+;(?:\w|[0-6]:)\d+;\w\d+>)/.match(para)[1] - else '' - end - para_plus_en << para_tail - en_and_para_digest << SiSU_DAL::Make.new(@md,para_plus_en).endnote_digest - para_new=en_and_para_digest.join(' ') - @tuned << para_new + '<' + digest_strip + ':' + digest_all + '>' unless para.nil? - else @tuned << para + '<' + digest_strip + ':' + digest_all + '>' unless para.nil? - end - @tuned.join - end - def object_digest - # 1. clean/stripped text without any markup, paragraph, headings etc. without endnotes - # 2. endnotes clean/stripped text digest only (there may be several endnotes within a paragraph) - # 3. whole object, text with markup and any endnotes, (question: with or without the endnote digests??? presumption better without, [however may be easier to check with?]) - # [digests should not include other digests] - # vim==/<[0-9a-f]\{#{@@dl}\}\(:[0-9a-f]\{#{@@dl}\}\)\?>/ - require 'digest/md5' - require 'digest/sha2' - data=@data - @tuned_file=[] - data.each do |para| - if para=~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+>/ - if @env.digest.type =~/sha256/ - for hash_class in [ Digest::SHA256 ] - @tuned_file << stamped(para,hash_class) - end - else - for hash_class in [ Digest::MD5 ] - @tuned_file << stamped(para,hash_class) - end - end - else @tuned_file << para unless para.nil? - end - end - @tuned_file - #use md5 or to create hash of each dal object including ocn, & add into to each dal object - end - def endnote_digest - data=@data - para_bit=[] - data.each do |en_plus| - para_bit <<= case en_plus - when /~\{|~\[/ - if en_plus =~/~\{.+?\}~|~\[.+?\]~/ - para_txt,en_open,en_txt,en_close=/(.*?)(~\{|~\[)(.+?)(\}~|\]~)/m.match(en_plus)[1..4] - stripped_en=strip_clean_of_markup(en_txt) - if @env.digest.type =~/sha256/ - digest_en_strip=Digest::SHA256.hexdigest(stripped_en) - else - digest_en_strip=Digest::MD5.hexdigest(stripped_en) - end - para_txt + en_open + en_txt + '<' + digest_en_strip + '>' + en_close - else puts "Error Exception - problem encountered with:\n#{en_plus}" #arbitrary exception, tidy up - end - else en_plus - end - end - para_bit.join - end - def strip_clean_extra_spaces(s) # dal output tuned - s=s.dup - s=s.gsub(/[ ]+([,.;:?](?:$|\s))/,'\1') - s=s.gsub(/ [ ]+/,' ') - s=s.gsub(/^ [ ]+/,'') - s=s.gsub(/ [ ]+$/,'') - s=s.gsub(/(<\/[bi]>')[ ]+(s )/,'\1\2') - end - def strip_clean_of_markup(s) # used for digest, define rules, make same as in db clean - #consider: <\/?[ib]>|<(?:\/ )?br>|(.+?)<\/del> - s=s.dup - s=s.gsub(/(?:<\/?[ib]>|<~\d+;(?:\w|[0-6]:)\d+;\w\d+>|<#@dp:#@dp>|^[1-6]~\S+|~\{\d+\s.+?\}~)/,'') # markup and endnotes removed - #% same as db clean --> - s=s.gsub(/(.+?)<\/del>/,'DELETED(\1)') # deletions - s=s.gsub(/(\d+)<\/sup>/,'[\1]') - s=s.gsub(/(?: \\;)+/,' ') - #s=s.gsub(//,"[TABLE]\n") # tables - #s=s.gsub(//,'\1') # tables - #s=s.gsub(/¡¡\d+¡/,' ') # tables - #s=s.gsub(/¡/,' ') # tables tidy later - #s=s.gsub(/<.+?>/,'') - s=s.gsub(/\{.+?\.(?:png|jpg|gif).+?\}(?:https?|ftp)\\\:\S+ /,' [image] ') # else image names found in search - s=s.gsub(/\s\s+/,' ') - s=s.strip - end - end -end -__END__ -dal output, rules to simplify parsing -nodes === objects === paragraphs === text blocks separated by \n\n - -dal output: -:verse :group and :code have -end -:table is not used diff --git a/lib/sisu/0.52/dal_doc_str.rb b/lib/sisu/0.52/dal_doc_str.rb deleted file mode 100644 index b2b18ca8..00000000 --- a/lib/sisu/0.52/dal_doc_str.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: xml output (sax style) processing - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com - - * Notes: tidy -xml sax.xml >> index.tidy -=end -module SiSU_document_structure - require SiSU_lib + '/dal_doc_str_tables' - require SiSU_lib + '/dal_doc_str_code' - class Structure - def initialize(md,para) - @md,@para=md,para - end - def structure - structure_markup_normalize - structure_markup - @para - end - def structure_markup - @para=unless @para =~/[0-6]~/ - @para=case @para - when /^\s*#{@md.lv1}/; @para.sub!(/(?:<[:!]1!?>\s*)?(.+)/,'1~ \1') if @para !~/^1~/ - when /^\s*#{@md.lv2}/; @para.sub!(/(?:<[:!]2!?>\s*)?(.+)/,'2~ \1') if @para !~/^2~/ - when /^\s*#{@md.lv3}/; @para.sub!(/(?:<[:!]3!?>\s*)?(.+)/,'3~ \1') if @para !~/^3~/ - when /^\s*#{@md.lv4}/; @para.sub!(/(?:<[:!]4!?>\s*)?(.+)/,'4~ \1') if @para !~/^4~/ - when /^\s*#{@md.lv5}/; @para.sub!(/(?:<[:!]5!?>\s*)?(.+)/,'5~ \1') if @para !~/^5~/ - when /^\s*#{@md.lv6}/; @para.sub!(/(?:<[:!]6!?>\s*)?(.+)/,'6~ \1') if @para !~/^6~/ - else @para - end - else @para - end - end - def structure_markup_normalize - para=if @md.markup_version.to_f >= 0.38 #%convert internal representation, consider making 0.38 structure default ([A-C1-6] instead of [1-9]), requires downstream changes - #keep and implement, requires downstream changes: - #@para.gsub!(/^6~/,'9~') - #@para.gsub!(/^5~/,'8~') - #@para.gsub!(/^4~/,'7~') - @para.gsub!(/^[456]~/,'!_') - @para.gsub!(/^3~/,'6~') - @para.gsub!(/^2~/,'5~') - @para.gsub!(/^1~/,'4~') - @para.gsub!(/^:?C~/,'3~') - @para.gsub!(/^:?B~/,'2~') - @para.gsub!(/^:?A~/,'1~') - @para=if @para =~/^@(?:level|markup):\s/ - @para.gsub!(/3/,'6') - @para.gsub!(/2/,'5') - @para.gsub!(/1/,'4') - @para.gsub!(/:?C/,'3') - @para.gsub!(/:?B/,'2') - @para.gsub!(/:?A/,'1') - @para - else @para - end - else @para - end - end - end - class Struct - def initialize(o) - @o=o - end - def structure - def txt - @o[:txt] - end - def node - @o[:node] - end - def ocn - @o[:ocn] - end - def lv - @o[:lv] - end - def type - @o[:type] - end - self - end - end - class OCN - def initialize(md,data) - @md,@data=md,data - end - def ocn #and auto segment numbering increment - data=@data - @o_array=[] - node=ocn=ocn_dv=ocn_sp=ocnh=ocnh1=ocnh2=ocnh3=ocnh4=ocnh5=ocnh6=ocno=ocnp=ocnt=ocnc=ocng=ocni=ocnm=ocnu=ocnk=0 # h heading, o other, t table, g group, i image - number_small,letter_small=0,0 - letter=%w( a b c d e f g h i j k l m n o p q r s t u v w x y z ) - node_count_flag=false - headings='' #where headings omitted an alternative form of ocn heading numbering is required for html and other linking... - #headings=if @md.ocn.inspect =~/skip=headings/; '^(?:[A-C]|[1-9])~\S* |' - #else '' - #end - regex_exclude_ocn_and_node = /#{headings}^%{1,4}\s|^@\S+?:\s|^0~|^4~endnotes|^<\/center>|<:ee>|<:e[:_]>|^\^~ |<:e[:_]\d+?>|^<:p[bn]>|^<:\#|<:- |<[:!]!4|||||<\/tr>|
|\[endnotes\]|<:zz>|<:isbn-|<:journal-|<:conference-|/i #ocn here #  added with Tune.code #¡ - regex_exclude_ocn = /^(?:alt|code|group|poem|table)\{|^\}(?:alt|code|group|poem|table)|^\}table$/ #ocn here #  added with Tune.code #¡ - data.each do |para| - o={} - if para =~/\w|\S|<|\(/ - if para !~ regex_exclude_ocn_and_node - if node_count_flag or para=~/^1~/ - node_count_flag=true - end - node+=1 if node_count_flag - if para !~ regex_exclude_ocn # regex_exclude_large previously excluded - unless para=~/<:#>|~#|-#/ # |^\s*\*\s*\*\s*\*\s*$ <-consider leaving un-numbered - ocn+=1 - if para=~/^[1-8]~(?:\s+|\S)/ or para =~@md.lv1 or para =~@md.lv2 or para =~@md.lv3 or para =~@md.lv4 or para =~@md.lv5 or para =~@md.lv6 - ocnh+=1 - if para=~/^1~(?:\s+|\S)/ or para =~@md.lv1; ocnh1+=1 - ocn_dv,ocn_sp="1:#{ocnh1}","h#{ocnh}" - elsif para=~/^2~(?:\s+|\S)/ or para =~@md.lv2; ocnh2+=1 - ocn_dv,ocn_sp="2:#{ocnh2}","h#{ocnh}" - elsif para=~/^3~(?:\s+|\S)/ or para =~@md.lv3; ocnh3+=1 - ocn_dv,ocn_sp="3:#{ocnh3}","h#{ocnh}" - elsif para=~/^4~(?:\s+|\S)/ or para =~@md.lv4; ocnh4+=1 - ocn_dv,ocn_sp="4:#{ocnh4}","h#{ocnh}" - elsif para=~/^5~(?:\s+|\S)/ or para =~@md.lv5; ocnh5+=1 - ocn_dv,ocn_sp="5:#{ocnh5}","h#{ocnh}" - elsif para=~/^6~(?:\s+|\S)/ or para =~@md.lv6; ocnh6+=1 - ocn_dv,ocn_sp="6:#{ocnh6}","h#{ocnh}" - end - else - ocno+=1 - if para=~//; ocnt+=1 #tables - ocn_dv,ocn_sp="o#{ocno}","t#{ocnt}" - elsif para=~/^<:code>/; ocnc+=1 - ocn_dv,ocn_sp="o#{ocno}","c#{ocnc}" - elsif para=~/^<:(?:group|alt|verse)>/; ocng+=1 - ocn_dv,ocn_sp="o#{ocno}","g#{ocng}" - elsif para=~/\{\S+?\.(?:png|jpg|gif)\s+/m; ocni+=1 - ocn_dv,ocn_sp="o#{ocno}","i#{ocni}" - else ocnp+=1 - ocn_dv,ocn_sp="o#{ocno}","p#{ocnp}" - end - end - o[:txt],o[:node],o[:ocn],o[:lv],o[:type]=para,node,ocn,ocn_dv,ocn_sp - else ocnu+=1 - #if para=~/-#/ #if implemented would remove need to keep <-#> - # ocnk+=1 - # ocn_dv,ocn_sp="k#{ocnk}","u#{ocnu}" - #else - # ocn_dv,ocn_sp="u#{ocnu}","u#{ocnu}" - #end - #para.gsub!(/<~#>|<-#>/,'') if para #get rid of need - para.gsub!(/<~#>/,'') if para - ocn_dv,ocn_sp="u#{ocnu}","u#{ocnu}" - o[:txt],o[:node],o[:ocn],o[:lv],o[:type]=para,node,0,ocn_dv,ocn_sp - end - else o[:txt],o[:node],o[:ocn],o[:lv],o[:type]=para,node,nil,nil,nil - end - else - para=if para !~/^%{1,4}\s/ - o[:txt],o[:node],o[:ocn],o[:lv],o[:type]=para,node,nil,nil,nil - else '' - end - end - end - para.gsub!(/\n\n/,"\n") if para =~/<:(?:code|verse|alt|group)>/ #newlines taken out - para.gsub!(/(<:(?:code-end)>)/,"\n\\1") if para =~/<:(?:code-end)>/ #newlines added check - if para =~//,"\\1~#{o[:ocn]};#{o[:lv]};#{o[:type]}>") - end - @o_array << Struct.new(o).structure if o - end - @o_array - end - end - class Code < SiSU_document_structure_code::Code - end - class Tables < SiSU_document_structure_tables::Tables - end -end -__END__ diff --git a/lib/sisu/0.52/dal_doc_str_code.rb b/lib/sisu/0.52/dal_doc_str_code.rb deleted file mode 100644 index 46a466b6..00000000 --- a/lib/sisu/0.52/dal_doc_str_code.rb +++ /dev/null @@ -1,153 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: xml output (sax style) processing - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com - - * Notes: tidy -xml sax.xml >> index.tidy -=end -module SiSU_document_structure_code - class Instantiate < SiSU_Param::Parameters::Instructions - @@flag={} #Beware!! - def initialize - @@flag['table_to']=false - @@counter=@@column=@@columns=0 - @@line_mode='' - end - end - class Code - @@flag={} #Beware!! - def initialize(md,data) - @md,@data=md,data - Instantiate.new - end - def code - data=@data - tuned_file=[] - @tuned_group=[] - @@counter=0 - @verse_count=0 - data.each do |para| - para.gsub!(/(<:(?:code|verse|alt|group)>)\s/,'\1') #double check - para.gsub!(/(?:\n\s*\n)+/m,"\n") - if para =~/^code\{/ - @@flag['code']=true - @@counter=1 - para.gsub!(/^code\{.*/,'<:code>') - elsif para =~/^(?:poem)\{/ - @@flag['poem']=true - para.gsub!(/^(poem)\{.*/,'<:verse>') - elsif para =~/^(?:alt|group)\{/ #group not tested, stub 2005 - @@flag['group']=true - para.gsub!(/^(alt|group)\{.*/,'<:\1>') - end - if @@flag['code'] - if @@flag['code'] and para =~/^\}code/ - para.gsub!(/^\}code.*/,'<:code-end>') - @@flag['code']=false - end - if @@flag['code'] #or para =~/<:code-end>/ #and para =~/\S/ - sub_array=para.dup - @line_mode=sub_array.scan(/.+/) - SiSU_document_structure_code::Code.new(@md,@line_mode).code_lines('code') - para=@line_mode.join - end - elsif @@flag['poem'] or @@flag['group'] - if @@flag['poem'] and para =~/^\}(?:poem)/ - para.gsub!(/^\}(poem).*/,"\n<:verse-end>") - @@flag['poem']=false - elsif @@flag['group'] and para =~/^\}(?:alt|group)/ - para.gsub!(/^\}(alt|group).*/,'<:\1-end>') - @@flag['group']=false - end - if @@flag['poem'] or @@flag['group'] and para =~/\S/ \ - and para !~/<:(verse|code|alt|group)(-end)?>/ - sub_array=para.dup - @line_mode=sub_array.scan(/.+/) - type=if @@flag['poem']; 'poem' - else 'group' - end - SiSU_document_structure_code::Code.new(@md,@line_mode).code_lines(type) - div=if @@flag['poem'] and @verse_count > 0 - "\n" + '<:verse-end>' + "\n\n" + '<:verse>' - else '' - end - @verse_count+=1 if @@flag['poem'] - para = div + @line_mode.join - else para - end - end - if @@flag['code'] or @@flag['poem'] or @@flag['group'] - @tuned_group << para if para =~/\S+/ - elsif para =~/<:(?:code|alt|group|verse)-end>/ - @verse_count=0 - @tuned_group << para - if para =~/<:group-end>/ - tuned_file << @tuned_group.join("\n") - else - tuned_file << @tuned_group.join - end - @tuned_group=[] - else tuned_file << para - end - end - tuned_file - end - def code_lines(type='') - data=@data - data.each do |line| - if line =~/\S/ and line !~/^(?:alt|code|group|poem)\{|^\}(?:alt|code|group|poem)|<:(?:code|verse|alt|group).+/ - line.gsub!(/\s\s/,'  ') - line.gsub!(/^/,'<:codeline>') if type=='code' # try sort for texpdf special case - line.gsub!(/$/,'<:br>') #unless type=='code' - if @@flag['code']; @@counter+=1 - else - end - end - end - end - end -end -__END__ diff --git a/lib/sisu/0.52/dal_doc_str_tables.rb b/lib/sisu/0.52/dal_doc_str_tables.rb deleted file mode 100644 index e70490e5..00000000 --- a/lib/sisu/0.52/dal_doc_str_tables.rb +++ /dev/null @@ -1,180 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: xml output (sax style) processing - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com - - * Notes: tidy -xml sax.xml >> index.tidy -=end -module SiSU_document_structure_tables - class Instantiate < SiSU_Param::Parameters::Instructions - @@flag={} - def initialize - @@flag['table_to']=false - @@counter=@@column=@@columns=0 - @@line_mode='' - end - end - class Tables - @@flag={} - def initialize(md,data) - @md,@data=md,data - Instantiate.new - end - def table_visual(para) - count=0 - @row=[] - table=[] - @rows=para.split(/;;/) - @rows.compact! #(c\d+?;.+?) - @rows.each do |row| - count +=1 - @row[count]=row.split(/\|/) - end - @row.compact! - widths=if @row[0].to_s =~/^\{(?:t|table)(?:~h)?\s+\d+;/ - col_width=@row[0].to_s.scan(/\d+/) - rem=(100 - col_width[0].to_i) - col_w=rem/(@row[1].length - 1) - "#{col_width[0].to_s};" + ("#{col_w};" * (@row[1].length-1)) - else - col_w=100/@row[1].length - "#{col_w};" * @row[1].length - end - @row.delete_if {|r| r[0] =~/\{(?:table|t)(?:~h)?(?:\s+c\d+;)?[\d; ]*\}/} - w=widths.split(/;/) - tuned_file=[] - tuned_file << if para =~/\{(?:t|table)~h(?:\sc\d+;)?[\d; ]*\}/ - "" - elsif para =~/\{(?:t|table)(?:\sc\d+;)?[\d; ]*\}/ - "" - end - @row.each do |l| - l << '' if l.length == (@row[1].length - 1) - table=[] - if l.length == @row[1].length - table << '' - n= -1 - l.each do |c| - n +=1 #'' + c + '' - table << if c =~/\A(?:\n)?\s*\Z/ - "¡¡#{w[n]}¡" + ' ' - else - "¡¡#{w[n]}¡" + c.strip - end - end - table << '!>' #'' - tuned_file << table.join - end - end - tuned_file << '' #'' - tuned_file=tuned_file.compact.join("\n") - end - def tables - data=@data - count=0 - @row,@tuned_file,@tuned_table=[],[],[] - data.each do |para| - para.gsub!(/\n\s+\n/,"\n") - para.gsub!(/\s+\n/,"\n") - para.gsub!(/<:hi>/,'') # bright yellow rgb(255,255,0) pale yellow rgb(255,255,200) - para.gsub!(/<:\/hi>/,%{}) - table=[] - if para =~/^\{(?:t|table)(?:~h)?(?:\sc\d+;)?[\d; ]*\}/ - @tuned_file << table_visual(para) - @tuned_file=@tuned_file.flatten - elsif @@flag['table_to'] or para[/table\{(?:~h)?/] - if para[/table\{(?:~h)?\s+c(\d+;.+)/] - instructions=$1 - @@column=instructions.split(/;\s*/) - @@columns=@@column[0] - para.gsub!(/table\{~h\s+(c\d+?;.+?)$/,'') - para.gsub!(/table\{\s+(c\d+?;.+?)$/,'') - @@flag['table_to']=true - end - if @@flag['table_to'] and para =~/\}table/ - para.gsub!(/^\}table\s*$/,"\n") - para.gsub!(/\n/,' ') #newlines taken out - para.strip! - @tuned_table << para - @tuned_table.delete('') - @tuned_file << @tuned_table.compact.join("\n") #@tuned_table.compact.join =~/\S+/ #would be preferable - para='' - @tuned_table=[] - @@flag['table_to']=false - end - if @@flag['table_to'] and para =~/\S/ - @@counter=1 - sub_array=para.dup - @@line_mode=sub_array.scan(/.+/) - Tables.new(@md,@@line_mode).tr_td - para=@@line_mode.join - para.gsub!(/(.*\S+.*)\Z/m,'') unless para =~// - para.strip! - @tuned_file << para - end - @tuned_file - end - @tuned_file - end - def tr_td - data=@data - data.each do |line| - if @@counter <= @@columns.to_i and line !~/(\}T\s*$|<:table[-_](close|end)>|)/ - line.gsub!(/(.+)/,"¡¡#{@@column[@@counter]}¡\\1") unless line =~/|<:br>' - @manmkp_ital='[i/]\\{.+?\\}[i/]' - tail_m_ital=%q{(?:\s|[.,;:?!'")]|~\^|~\\\{\s|$)} - tail_m_bold=%q{(?:(?:<\/i>)?(?:\s|[.,;:?!'")]|~\^|~\\\{\s|$))?} - bold_line=%q{^!_\s.+?(?:\n|$)} - @line_scan_ital=if defined? @md.make_italic[:str] and defined? @vz.markup_make_italic[:str] - /#@http_m|#{bold_line}|#@manmkp_ital#{tail_m_ital}|(?:#{@md.make_italic[:str]}|#{@vz.markup_make_italic[:str]})#{tail_m_ital}|\S+|\n/ - elsif defined? @md.make_italic[:str] - /#@http_m|#{bold_line}|#@manmkp_ital#{tail_m_ital}|#{@md.make_italic[:str]}#{tail_m_ital}|\S+|\n/ - elsif defined? @vz.markup_make_italic[:str] - /#@http_m|#{bold_line}|#@manmkp_ital#{tail_m_ital}|#{@vz.markup_make_italic[:str]}#{tail_m_ital}|\S+|\n/ - end - @manmkp_bold='^!_\s.+?(?:\n|$)|[*!b]\\{.+?\\}[*!b]|[*!][a-zA-Z0-9\-_]+[*!]' - @line_scan_bold=if (defined? @md.make_bold[:str] and @md.make_bold[:str]) and (defined? @vz.markup_make_bold[:str] and @vz.markup_make_bold[:str]) - /#@http_m|#{bold_line}|(?:#@manmkp_bold|#{@md.make_bold[:str]}|#{@vz.markup_make_bold[:str]})#{tail_m_bold}|\S+|\n/ - elsif defined? @md.make_bold[:str] and @md.make_bold[:str] - /#@http_m|#{bold_line}|(?:#@manmkp_bold|#{@md.make_bold[:str]})#{tail_m_bold}|\S+|\n/ - elsif defined? @vz.markup_make_bold[:str] and @vz.markup_make_bold[:str] - /#@http_m|#{bold_line}|(?:#@manmkp_bold|#{@vz.markup_make_bold[:str]})#{tail_m_bold}|\S+|\n/ - end - end - def songsheet - @data.each do |line| - line=pre(line) - line=wordlist_italics(line) - line=wordlist_bold(line) - line=bodymarkup(line) - @data_new << line - end - @data_new - end - def pre(line) - line=line.dup - if line =~/\{(?:t|table)(?:~h)?\s*c?[\d; ]*\}/; line.gsub!(/(\n)/,';;\1') #markup for alternative tables - end - line - end - def wordlist_italics(line) - line=line.dup - if (defined? @md.make_italic[:str] and @md.make_italic[:str]) \ - or (defined? @vz.markup_make_italic[:str] and @vz.markup_make_italic[:str]) - line= if line !~/^(0~|%{1,4}\s)/ #!~/^(?:[0-6]~|!_|%+\s)/ - word=line.scan(@line_scan_ital) - word.flatten! - word.compact! #reinstated - line_array=[] - word.each do |w| - unless /#@manmkp_ital|#@http_m/.match(w) - if defined? @md.make_italic[:regx] and @md.make_italic[:regx] - w.gsub!(@md.make_italic[:regx],'\1') - elsif defined? @vz.markup_make_italic and @vz.markup_make_italic - w.gsub!(@vz.markup_make_italic,'\1') - end - end - line_array << w - end - line_array.join(' ') - else line - end - end - line - end - def embolden(given) - given.gsub!(/(?:^!_|^[789]~)\s+(.+?)\s+((?:[*]~\S+\s*)+)/,'\1 \2') - given.gsub!(/(?:^!_|^[789]~)\s+(.+?)\s*([~-]#)$/,'\1 \2') - given.gsub!(/(?:^!_\s+|^[789]~\s+)(.*)?\s*$/,'\1') - end - def wordlist_bold(line) - line=line.dup - if (defined? @md.make_bold[:str] and @md.make_bold[:str]) or (defined? @vz.markup_make_bold[:str] and @vz.markup_make_bold[:str]) - line=if line !~/^(?:[0-9]~|%+\s)/ - line_array=[] - word=line.scan(@line_scan_bold) - word.flatten! - word.compact! - word.each do |w| - unless /#@manmkp_bold|#@http_m/.match(w) - if defined? @md.make_bold[:regx] and @md.make_bold[:regx] #document header: 0~bold [bold word list] - w.gsub!(@md.make_bold[:regx],'\1') - elsif defined? @vz.markup_make_bold and @vz.markup_make_bold #defaults and skin adjusted bold word list - w.gsub!(@vz.markup_make_bold,'\1') - end - else - if w =~ /(?:^!_|^[789]~)\s+/; embolden(w) #bold paragraph/emphasize #may wish to remove think about 7{ 8{ conversion not satisfactory, as information is lost! - end - end - line_array << w - end - line_array.join(' ') - else line - end - else - if line !~/^(?:[0-9]~|%+\s)/ and line =~ /(?:^!_|^[789]~)\s+/; embolden(line) - end - end - line - end - def bodymarkup(line) - # << http://www.jus.uio.no/sisu/sisu_markup_table/markup >> - # See: data/sisu/sample/document_samples_sisu_markup/ - # !{emphasis}! e{emphasis}e emphasis - # *{bold text}* b{bold}b bold text - # _{underline}_ u{underline}u underline - # /{italics}/ i{italics}i italics - # "{citation}" c{citation}c citation #blockquote? - # ^{superscript}^ superscript - # ,{subscript}, subscript - # +{inserted text}+ inserted text - # -{deleted text}- deleted text - # {url address}:url - # {image.png}imageurl - # {image.png}png - # ~{endnote}~ - # !_ #bold/emphasise paragraph - # _" #blockquote paragraph - # _1 #indent paragraph 1 step - # _2 #indent paragraph 2 steps - # _* #bullet (list) - # _1* #bullet (list) indented - # _1* #bullet (list) indented - # # #numbered (list) level 1 - # _# #numbered (list) level 2 - line=line.dup - unless line =~/^0~|<:codeline>|<:code-end>/ - #special characters: ~ { } < > - _ / also used : ^ ! # - line_array=[] - line.gsub!(/^%{1,4} .+/mi,'') #remove comments - word=line.scan(/\S+|\n/) unless line =~/^(?:0~\S|%+\s)/ - if word - word.each do |w| # _ - / # | : ! ^ ~ - unless w =~/^[0-9]~|~\{|\}~|~\[|\]~|^\^~|~\^|\*~\S+|~#|\{t?~|\{table/ - w.gsub!(/\\~/,'~') #escaped special character - w.gsub!(/~/,'~') - end - w.gsub!(/^\<$/,'<') #escaped special character - w.gsub!(/^\>$/,'>') #escaped special character - line_array << w - end - line=line_array.join(' ') - line=line.strip - end - line.gsub!(/<(https?:\/\/\S+?)>/,'< \1 >') #catch problem markup - line.gsub!(/<:=(\S+?)>/,'{ c_\1.png 14x14 }http://www.jus.uio.no/sisu') #adjustment 2005w30 - line.gsub!(//,'<:\1>') #escaped special character - line.gsub!(/\\~/,'~') #escaped special character - line.gsub!(/\\\{/,'{') #escaped special character - line.gsub!(/\\\}/,'}') #escaped special character - line.gsub!(/\\\<>/,'>>') #escaped special character - line.gsub!(/\\\/,'>') #escaped special character - line.gsub!(/\\\_/,'_') #escaped special character - line.gsub!(/\\\-/,'-') #escaped special character - line.gsub!(/\\\+/,'+') #escaped special character - line.gsub!(/\\\//,'/') #escaped special character - line.gsub!(/\\\#/,'#') #escaped special character - line.gsub!(/\\\&/,'&') #& #escaped special character - line.gsub!(/\\\|/,'|') #not really a sisu special character but made available as possibility - line.gsub!(/\\\:/,':') #not really a sisu special character but made available as possibility - line.gsub!(/\\\!/,'!') #not really a sisu special character but made available as possibility - line.gsub!(/\\\^/,'^') #not really a sisu special character but made available as possibility - line.gsub!(/\\\,/,',') #not really a sisu special character but made available as possibility - #ADD --> - line.gsub!(/\\\\/,'\') #escaped special character - line.gsub!(/\\\*/,'*') #escaped special character - line.gsub!(/\\\!/,'!') #escaped special character - line.gsub!(/(?:^| )\*~([a-z0-9._-]+)/i,' <:name#\1>') #html name marker - line.gsub!(/^([56]~)(\S+)(.+)/,'\1\2 \3 <:name#\2>') #html name marker , however at present takes you to correct position within sub-toc, will nneed to clean from sub-toc leaving in main body only - line.gsub!(/(^| )\{~\^ (.+?)\s*\}((?:https?|ftp):\S+)\s+~\{(.+?)\}~/,'\1{ \2 }\3 ~{ \3 \4 }~') # watch - line.gsub!(/(^| )\{~\^ (.+?)\s*\}((?:https?|ftp):\S+?)(,?)?(?:\s|$)/,'\1{ \2 }\3\4 ~{ \3 }~ ') #text url endnote url shortcut {~^ [text] }http://url is { [text] }http://url ~{ http://url }~ [plus adjustment for commas] - line.gsub!(/<:?br>/,'
') #xml requires - # depreciated --> - line.gsub!(/(^|\s+|['"]| |[\(\[\{]|\>)e\{(.+?)\}e/,'\1\2') #emphasis - line.gsub!(/(^|\s+|['"]| |[\(\[\{]|\>)b\{(.+?)\}b/,'\1\2') #bold - line.gsub!(/(^|\s+|['"]| |[\(\[\{]|\>)u\{(.+?)\}u/,'\1\2') #underscore - line.gsub!(/(^|\s+|['"]| |[\(\[\{]|\>)c\{(.+?)\}c/,'\1\2') #cite /blockquote? - line.gsub!(/(^|\s+|['"]| |[\(\[\{]|\>)i\{(.+?)\}i/,'\1\2') #italics - # depreciated ^ - line.gsub!(/(^|\s+|['"]| |[\(\[\{]|\>)!\{(.+?)\}!/,'\1\2') #emphasis - line.gsub!(/(^|\s+|['"]| |[\(\[\{]|\>)\*\{(.+?)\}\*/,'\1\2') #bold - line.gsub!(/(^|\s+|['"]| |[\(\[\{]|\>)_\{(.+?)\}_/,'\1\2') #underscore - line.gsub!(/(^|\s+|['"]| |[\(\[]|\(|\>)\/\{(.+?)\}\//,'\1\2') #italics - line.gsub!(/(^|\s+|['"]| |\(|\>)\"\{(.+?)\}\"/,'\1\2') #cite /blockquote? - line.gsub!(/(^|[^\\])\^\{(.+?)\}\^/,'\1\2') #superscript - line.gsub!(/(^|\s+|['"]| |\(|\>|\S)9\{(.+?)\}9/,'\1\2') #superscript - line.gsub!(/(^|[^\\]),\{(.+?)\},/,'\1\2') #subscript - line.gsub!(/(^|\s+|['"]| |\(|\>)6\{(.+?)\}6/,'\1\2') #subscript - line.gsub!(/(^|\s+|['"]| |\(|\>)\+\{(.+?)\}\+/,'\1\2') #inserted text - line.gsub!(/(^|\s+|['"]| |\(|\>)v\{(.+?)\}v/,'\1\2') #inserted text - line.gsub!(/(^|\s+|['"]| |\(|\>)-\{(.+?)\}-/,'\1\2') #strikethrough - deleted text - line.gsub!(/(^|\s+|['"]| |\(|\>)x\{(.+?)\}x/,'\1\2') #deleted text - line.gsub!(/(^|\s+|['"]| |\(|\>)\*(\S+?)\*/,'\1\2') #bold single word, watch - line.gsub!(/(^|\s+|['"]| |\(|\>)\!(\S+?)\!/,'\1\2') #bold single word, watch - line.gsub!(/(^|\s+|['"]| |\(|\>)\/([\(\)a-zA-Z0-9']+?)\/([^a-zA-Z0-9]|[ ,.;:'"~$]|$)/,'\1\2\3') #italics single word, watch - line.gsub!(/(^|\s+|['"]| |\(|\>)_(\S+?)_/,'\1\2') #underscore single word, watch - line.gsub!(/(^|\s+)-([^{]\S+?)-( |$)/,'\1\2\3') #underscore single word, watch - line.gsub!(/(^|\s+|['"]| |\(|\>|\d+)\^(\S+?)\^/,'\1\2') #superscript single word, watch digit added - line.gsub!(/<[:e]\s+(.+?)!?>/,'~{ \1 }~') # not tested - line.gsub!(/^\s*_([12])(\*+)\s*/,'<:i\1> _* ') #bullets, shortcut - line.gsub!(/^\s*_([12])\s+/,'<:i\1> ') #indent - line.gsub!(/(?:
|
)\s*_[12]\s+/,'
') #indent used in endnotes, not implemented, replace when ready with: line.gsub!(/(?:
|
)\s*_([12])\s+/,'
<:i\1> ') - #line.gsub!(/^\s*_([12])\s+/,"<:i\\1> ") - #line.gsu!b!(/^\s*_([12])\s+/," ") #indent line - line.gsub!(/<:?br>/,'
') #adjustment 2004w41, from # line.gsub!(/
/,'
') - ##added - #line.gsub!(/(?:^!_\s+|^[78]~\s+|<:b>)(.*)?([~-]#)$/i,"\\1 \\2") #bold paragraph/emphasize #may wish to remove think about 7{ 8{ conversion not satisfactory, as information is lost! - #line.gsub!(/(?:^!_\s+|^[78]~\s+|<:b>)(.*)?\s*$/i,"\\1") #bold paragraph/emphasize #may wish to remove think about 7{ 8{ conversion not satisfactory, as information is lost! - #line.gsub!(/(?:(?:^| )!_ |^[78]~ |<:b>)(.*)\n/mi,"\\1 ") #bold paragraph/emphasize #may wish to remove think about 7{ 8{ conversion not satisfactory, as information is lost! - #line.gsub!(/^_" (.*)\n/i,"
\\1
") #blockquotes #introduce KEEP - line.gsub!(/<:hi>/,'') # bright yellow rgb(255,255,0) pale yellow rgb(255,255,200) - line.gsub!(/<:\/hi>/,'') - line.gsub!(/(<:verse>.+)/m,"\\1\n") - line.gsub!(/[ ]+($)/,'\1') - if line =~/(<:(?:verse|group)>)/; line.gsub!(/(<:(?:verse|group)>)/i,"\\1\n") #cosmetic - else line.gsub!(/(
)/i,"\\1\n") - end - else - line.gsub!(/<:codeline>/,"\n") - end - line - end - def tech #script markup planned to be more strict for technical documents - # !{emphasis}! e{emphasis}e emphasis - # *{bold text}* b{bold}b bold text - # _{underline}_ u{underline}u underline - # /{italics}/ i{italics}i italics - # "{citation}" c{citation}c citation - # ^{superscript}^ superscript - # ,{subscript}, subscript - # +{inserted text}+ inserted text - # -{deleted text}- deleted text - # {url address}:url - # {image.png}imageurl - # {image.png}png - # ~{endnote}~ - # +1 - # +2 - puts 'tech' - @data.each do |line| - line.gsub!(/(^|\s+|['"]|[\(\[]|\>)e\{(.+?)\}e/,'\1\2') #emphasis - line.gsub!(/(^|\s+|['"]|[\(\[]|\>)b\{(.+?)\}b/,'\1\2') #bold - line.gsub!(/(^|\s+|['"]|[\(\[]|\>)u\{(.+?)\}u/,'\1\2') #underscore - line.gsub!(/(^|\s+|['"]|[\(\[]|\>)c\{(.+?)\}c/,'\1\2') #cite - line.gsub!(/(^|\s+|['"]|[\(\[]|\>)i\{(.+?)\}i/,'\1\2') #italics - line.gsub!(/(^|\s+|['"]|[\(\[]|\>)!\{(.+?)\}!/,'\1\2') #emphasis - line.gsub!(/(^|\s+|['"]|[\(\[]|\>)\*\{(.+?)\}\*/,'\1\2') #bold - line.gsub!(/(^|\s+|['"]|[\(\[]|\>)_\{(.+?)\}_/,'\1\2') #underscore - line.gsub!(/(^|\s+|['"]|[\(\[]|\(|\>)\/\{(.+?)\}\//,'\1\2') #italics - line.gsub!(/(^|\s+|['"]|\(|\>)\"\{(.+?)\}\"/,'\1\2') - line.gsub!(/(^|\s+|['"]|\(|\>|\S)\^\{(.+?)\}\^/,'\1\2') - line.gsub!(/(^|\s+|['"]|\(|\>|\S)9\{(.+?)\}9/,'\1\2') - line.gsub!(/(^|\s+|['"]|\(|\>),\{(.+?)\},/,'\1\2') - line.gsub!(/(^|\s+|['"]|\(|\>)6\{(.+?)\}6/,'\1\2') - line.gsub!(/(^|\s+|['"]|\(|\>)\+\{(.+?)\}\+/,'\1\2') - line.gsub!(/(^|\s+|['"]|\(|\>)v\{(.+?)\}v/,'\1\2') - line.gsub!(/(^|\s+|['"]|\(|\>)-\{(.+?)\}-/,'\1\2') - line.gsub!(/(^|\s+|['"]|\(|\>)x\{(.+?)\}x/,'\1\2') - line.gsub!(/(^|\s+|['"]|\(|\>)\*(\S+?)\*/,'\1\2') #bold single word, watch - line.gsub!(/(^|\s+|['"]|\(|\>)\!(\S+?)\!/,'\1\2') #bold single word, watch - line.gsub!(/(^|\s+|['"]|\(|\>)\/([\(\)a-zA-Z0-9']+?)\/([ ,.;:'"~$]|[^a-zA-Z0-9])/,'\1\2\3') #italics single word, watch - line.gsub!(/(^|\s+|['"]|\(|\>)_(\S+?)_/,'\1\2') #underscore single word, watch - line.gsub!(/(^|\s+|['"]|\(|\>|\d+)\^(\S+?)\^/,'\1\2') #superscript single word, watch digit added - line.gsub!(/^\s*_([12])(\*+)\s*/,"<:i\\1> _* ") # bullets, shortcut - line.gsub!(/^\s*_([12])\s+/,'<:i\1> ') - line.gsub!(/<:?br>/,'
') - end - @data - end - end -end -__END__ diff --git a/lib/sisu/0.52/db_columns.rb b/lib/sisu/0.52/db_columns.rb deleted file mode 100644 index 295e1ae2..00000000 --- a/lib/sisu/0.52/db_columns.rb +++ /dev/null @@ -1,209 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: modules shared by the different db types, dbi, postgresql, sqlite - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_DB_columns - class Column_size - def lt_title - 320 - end - def lt_subtitle - 320 - end - def lt_creator - 200 - end - def lt_illustrator - 200 - end - def lt_translator - 200 - end - def lt_prepared_by - 200 - end - def lt_digitized_by - 200 - end - def lt_subject - 400 - end - def lt_date - 10 - end - def lt_date_created - 10 - end - def lt_date_issued - 10 - end - def lt_date_available - 10 - end - def lt_date_modified - 10 - end - def lt_date_valid - 10 - end - def lt_type - 100 - end - def lt_description - 800 - end - def lt_publisher - 120 - end - def lt_contributor - 120 - end - def lt_format - 100 - end - def lt_identifier - 100 - end - def lt_source - 100 - end - def lt_language - 30 - end - def lt_language_char - 3 - end - def lt_language_original - 30 - end - def lt_language_original_char - 3 - end - def lt_relation - 100 - end - def lt_coverage - 100 - end - def lt_rights - 800 - end - def lt_copyright - 200 - end - def lt_owner - 100 - end - def lt_keywords - 200 - end - def lt_comment - 600 - end - def lt_loc - 30 - end - def lt_dewey - 30 - end - def lt_isbn - 16 - end - def lt_pg - 10 - end - def lt_abstract - 600 - end - def lt_skin - 100 - end - def lt_markup - 100 - end - def lt_links - 100 - end - def lt_information - 100 - end - def lt_contact - 100 - end - def lt_suffix - 600 - end - def lt_filename - 256 - end - def lt_types - 1 - end - def lt_subj - 64 - end - def document_clean # restriction not necessary #12000 #2712 - 60000 - end - def document_body - 16000 - end - def document_seg - 120 - end - def document_seg_full - 120 - end - def endnote_clean # restriction not necessary #12000 #2712 - 60000 - end - def endnote_body - 16000 - end - end -end -__END__ diff --git a/lib/sisu/0.52/db_create.rb b/lib/sisu/0.52/db_create.rb deleted file mode 100644 index d5fab27d..00000000 --- a/lib/sisu/0.52/db_create.rb +++ /dev/null @@ -1,530 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: modules shared by the different db types, dbi, postgresql, sqlite - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_DB_create - require SiSU_lib + '/db_columns' - class Create < SiSU_DB_columns::Column_size - require SiSU_lib + '/sysenv' - @@dl=nil - def initialize(opt,conn='',sql_type='pg') - @opt,@conn,@sql_type=opt,conn,sql_type - @cX=SiSU_Screen::Ansi.new(@opt.cmd).cX - @comment=comment - @@dl ||=SiSU_Env::Info_env.new.digest.length - end - def available - DBI.available_drivers.each do |driver| - puts "Driver: #{driver}" - DBI.data_sources(driver).each do |dsn| - puts "\tDatasource: #{dsn}" - end - end - end - def create_db - @env=SiSU_Env::Info_env.new(@opt.fns) - tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Create PG db:',%{"SiSU_#{@env.path.stub_pwd}"}) - tell.colorize unless @opt.cmd =~/q/ - SiSU_Env::System_call.new.create_pg_db(@env.path.stub_pwd) #watch use of path.stub_pwd instead of stub - end - def comment - @comment=Hash.new('') - case @sql_type - when /pg/ - @comment['metadata'] =%{ - COMMENT ON Table metadata - IS 'contains SiSU documents metadata with metadata'; - COMMENT ON COLUMN metadata.tid - IS 'unique'; - COMMENT ON COLUMN metadata.filename - IS 'document filename'; - COMMENT ON COLUMN metadata.title - IS 'metadata title (dublin core element 1)'; - COMMENT ON COLUMN metadata.subtitle - IS 'document subtitle'; - COMMENT ON COLUMN metadata.creator - IS 'metadata creator (dublin core element 2)'; - COMMENT ON COLUMN metadata.illustrator - IS 'metadata illustrator'; - COMMENT ON COLUMN metadata.translator - IS 'metadata translator'; - COMMENT ON COLUMN metadata.subject - IS 'metadata subject (dublin core element 3)'; - COMMENT ON COLUMN metadata.date - IS 'metadata date (dublin core element 7)'; - COMMENT ON COLUMN metadata.date_created - IS 'metadata date created (dublin core)'; - COMMENT ON COLUMN metadata.date_issued - IS 'metadata date of issue (dublin core)'; - COMMENT ON COLUMN metadata.date_available - IS 'metadata date available (dublin core)'; - COMMENT ON COLUMN metadata.date_valid - IS 'metadata date valid (dublin core)'; - COMMENT ON COLUMN metadata.date_modified - IS 'metadata date modified (dublin core)'; - COMMENT ON COLUMN metadata.type - IS 'metadata type (dublin core element 8)'; - COMMENT ON COLUMN metadata.description - IS 'metadata description (dublin core element 4)'; - COMMENT ON COLUMN metadata.publisher - IS 'metadata publisher (dublin core element 5)'; - COMMENT ON COLUMN metadata.contributor - IS 'metadata contributor (dublin core element 6)'; - COMMENT ON COLUMN metadata.prepared_by - IS 'metadata markup prepared by'; - COMMENT ON COLUMN metadata.digitized_by - IS 'metadata digitized by'; - COMMENT ON COLUMN metadata.format - IS 'metadata format (dublin core element 9)'; - COMMENT ON COLUMN metadata.identifier - IS 'metadata identifier (dublin core element 10)'; - COMMENT ON COLUMN metadata.source - IS 'metadata source (dublin core element 11)'; - COMMENT ON COLUMN metadata.language - IS 'metadata language (dublin core element 12)'; - COMMENT ON COLUMN metadata.language_original - IS 'metadata original language'; - COMMENT ON COLUMN metadata.relation - IS 'metadata (dublin core element 13)'; - COMMENT ON COLUMN metadata.coverage - IS 'metadata coverage (dublin core element 14)'; - COMMENT ON COLUMN metadata.rights - IS 'metadata rights / copyright / license (dublin core element 15)'; - COMMENT ON COLUMN metadata.owner - IS 'metadata owner'; - COMMENT ON COLUMN metadata.keywords - IS 'metadata keywords'; - COMMENT ON COLUMN metadata.comment - IS 'metadata comment'; - COMMENT ON COLUMN metadata.abstract - IS 'metadata abstract'; - COMMENT ON COLUMN metadata.loc - IS 'metadata library of congress'; - COMMENT ON COLUMN metadata.dewey - IS 'metadata dewey'; - COMMENT ON COLUMN metadata.isbn - IS 'metadata isbn'; - COMMENT ON COLUMN metadata.pg - IS 'metadata project gutenberg number'; - COMMENT ON COLUMN metadata.prefix_a - IS 'metadata prefix'; - COMMENT ON COLUMN metadata.prefix_b - IS 'metadata prefix'; - COMMENT ON COLUMN metadata.skin - IS 'metadata sisu skin'; - COMMENT ON COLUMN metadata.markup - IS 'metadata markup source'; - COMMENT ON COLUMN metadata.links - IS 'metadata links'; - COMMENT ON COLUMN metadata.information - IS 'metadata information'; - COMMENT ON COLUMN metadata.contact - IS 'metadata contact'; - COMMENT ON COLUMN metadata.suffix - IS 'metadata sisu suffix (output related)'; - COMMENT ON COLUMN metadata.filename - IS 'metadata source filename'; - COMMENT ON COLUMN metadata.types - IS 'document types scroll 1, seg 2, both 3'; - COMMENT ON COLUMN metadata.subj - IS 'subject areas - no way to populate at present as not mapped'; -/* - CREATE FUNCTION fileremoval() RETURNS opaque AS ' - BEGIN - DELETE FROM metadata WHERE tid=#@removetid; - DELETE FROM documents WHERE documents.metadata_tid=#@removetid; - DELETE FROM endnotes WHERE endnotes.metadata_tid=#@removetid; - DELETE FROM endnotes_asterisk WHERE endnotes_asterisk.metadata_tid=#@removetid; - DELETE FROM endnotes_plus WHERE endnotes_plus.metadata_tid=#@removetid; - DELETE FROM urls WHERE urls.metadata_tid=#@removetid; - END; - ' LANGUAGE 'plpgsql'; - CREATE TRIGGER removefile AFTER INSERT - PROCEDURE fileremoval(); -*/ - } - @comment['documents'] =%{ - COMMENT ON Table documents - IS 'contains searchable text of SiSU documents'; - COMMENT ON COLUMN documents.lid - IS 'unique'; - COMMENT ON COLUMN documents.metadata_tid - IS 'tie to title in metadata'; - COMMENT ON COLUMN documents.lev - IS 'doc level 1-6 \d\~'; - COMMENT ON COLUMN documents.seg - IS 'segment name from level 4'; - COMMENT ON COLUMN documents.ocn - IS 'object citation number'; - COMMENT ON COLUMN documents.en_a - IS 'first endnote number in text object (eg. NULL or 34) (used with en_z to create range)'; - COMMENT ON COLUMN documents.en_z - IS 'last endnote number within text object (eg. NULL, 34 or say 47) (used with en_a to create range)'; - COMMENT ON COLUMN documents.en_a_asterisk - IS 'first endnote number in text object (eg. NULL or 34) (used with en_z_asterisk to create range)'; - COMMENT ON COLUMN documents.en_z_asterisk - IS 'last endnote number within text object (eg. NULL, 34 or say 47) (used with en_a_asterisk to create range)'; - COMMENT ON COLUMN documents.en_a_plus - IS 'first endnote number in text object (eg. NULL or 34) (used with en_z_plus to create range)'; - COMMENT ON COLUMN documents.en_z_plus - IS 'last endnote number within text object (eg. NULL, 34 or say 47) (used with en_a_plus to create range)'; - COMMENT ON COLUMN documents.types - IS 'document types seg scroll'; - COMMENT ON COLUMN documents.clean - IS 'text object - substantive text: clean, stripped of markup'; - COMMENT ON COLUMN documents.body - IS 'text object - substantive text: light html markup'; - COMMENT ON COLUMN documents.lev1 - IS 'document structure, level 1'; - COMMENT ON COLUMN documents.lev2 - IS 'document structure, level 2'; - COMMENT ON COLUMN documents.lev3 - IS 'document structure, level 3'; - COMMENT ON COLUMN documents.lev4 - IS 'document structure, level 4'; - COMMENT ON COLUMN documents.lev5 - IS 'document structure, level 5'; - COMMENT ON COLUMN documents.lev6 - IS 'document structure, level 6'; - } - @comment['endnotes'] =%{ - COMMENT ON Table endnotes - IS 'contains searchable text of SiSU documents endnotes'; - COMMENT ON COLUMN endnotes.nid - IS 'unique'; - COMMENT ON COLUMN endnotes.document_lid - IS 'ties to text block from which referenced'; - COMMENT ON COLUMN endnotes.nr - IS 'endnote number '; - COMMENT ON COLUMN endnotes.clean - IS 'endnote substantive content, stripped of markup'; - COMMENT ON COLUMN endnotes.body - IS 'endnote substantive content'; - COMMENT ON COLUMN endnotes.ocn - IS 'object citation no# <\~(\d+)> from which endnote is referenced'; - COMMENT ON COLUMN documents.metadata_tid - IS 'tie to title in metadata - unique for each document'; - } - @comment['endnotes_asterisk'] =%{ - COMMENT ON Table endnotes_asterisk - IS 'contains searchable text of SiSU documents endnotes asterisk'; - COMMENT ON COLUMN endnotes_asterisk.nid - IS 'unique'; - COMMENT ON COLUMN endnotes_asterisk.document_lid - IS 'ties to text block from which referenced'; - COMMENT ON COLUMN endnotes_asterisk.nr - IS 'endnote number '; - COMMENT ON COLUMN endnotes_asterisk.clean - IS 'endnote substantive content, stripped of markup'; - COMMENT ON COLUMN endnotes_asterisk.body - IS 'endnote substantive content'; - COMMENT ON COLUMN endnotes_asterisk.ocn - IS 'object citation no# <\~(\d+)> from which endnote is referenced'; - COMMENT ON COLUMN documents.metadata_tid - IS 'tie to title in metadata - unique for each document'; - } - @comment['endnotes_plus'] =%{ - COMMENT ON Table endnotes_plus - IS 'contains searchable text of SiSU documents endnotes'; - COMMENT ON COLUMN endnotes_plus.nid - IS 'unique'; - COMMENT ON COLUMN endnotes_plus.document_lid - IS 'ties to text block from which referenced'; - COMMENT ON COLUMN endnotes_plus.nr - IS 'endnote number '; - COMMENT ON COLUMN endnotes_plus.clean - IS 'endnote substantive content, stripped of markup'; - COMMENT ON COLUMN endnotes_plus.body - IS 'endnote substantive content'; - COMMENT ON COLUMN endnotes_plus.ocn - IS 'object citation no# <\~(\d+)> from which endnote is referenced'; - COMMENT ON COLUMN documents.metadata_tid - IS 'tie to title in metadata - unique for each document'; - } - @comment['urls'] =%{ - COMMENT ON Table urls - IS 'contains base url links to different SiSU output'; - COMMENT ON COLUMN documents.metadata_tid - IS 'tie to title in metadata - unique for each document, the mapping of rows is one to one'; - COMMENT ON COLUMN urls.plaintext - IS 'plaintext utf-8'; - COMMENT ON COLUMN urls.html_toc - IS 'table of contents for segmented html document'; - COMMENT ON COLUMN urls.html_doc - IS 'html document (scroll)'; - COMMENT ON COLUMN urls.xhtml - IS 'xhtml document (scroll)'; - COMMENT ON COLUMN urls.xml_sax - IS 'xml sax oriented document (scroll)'; - COMMENT ON COLUMN urls.xml_dom - IS 'xml dom oriented document (scroll)'; - COMMENT ON COLUMN urls.odf - IS 'opendocument format text'; - COMMENT ON COLUMN urls.pdf_p - IS 'pdf portrait'; - COMMENT ON COLUMN urls.pdf_l - IS 'pdf landscape'; - COMMENT ON COLUMN urls.concordance - IS 'rudimentary document index linked to html'; - COMMENT ON COLUMN urls.latex_p - IS 'latex portrait'; - COMMENT ON COLUMN urls.latex_l - IS 'latex_landscape'; - COMMENT ON COLUMN urls.markup - IS 'markup'; - COMMENT ON COLUMN urls.sisupod - IS 'SiSU document format .tgz (all SiSU information on document)'; - } - end - @comment - end - def output_dir? - dir=SiSU_Env::Info_env.new('') - if @opt.cmd =~/d/; dir.path.webserv_stub_ensure - end - end - def create_table_metadata - print %{ - currently using sisu dbi module - to be populated from documents files - create tables metadata - data import through ruby transfer - } unless @opt.cmd =~/q/ - @conn.execute(%{ - CREATE TABLE metadata ( - tid INT4 PRIMARY KEY, - title VARCHAR(#{lt_title}) NULL, - subtitle VARCHAR(#{lt_subtitle}) NULL, - creator VARCHAR(#{lt_creator}) NULL, - illustrator VARCHAR(#{lt_illustrator}) NULL, - translator VARCHAR(#{lt_translator}) NULL, - subject VARCHAR(#{lt_subject}) NULL, - date VARCHAR(#{lt_date}) NULL, - date_created VARCHAR(#{lt_date_created}) NULL, - date_issued VARCHAR(#{lt_date_issued}) NULL, - date_available VARCHAR(#{lt_date_available}) NULL, - date_valid VARCHAR(#{lt_date_valid}) NULL, - date_modified VARCHAR(#{lt_date_modified}) NULL, -/* date DATE, */ -/* date_created DATE, */ -/* date_issued DATE, */ -/* date_available DATE, */ -/* date_valid DATE, */ -/* date_modified DATE, */ - type VARCHAR(#{lt_type}) NULL, - description VARCHAR(#{lt_description}) NULL, - publisher VARCHAR(#{lt_publisher}) NULL, - contributor VARCHAR(#{lt_contributor}) NULL, - prepared_by VARCHAR(#{lt_prepared_by}) NULL, - digitized_by VARCHAR(#{lt_digitized_by}) NULL, - format VARCHAR(#{lt_format}) NULL, - identifier VARCHAR(#{lt_identifier}) NULL, - source VARCHAR(#{lt_source}) NULL, - language VARCHAR(#{lt_language}) NULL, - language_original VARCHAR(#{lt_language_original}) NULL, - relation VARCHAR(#{lt_relation}) NULL, - coverage VARCHAR(#{lt_coverage}) NULL, - rights VARCHAR(#{lt_rights}) NULL, - copyright VARCHAR(#{lt_copyright}) NULL, - owner VARCHAR(#{lt_owner}) NULL, - keywords VARCHAR(#{lt_keywords}) NULL, - comment VARCHAR(#{lt_comment}) NULL, - loc VARCHAR(#{lt_loc}) NULL, - dewey VARCHAR(#{lt_dewey}) NULL, - isbn VARCHAR(#{lt_isbn}) NULL, - pg VARCHAR(#{lt_pg}) NULL, - abstract VARCHAR(#{lt_abstract}) NULL, - prefix_a TEXT NULL, - prefix_b TEXT NULL, - skin VARCHAR(#{lt_skin}) NULL, - markup VARCHAR(#{lt_markup}) NULL, - links VARCHAR(#{lt_links}) NULL, - information VARCHAR(#{lt_information}) NULL, - contact VARCHAR(#{lt_contact}) NULL, - suffix VARCHAR(#{lt_suffix}) NULL, - filename VARCHAR(#{lt_filename}) NULL UNIQUE, - types CHAR(#{lt_types}) NULL, - subj VARCHAR(#{lt_subj}) NULL - ); - #{@comment['metadata']} - }) - end - def create_table # create documents base - print %{ - to be populated from documents files - create tables documents document_trade document_env - data import through ruby transfer - } unless @opt.cmd =~/q/ - @conn.execute(%{ - CREATE TABLE documents ( - lid INT4 PRIMARY KEY, - metadata_tid INT4 REFERENCES metadata, - ocn SMALLINT, - ocnd VARCHAR(6), - ocns VARCHAR(6), - clean TEXT NULL, - body TEXT NULL, - seg VARCHAR(#{document_seg}) NULL, - lev SMALLINT NULL, - lev1 SMALLINT, - lev2 SMALLINT, - lev3 SMALLINT, - lev4 SMALLINT, - lev5 SMALLINT, - lev6 SMALLINT, - en_a SMALLINT NULL, - en_z SMALLINT NULL, - en_a_asterisk SMALLINT NULL, - en_z_asterisk SMALLINT NULL, - en_a_plus SMALLINT NULL, - en_z_plus SMALLINT NULL, - digest_clean CHAR(#{@@dl}), - digest_all CHAR(#{@@dl}), - types CHAR(1) NULL - ); - #{@comment['documents']} - }) - end - def create_table_endnotes - print %{ - to be populated from documents files - create tables endnotes - data import through ruby transfer - } unless @opt.cmd =~/q/ - @conn.execute(%{ - CREATE TABLE endnotes ( - nid INT4 PRIMARY KEY, - document_lid INT4 REFERENCES documents, - nr SMALLINT, - clean TEXT NULL, - body TEXT NULL, - ocn SMALLINT, - ocnd VARCHAR(6), - ocns VARCHAR(6), - digest_clean CHAR(#{@@dl}), - metadata_tid INT4 REFERENCES metadata - ); - #{@comment['endnotes']} - }) - end - def create_table_endnotes_asterisk - print %{ - to be populated from documents files - create tables endnotes_asterisk - data import through ruby transfer - } unless @opt.cmd =~/q/ - @conn.execute(%{ - CREATE TABLE endnotes_asterisk ( - nid INT4 PRIMARY KEY, - document_lid INT4 REFERENCES documents, - nr SMALLINT, - clean TEXT NULL, - body TEXT NULL, - ocn SMALLINT, - ocnd VARCHAR(6), - ocns VARCHAR(6), - digest_clean CHAR(#{@@dl}), - metadata_tid INT4 REFERENCES metadata - ); - #{@comment['endnotes_asterisk']} - }) - end - def create_table_endnotes_plus - print %{ - to be populated from documents files - create tables endnotes_plus - data import through ruby transfer - } unless @opt.cmd =~/q/ - @conn.execute(%{ - CREATE TABLE endnotes_plus ( - nid INT4 PRIMARY KEY, - document_lid INT4 REFERENCES documents, - nr SMALLINT, - clean TEXT NULL, - body TEXT NULL, - ocn SMALLINT, - ocnd VARCHAR(6), - ocns VARCHAR(6), - digest_clean CHAR(#{@@dl}), - metadata_tid INT4 REFERENCES metadata - ); - #{@comment['endnotes_plus']} - }) - end - def create_table_urls # create documents file links mapping - print %{ - currently using sisu dbi module - to be populated from documents files - create tables urls - data import through ruby transfer - } unless @opt.cmd =~/q/ - @conn.execute(%{ - CREATE TABLE urls ( - metadata_tid INT4 REFERENCES metadata, - plaintext varchar(512), - html_toc varchar(512), - html_doc varchar(512), - xhtml varchar(512), - xml_sax varchar(512), - xml_dom varchar(512), - odf varchar(512), - pdf_p varchar(512), - pdf_l varchar(512), - concordance varchar(512), - latex_p varchar(512), - latex_l varchar(512), - digest varchar(512), - manifest varchar(512), - markup varchar(512), - sisupod varchar(512) - ); - #{@comment['urls']} - }) - end - end -end -__END__ diff --git a/lib/sisu/0.52/db_drop.rb b/lib/sisu/0.52/db_drop.rb deleted file mode 100644 index 44f31d2a..00000000 --- a/lib/sisu/0.52/db_drop.rb +++ /dev/null @@ -1,124 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: modules shared by the different db types, dbi, postgresql, sqlite - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_DB_drop - class Drop - def initialize(opt,conn='',sql_type='') - @opt,@conn,@sql_type=opt,conn,sql_type - end - def drop_tables #% drop all tables - begin - case @sql_type - when /sqlite/ - cascade='' - commit=@conn.commit - else - cascade='CASCADE' - commit='' - end - @conn.do(%{ - DROP TABLE metadata #{cascade}; - DROP TABLE documents #{cascade}; - DROP TABLE endnotes #{cascade}; - DROP TABLE endnotes_asterisk #{cascade}; - DROP TABLE endnotes_plus #{cascade}; - DROP TABLE urls #{cascade}; - }) - commit - rescue - end - end - def drop_indexes #% drop all indexes - #@conn.do(%{ - # DROP INDEX object_nr ON documents(ocn); - # DROP INDEX body ON documents(body); - # DROP INDEX clean ON documents(clean); - # DROP INDEX lev1 ON documents(lev1); - # DROP INDEX lev2 ON documents(lev2); - # DROP INDEX lev3 ON documents(lev3); - # DROP INDEX lev4 ON documents(lev4); - # DROP INDEX lev5 ON documents(lev5); - # DROP INDEX lev6 ON documents(lev6); - # DROP INDEX endnote_nr ON endnotes(nr); - # DROP INDEX endnote ON endnotes(body); - # DROP INDEX title ON metadata(title); - # DROP INDEX filename ON metadata(filename) - # /* - # DROP INDEX object_nr ON documents(ocn) CASCADE; - # DROP INDEX body ON documents(body) CASCADE; - # DROP INDEX clean ON documents(clean) CASCADE; - # DROP INDEX lev1 ON documents(lev1) CASCADE; - # DROP INDEX lev2 ON documents(lev2) CASCADE; - # DROP INDEX lev3 ON documents(lev3) CASCADE; - # DROP INDEX lev4 ON documents(lev4) CASCADE; - # DROP INDEX lev5 ON documents(lev5) CASCADE; - # DROP INDEX lev6 ON documents(lev6) CASCADE; - # DROP INDEX endnote_nr ON endnotes(nr) CASCADE; - # DROP INDEX endnote ON endnotes(body) CASCADE; - # DROP INDEX title ON metadata(title) CASCADE; - # DROP INDEX filename ON metadata(filename) CASCADE - # */ - #}) - end - def db_help #% help - puts %{ - not yet implemented - init createall - createtable - recreate\t(destroy and create) - createlex\t() - createmetadata\t() - import\t(import data) - index\t(create index) - droptables\t(where tables made and content imported) - dropall\t(where tables made, content imported and tables indexed) - } - end - end -end -__END__ diff --git a/lib/sisu/0.52/db_import.rb b/lib/sisu/0.52/db_import.rb deleted file mode 100644 index 73161dc0..00000000 --- a/lib/sisu/0.52/db_import.rb +++ /dev/null @@ -1,735 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: modules shared by the different db types, dbi, postgresql, sqlite - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_DB_import - require SiSU_lib + '/db_columns' - require SiSU_lib + '/db_load_tuple' - require SiSU_lib + '/shared_html_lite' - class Import < SiSU_DB_columns::Column_size - include SiSU_Param - include SiSU_Screen - @@dl=nil - attr_accessor :tp - def initialize(opt,conn='',sql_type='pg') - @opt,@conn,@sql_type=opt,conn,sql_type - @cX=SiSU_Screen::Ansi.new(@opt.cmd).cX - @env=SiSU_Env::Info_env.new(@opt.fns) - @dal="#{@env.path.dal}" - if @opt.fns.empty? or @opt.cmd.empty?; @fnb='' - else - @md=SiSU_Param::Parameters.new(@opt).get - @fnb=@md.fnb - end - @suffix=@opt.fns[/(?:.+?)\.[_-]?sst/,1] - @fnm="#@dal/#{@opt.fns}.meta.rbm" - @@seg='' - @@seg_full='' #create? consider placing field just before clean text as opposed to seg which contains seg(.html) name info seg_full would contain seg info for levels 5 & 6 where available eg seg_full may be 7.3 (level 5) and 7.3.1 (level 6) where seg is 7 - @col=Hash.new('') - @col[:ocn]='' - @counter={} - sql='SELECT MAX(lid) FROM documents' - @col[:lid]=@conn.execute( sql ) { |x| x.fetch_all.to_s.to_i } - @col[:lid] ||=0 - sql='SELECT MAX(nid) FROM endnotes' - @id_n=@conn.execute( sql ) { |x| x.fetch_all.to_s.to_i } - @id_n ||=0 - @col[:lv1]=@col[:lv2]=@col[:lv3]=@col[:lv4]=@col[:lv5]=@col[:lv6]=0 - @db=SiSU_Env::Info_db.new - @@dl ||=SiSU_Env::Info_env.new.digest.length - end - def marshal_load - require SiSU_lib + '/dal' - @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here - #@dal_array.each { |x| puts x.inspect; sleep 1 } - tell=SiSU_Screen::Ansi.new(@opt.cmd,"#{@db.db_psql}::#{@opt.fns}") - tell.puts_blue unless @opt.cmd =~/q/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,'Marshal Load',@fnm) - tell.print_grey if @opt.cmd =~/v/ - case @sql_type - when /sqlite/ #fix logic for sqlite ! - import_db_metadata(@dal_array) - import_documents(@dal_array) - import_db_urls(@dal_array,@fnm) #import OID on/off - @conn.commit #sqlite watch - else - file_exist=@conn.select_one(%{ SELECT metadata.tid FROM metadata WHERE metadata.filename ~ '#{@opt.fns}'; }) - unless file_exist - @conn.execute('BEGIN') - import_db_metadata(@dal_array) - import_documents(@dal_array) - import_db_urls(@dal_array,@fnm) #import OID on/off - @conn.execute('COMMIT') - else - @db=SiSU_Env::Info_db.new - puts "\n#{@cX.grey}file #{@cX.off} #{@cX.blue}#{@opt.fns}#{@cX.off} #{@cX.grey}already exists in database#{@cX.off} #{@cX.blue}#{@db.db_psql}#{@cX.off} #{@cX.brown}update instead?#{@cX.off}" - end - end - end - def special_character_escape(string) - string.gsub!(/'/,"''") - string.gsub!(/<:br>/,"
\n") - string.gsub!(/<:(?:code|alt|group|verse)(?:-end)?>/,'') - string.gsub!(/<:name#\S+?>/,'') - string.gsub!(/\{\s*(\S+?\.(?:png|jpg))(?:\s+\d+x\d+)?(.+?)\}\S+/,'[image: \1] \2') - string.gsub!(/\{\s*(.+?)\s*\}http:\/\/\S+?([.,!?]?(?:\s|$))/,'\1\2') - end - def unicode_special_character_escape(string) - #string.gsub!(/(["';:,])/, %{\\\\\\1}) - end - def strip_markup(string) #define rules, make same as in dal clean - string.gsub!(/(\d+)<\/sup>/,'[\1]') - string.gsub!(/<:i[12]>/,'') - string.gsub!(/(?: \\;)+/,' ') - string.gsub!(//,"[TABLE]\n") #tables - string.gsub!(//,'\1') #tables - string.gsub!(/¡¡\d+¡/,' ') #tables - string.gsub!(/¡/,' ') #tables tidy later - string.gsub!(/<.+?>/,'') - string.gsub!(/\{.+?\.(?:png|jpg|gif).+?\}(?:https?|ftp)\\\:\S+ /,' [image] ') # else image names found in search - string.gsub!(/\s\s+/,' ') - string.strip! - end - #% import into database tables - def import_db_metadata(dbi_unit) #% import documents - populate database - print %{ #{@cX.grey}import documents dbi_unit #{@cX.off} } unless @opt.cmd =~/q/ - @tp={} - @md=SiSU_Param::Parameters.new(@opt).get - if @md.title; @tp[:title]=@md.title - special_character_escape(@tp[:title]) - @tp[:title_f],@tp[:title_i]='title, ',"'#{@tp[:title]}', " - sql="SELECT MAX(tid) FROM metadata" - id_t=@conn.execute( sql ) { |x| x.fetch_all.to_s.to_i } - @@id_t=id_t if id_t - @@id_t ||=0 - @@id_t+=1 #bug related, needs to be performed once at start of file, but consider moving, as, placed here it means program will fail if document header lacks 0~title - puts %{\n#{@cX.grey}Processing file number#{@cX.off}: #{@cX.green}#{@@id_t}#{@@cX.off}} unless @opt.cmd =~/q/ - end - if @md.dc_title; @tp[:long_title]=@md.dc_title - #sql="SELECT MAX(tid) FROM metadata" - #id_t=@conn.execute( sql ) { |x| x.fetch_all.to_s.to_i } - #@@id_t=id_t if id_t - #@@id_t ||=0 - #@@id_t+=1 #bug related, needs to be performed once at start of file, but consider moving, as, placed here it means program will fail if document header lacks 0~title - #puts %{\n#{@cX.grey}Processing file number#{@cX.off}: #{@cX.green}#{@@id_t}#{@@cX.off}} - end - if @md.subtitle; @tp[:subtitle]=@md.subtitle - special_character_escape(@tp[:subtitle]) - @tp[:subtitle_f],@tp[:subtitle_i]='subtitle, ',"'#{@tp[:subtitle]}', " - end - if @md.dc_creator; @tp[:creator]=@md.dc_creator - special_character_escape(@tp[:creator]) - @tp[:creator_f],@tp[:creator_i]='creator, ',"'#{@tp[:creator]}', " - end - if @md.dc_contributor; @tp[:contributor]=@md.dc_contributor - special_character_escape(@tp[:contributor]) - @tp[:contributor_f],@tp[:contributor_i]='contributor, ',"'#{@tp[:contributor]}', " - end - if @md.translator; @tp[:translator]=@md.translator - special_character_escape(@tp[:translator]) - @tp[:translator_f],@tp[:translator_i]='translator, ',"'#{@tp[:translator]}', " - end - if @md.illustrator; @tp[:illustrator]=@md.illustrator - special_character_escape(@tp[:illustrator]) - @tp[:illustrator_f],@tp[:illustrator_i]='illustrator, ',"'#{@tp[:illustrator]}', " - end - if @md.dc_publisher; @tp[:publisher]=@md.dc_publisher - special_character_escape(@tp[:publisher]) - @tp[:publisher_f],@tp[:publisher_i]='publisher, ',"'#{@tp[:publisher]}', " - end - if @md.prepared_by; @tp[:prepared_by]=@md.prepared_by - special_character_escape(@tp[:prepared_by]) - @tp[:prepared_by_f],@tp[:prepared_by_i]='prepared_by, ',"'#{@tp[:prepared_by]}', " - end - if @md.digitized_by; @tp[:digitized_by]=@md.digitized_by - special_character_escape(@tp[:digitized_by]) - @tp[:digitized_by_f],@tp[:digitized_by_i]='digitized_by, ',"'#{@tp[:digitized_by]}', " - end - if @md.dc_subject; @tp[:subject]=@md.dc_subject - special_character_escape(@tp[:subject]) - @tp[:subject_f],@tp[:subject_i]='subject, ',"'#{@tp[:subject]}', " - end - if @md.dc_description; @tp[:description]=@md.dc_description - special_character_escape(@tp[:description]) - @tp[:description_f],@tp[:description_i]='description, ',"'#{@tp[:description]}', " - end - if @md.abstract; @tp[:abstract]=@md.abstract - special_character_escape(@tp[:abstract]) - @tp[:abstract_f],@tp[:abstract_i]='abstract, ',"'#{@tp[:abstract]}', " - end - if @md.dc_type; @tp[:type]=@md.dc_type - special_character_escape(@tp[:type]) - @tp[:type_f],@tp[:type_i]='type, ',"'#{@tp[:type]}', " - end - #if @md.owner; @tp[:owner]=@md.owner - # special_character_escape(@tp[:owner]) - # @tp[:owner_f],@tp[:owner_i]='owner, ',"'#{@tp[:owner}', " - #end - #if @md.copyright; @tp[:copyright]=@md.copyright - # special_character_escape(@tp[:copyright]) - # @tp[:copyright_f],@tp[:copyright_i]='copyright, ',"'#{@tp[:copyright]}', " - #end - if @md.dc_rights; @tp[:rights]=@md.dc_rights - special_character_escape(@tp[:rights]) - @tp[:rights_f],@tp[:rights_i]='rights, ',"'#{@tp[:rights]}', " - end - if @md.dc_date; @tp[:date]=@md.dc_date - special_character_escape(@tp[:date]) - @tp[:date_f],@tp[:date_i]='date, ',"'#{@tp[:date]}', " - end - if @md.dc_date_created; @tp[:date_created]=@md.dc_date_created - special_character_escape(@tp[:date_created]) - @tp[:date_created_f],@tp[:date_created_i]='date_created, ',"'#{@tp[:date_created]}', " - end - if @md.dc_date_issued; @tp[:date_issued]=@md.dc_date_issued - special_character_escape(@tp[:date_issued]) - @tp[:date_issued_f],@tp[:date_issued_i]='date_issued, ',"'#{@tp[:date_issued]}', " - end - if @md.dc_date_available; @tp[:date_available]=@md.dc_date_available - special_character_escape(@tp[:date_available]) - @tp[:date_available_f],@tp[:date_available_i]='date_available, ',"'#{@tp[:date_available]}', " - end - if @md.dc_date_modified; @tp[:date_modified]=@md.dc_date_modified - special_character_escape(@tp[:date_modified]) - @tp[:date_modified_f],@tp[:date_modified_i]='date_modified, ',"'#{@tp[:date_modified]}', " - end - if @md.dc_date_valid; @tp[:date_valid]=@md.dc_date_valid - special_character_escape(@tp[:date_valid]) - @tp[:date_valid_f],@tp[:date_valid_i]='date_valid, ',"'#{@tp[:date_valid]}', " - end - if @md.dc_language[:name]; @tp[:language]=@md.dc_language[:name] - special_character_escape(@tp[:language]) - @tp[:language_f],@tp[:language_i]='language, ',"'#{@tp[:language]}', " - end - if @md.language_original[:name]; @tp[:language_original]=@md.language_original[:name] - special_character_escape(@tp[:language_original]) - @tp[:language_original_f],@tp[:language_original_i]='language_original, ',"'#{@tp[:language_original]}', " - end - if @md.dc_format; @tp[:format]=@md.dc_format - special_character_escape(@tp[:format]) - @tp[:format_f],@tp[:format_i]='format, ',"'#{@tp[:format]}', " - end - if @md.dc_identifier; @tp[:identifier]=@md.dc_identifier - special_character_escape(@tp[:identifier]) - @tp[:identifier_f],@tp[:identifier_i]='identifier, ',"'#{@tp[:identifier]}', " - end - if @md.dc_source; @tp[:source]=@md.dc_source - special_character_escape(@tp[:source]) - @tp[:source_f],@tp[:source_i]='source, ',"'#{@tp[:source]}', " - end - if @md.dc_relation; @tp[:relation]=@md.dc_relation - special_character_escape(@tp[:relation]) - @tp[:relation_f],@tp[:relation_i]='relation, ',"'#{@tp[:relation]}', " - end - if @md.dc_coverage; @tp[:coverage]=@md.dc_coverage - special_character_escape(@tp[:coverage]) - @tp[:coverage_f],@tp[:coverage_i]='coverage, ',"'#{@tp[:coverage]}', " - end - if @md.keywords; @tp[:keywords]=@md.keywords - special_character_escape(@tp[:keywords]) - @tp[:keywords_f],@tp[:keywords_i]='keywords, ',"'#{@tp[:keywords]}', " - end - if @md.comments; @tp[:comments]=@md.comments - special_character_escape(@tp[:comments]) - @tp[:comments_f],@tp[:comments_i]='comments, ',"'#{@tp[:comments]}', " - end - if @md.cls_loc; @tp[:cls_loc]=@md.cls_loc - special_character_escape(@tp[:cls_loc]) - @tp[:cls_loc_f],@tp[:cls_loc_i]='cls_loc, ',"'#{@tp[:cls_loc]}', " - end - if @md.cls_dewey; @tp[:cls_dewey]=@md.cls_dewey - special_character_escape(@tp[:cls_dewey]) - @tp[:cls_dewey_f],@tp[:cls_dewey_i]='cls_dewey, ',"'#{@tp[:cls_dewey]}', " - end - if @md.cls_pg; @tp[:cls_pg]=@md.cls_pg - special_character_escape(@tp[:cls_pg]) - @tp[:cls_pg_f],@tp[:cls_pg_i]='cls_pg, ',"'#{@tp[:cls_pg]}', " - end - if @md.cls_isbn; @tp[:cls_isbn]=@md.cls_isbn - special_character_escape(@tp[:cls_isbn]) - @tp[:cls_isbn_f],@tp[:cls_isbn_i]='cls_isbn, ',"'#{@tp[:cls_isbn]}', " - end - if @md.prefix_a; @tp[:prefix_a]=@md.prefix_a - special_character_escape(@tp[:prefix_a]) - @tp[:prefix_a_f],@tp[:prefix_a_i]='prefix_a, ',"'#{@tp[:prefix_a]}', " - end - if @md.prefix_b; @tp[:prefix_b]=@md.prefix_b - special_character_escape(@tp[:prefix_b]) - @tp[:prefix_b_f],@tp[:prefix_b_i]='prefix_b, ',"'#{@tp[:prefix_b]}', " - end - #if @md.suffix; @tp[:suffix]=@md.suffix - # special_character_escape(@tp[:suffix]) - # @tp[:suffix_f],@tp[:suffix_i]='suffix, ',"'#{@tp[:suffix]}', " - #end - if @md.fns; @tp[:fns]=@md.fns - special_character_escape(@tp[:fns]) - @tp[:fns_f],@tp[:fns_i]="filename, ","'#{@tp[:fns]}', " - end - #if @md.en[:mismatch] > 0 - # id,info='WARNING document error in endnote markup, number mismatch',"endnotes: #{@md.en[:note]} != endnote reference marks: #{@md.en[:mark]} (difference = #{@md.en[:mismatch]})" - #end - if @md.wc_words; @tp[:wc_words]=@md.wc_words - @tp[:wc_words_f],@tp[:wc_words_i]='wc_words, ',"'#{@tp[:wc_words]}', " - end - if @md.dgst; @tp[:dgst]=@md.dgst - @tp[:dgst_f],@tp[:dgst_i]='dgst, ',"'#{@tp[:dgst]}', " - end - if @md.sc_number; @tp[:sc_number]=@md.sc_number - @tp[:sc_number_f],@tp[:sc_number_i]='sc_number, ',"'#{@tp[:sc_number]}', " - end - if @md.sc_date; @tp[:sc_date]=@md.sc_date - @tp[:sc_date_f],@tp[:sc_date_i]='sc_date, ',"'#{@tp[:sc_date]}', " - end - if @md.generated; @tp[:generated]=@md.generated - @tp[:generated_f],@tp[:generated_i]='generated, ',"'#{@tp[:generated]}', " - end - #if @md.sisu_version; special_character_escape(@md.sisu_version) - # #id,info='Generated by',"#{@md.sisu_version[:project]} #{@md.sisu_version[:version]} #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]})" - #end - #if @md.ruby_version; special_character_escape(@md.ruby_version) - SiSU_DB::Test.new(self,@opt).verify #% import title names, filenames (tuple) - @conn.execute(%{ - INSERT INTO metadata (#{@tp[:fns_f]} #{@tp[:suffix_f]} #{@tp[:title_f]} #{@tp[:subtitle_f]} #{@tp[:creator_f]} #{@tp[:illustrator_f]} #{@tp[:translator_f]} #{@tp[:subject_f]} #{@tp[:description_f]} #{@tp[:publisher_f]} #{@tp[:contributor_f]} #{@tp[:prepared_by_f]} #{@tp[:digitized_by_f]} #{@tp[:date_f]} #{@tp[:date_created_f]} #{@tp[:date_issued_f]} #{@tp[:date_valid_f]} #{@tp[:date_available_f]} #{@tp[:date_modified_f]} #{@tp[:type_f]} #{@tp[:format_f]} #{@tp[:identifier_f]} #{@tp[:source_f]} #{@tp[:language_f]} #{@tp[:language_original_f]} #{@tp[:relation_f]} #{@tp[:coverage_f]} #{@tp[:rights_f]} #{@tp[:copyright_f]} #{@tp[:owner_f]} #{@tp[:keywords_f]} #{@tp[:abstract_f]} #{@tp[:comment_f]} #{@tp[:loc_f]} #{@tp[:dewey_f]} #{@tp[:isbn_f]} #{@tp[:pg_f]} #{@tp[:prefix_a_f]} #{@tp[:prefix_b_f]} tid) VALUES (#{@tp[:fns_i]} #{@tp[:suffix_i]} #{@tp[:title_i]} #{@tp[:subtitle_i]} #{@tp[:creator_i]} #{@tp[:illustrator_i]} #{@tp[:translator_i]} #{@tp[:subject_i]} #{@tp[:description_i]} #{@tp[:publisher_i]} #{@tp[:contributor_i]} #{@tp[:prepared_by_i]} #{@tp[:digitized_by_i]} #{@tp[:date_i]} #{@tp[:date_created_i]} #{@tp[:date_issued_i]} #{@tp[:date_valid_i]} #{@tp[:date_available_i]} #{@tp[:date_modified_i]} #{@tp[:type_i]} #{@tp[:format_i]} #{@tp[:identifier_i]} #{@tp[:source_i]} #{@tp[:language_i]} #{@tp[:language_original_i]} #{@tp[:relation_i]} #{@tp[:coverage_i]} #{@tp[:rights_i]} #{@tp[:copyright_i]} #{@tp[:owner_i]} #{@tp[:keywords_i]} #{@tp[:abstract_i]} #{@tp[:comment_i]} #{@tp[:loc_i]} #{@tp[:dewey_i]} #{@tp[:isbn_i]} #{@tp[:pg_i]} #{@tp[:prefix_a_i]} #{@tp[:prefix_b_i]} #{@@id_t}); - }) - end - def import_documents(dbi_unit) #% import documents - populate main database table - #% import into substantive database tables (tuple) - begin - @col[:tid]=@@id_t - @en,@en_ast,@en_pls=[],[],[] - @col[:en_a]=nil - @col[:en_z]=nil - dbi_unit.each do |data| - #data.gsub!(/<[biu]>(.+?)<\/[biu]>/,'\1') # remove bold, italics, underscore - data.gsub!(/(.+?)<\/b>/,'\1') # remove bold, italics, underscore - data.gsub!(/(.+?)<\/i>/,'\1') # remove bold, italics, underscore - data.gsub!(/(.+?)<\/u>/,'\1') # remove bold, italics, underscore - #data.gsub!(/<:name#\S+?>/,'') - @col[:seg]=@@seg - if data =~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m # regular text - notedata=data.dup - if data[/^([123])~\s+(.+?)<~(\d+);((?:\w|[0-6]:)\d+);(\w\d+)><([0-9a-f]{#{@@dl}}):([0-9a-f]{#{@@dl}})>/] - @col[:lev],txt,@col[:ocn],@col[:ocnd],@col[:ocns],@col[:digest_clean],@col[:digest_all]=$1,$2,$3,$4,$5,$6,$7 - @col[:lid]+=1 - if txt =~/~\{.+?\}~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en << txt.scan(/~\{(\d+).+?\}~/) - txt.gsub!(/~\{(\d+).+?\}~/,'\1') - end - if txt =~/~\[\*.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_ast << txt.scan(/~\[[*](\d+).+?\]~/) - txt.gsub!(/~\[([*]\d+).+?\]~/,'\1') - end - if txt =~/~\[\+.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_pls << txt.scan(/~\[[+](\d+).+?\]~/) - txt.gsub!(/~\[([+]\d+).+?\]~/,'\1') - end - @col[:body]=SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:lev]).lev4_minus - special_character_escape(@col[:body]) - @col[:plaintext]=@col[:body].dup - strip_markup(@col[:plaintext]) - if @en[0]; @en_a,@en_z = @en[0].first,@en[0].last - end - if @en_ast[0]; @en_a_asterisk,@en_z_asterisk = @en_ast[0].first,@en_ast[0].last - end - if @en_pls[0]; @en_a_plus,@en_z_plus = @en_pls[0].first,@en_pls[0].last - end - t=SiSU_DB_tuple::Load_tuple.new(@conn,@col,@opt) - t.tuple - case @col[:lev] - when /1/; @col[:lv1]+=1 - when /2/; @col[:lv2]+=1 - when /3/; @col[:lv3]+=1 - end - @col[:lev]=@col[:plaintext]=@col[:body]='' - elsif data[/^4~(.+?)\s+(.+?)<~(\d+);((?:\w|[0-6]:)\d+);(\w\d+)><([0-9a-f]{#{@@dl}}):([0-9a-f]{#{@@dl}})>/] - @@seg,txt,@col[:ocn],@col[:ocnd],@col[:ocns],@col[:digest_clean],@col[:digest_all]=$1,$2,$3,$4,$5,$6,$7 - @col[:seg]=@@seg - @col[:lv4]+=1 - @col[:lid]+=1 - @col[:lev]=4 - if txt =~ /~\{.+?\}~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en << txt.scan(/~\{(\d+).+?\}~/) - txt.gsub!(/~\{(\d+).+?\}~/,'\1') - end - if txt =~/~\[\*.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_ast << txt.scan(/~\[[*](\d+).+?\]~/) - txt.gsub!(/~\[([*]\d+).+?\]~/,'\1') - end - if txt =~/~\[\+.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_pls << txt.scan(/~\[[+](\d+).+?\]~/) - txt.gsub!(/~\[([+]\d+).+?\]~/,'\1') - end - @col[:body]=SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:lev],@col[:seg]).lev4_plus - special_character_escape(@col[:body]) - @col[:plaintext]=@col[:body].dup - strip_markup(@col[:plaintext]) - if @en[0]; @en_a,@en_z = @en[0].first,@en[0].last - end - if @en_ast[0]; @en_a_asterisk,@en_z_asterisk = @en_ast[0].first,@en_ast[0].last - end - if @en_pls[0]; @en_a_plus,@en_z_plus = @en_pls[0].first,@en_pls[0].last - end - t=SiSU_DB_tuple::Load_tuple.new(@conn,@col,@opt) - t.tuple - @col[:lev]=@col[:plaintext]=@col[:body]='' - elsif data[/^5~(?:~\S+)?(.+?)<~(\d+);((?:\w|[0-6]:)\d+);(\w\d+)><([0-9a-f]{#{@@dl}}):([0-9a-f]{#{@@dl}})>/] # header lev5 seg level - txt,@col[:ocn],@col[:ocnd],@col[:ocns],@col[:digest_clean],@col[:digest_all]=$1,$2,$3,$4,$5,$6 - re=/^5~(.+?)\s+/ - @@seg_full=re.match(data)[1] if data=~re #create? - @@seg ||='' #nil # watch - @col[:seg]=@@seg - @col[:lv5]+=1 - @col[:lid]+=1 - @col[:lev]=5 - if txt =~ /~\{.+?\}~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en << txt.scan(/~\{(\d+).+?\}~/) - txt.gsub!(/~\{(\d+).+?\}~/,'\1') - end - if txt =~/~\[\*.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_ast << txt.scan(/~\[[*](\d+).+?\]~/) - txt.gsub!(/~\[([*]\d+).+?\]~/,'\1') - end - if txt =~/~\[\+.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_pls << txt.scan(/~\[[+](\d+).+?\]~/) - txt.gsub!(/~\[([+]\d+).+?\]~/,'\1') - end - @col[:body]=SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns],@col[:lev],@col[:seg]).lev4_plus - special_character_escape(@col[:body]) - @col[:plaintext]=@col[:body].dup - strip_markup(@col[:plaintext]) - if @en[0]; @en_a,@en_z = @en[0].first,@en[0].last - end - if @en_ast[0]; @en_a_asterisk,@en_z_asterisk = @en_ast[0].first,@en_ast[0].last - end - if @en_pls[0]; @en_a_plus,@en_z_plus = @en_pls[0].first,@en_pls[0].last - end - t=SiSU_DB_tuple::Load_tuple.new(@conn,@col,@opt) - t.tuple - @col[:lev]=@col[:plaintext]=@col[:body]='' - elsif data[/^6~(?:~\S+)?(.+?)<~(\d+);((?:\w|[0-6]:)\d+);(\w\d+)><([0-9a-f]{#{@@dl}}):([0-9a-f]{#{@@dl}})>/] # header lev6 seg level - txt,@col[:ocn],@col[:ocnd],@col[:ocns],@col[:digest_clean],@col[:digest_all]=$1,$2,$3,$4,$5,$6 - re=/^6~(.+?)\s+/ - @@seg_full=re.match(data)[1] if data=~re #create? - @@seg ||='' #nil # watch - @col[:seg]=@@seg - @col[:lv6]+=1 - @col[:lid]+=1 - @col[:lev]=6 - if txt =~ /~\{.+?\}~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en << txt.scan(/~\{(\d+).+?\}~/) - txt.gsub!(/~\{(\d+).+?\}~/,'\1') - end - if txt =~/~\[\*.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_ast << txt.scan(/~\[[*](\d+).+?\]~/) - txt.gsub!(/~\[([*]\d+).+?\]~/,'\1') - end - if txt =~/~\[\+.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_pls << txt.scan(/~\[[+](\d+).+?\]~/) - txt.gsub!(/~\[([+]\d+).+?\]~/,'\1') - end - @col[:body]=SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns],@col[:lev],@col[:seg]).lev4_plus - special_character_escape(@col[:body]) - @col[:plaintext]=@col[:body].dup - strip_markup(@col[:plaintext]) - if @en[0]; @en_a,@en_z = @en[0].first,@en[0].last - end - if @en_ast[0]; @en_a_asterisk,@en_z_asterisk = @en_ast[0].first,@en_ast[0].last - end - if @en_pls[0]; @en_a_plus,@en_z_plus = @en_pls[0].first,@en_pls[0].last - end - t=SiSU_DB_tuple::Load_tuple.new(@conn,@col,@opt) - t.tuple - @col[:lev]=@col[:plaintext]=@col[:body]='' - else #% regular text - @col[:lid]+=1 - txt='' - txt,@col[:ocn],@col[:ocnd],@col[:ocns],@col[:digest_clean],@col[:digest_all]=(/(.+?)<~(\d+);((?:\w|[0-6]:)\d+);(\w\d+)><([0-9a-f]{#{@@dl}}):([0-9a-f]{#{@@dl}})>/m).match(data).captures - if txt =~ /~\{.+?\}~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en << txt.scan(/~\{(\d+).+?\}~/) - txt.gsub!(/~\{(\d+).+?\}~/,'\1') - #txt.gsub!(/~\{(\d+).+?\}~/,'^[\1]') # remove endnote, keep endnote reference number, display as, e.g. [^1] - end - if txt =~/~\[\*.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_ast << txt.scan(/~\[[*](\d+).+?\]~/) - txt.gsub!(/~\[([*]\d+).+?\]~/,'\1') - end - if txt =~/~\[\+.+?\]~/ - word_mode=txt.scan(/\S+/) - endnote_range(word_mode) - @en_pls << txt.scan(/~\[[+](\d+).+?\]~/) - txt.gsub!(/~\[([+]\d+).+?\]~/,'\1') - end - if @sql_type=~/pg/ and txt.size > (document_clean - 1) #% examine pg build & remove limitation - puts "\n\nTOO LARGE (TXT - see error log)\n\n" - open("#{Dir.pwd}/pg_documents_error_log",'a') do |error| - error.puts("\n#{@opt.fns}\nTEXT BODY\n#{@col[:body].size} object #{@col[:ocn]} -> #{@col[:body].slice(0..500)}") - end - txt=%{\n\nLARGE TEXT BLOCK OMITTED\n\n} - end - if @en[0]; @en_a,@en_z = @en[0].first,@en[0].last - end - if @en_ast[0]; @en_a_asterisk,@en_z_asterisk = @en_ast[0].first,@en_ast[0].last - end - if @en_pls[0]; @en_a_plus,@en_z_plus = @en_pls[0].first,@en_pls[0].last - end - @col[:body]=if txt=~// #watch - SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns]).html_table - elsif txt=~/<:i1>/ - SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns]).indent1 - elsif txt=~/<:i2>/ - SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns]).indent2 - else - SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns]).norm - end - special_character_escape(@col[:body]) - @col[:plaintext]=@col[:body].dup - strip_markup(@col[:plaintext]) - t=SiSU_DB_tuple::Load_tuple.new(@conn,@col,@opt) - t.tuple - @en,@en_ast,@en_pls=[],[],[] - @col[:en_a]=@col[:en_z]=nil - @col[:lev]=@col[:plaintext]=@col[:body]='' - end - if notedata =~ /~\{.+?\}~/ #% import into database endnotes tables - endnote_array=notedata.scan(/~\{.+?\}~/) - endnote_array.each do |inf| - if inf[/~\{\d+.+?<[0-9a-f]{#{@@dl}}>\}~/] # dal new endnotes 2003w31/1 - if inf[/~\{(\d+)(.+?)<([0-9a-f]{#{@@dl}})>\}~/] # dal new endnotes 2003w31/1 - en,txt,digest_clean=$1,$2,$3 - end - @id_n+=1 - body=SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns],en).endnote - special_character_escape(body) - special_character_escape(txt) - strip_markup(txt) - if txt.size > (endnote_clean - 1) - puts "\n\nTOO LARGE (ENDNOTE - see error log)\n\n" - open("#{Dir.pwd}/pg_documents_error_log",'a') do |error| - error.puts("\n#{@opt.fns}\nENDNOTE\n#{txt.size} object #{@col[:ocn]},#{@col[:ocnd]},#{@col[:ocns]} -> #{txt.slice(0..500)}") - end - txt=%{\n\nLARGE TEXT BLOCK OMITTED\n\n} - end - if txt - #puts "'#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}'" #% endnotes - @conn.execute(%{ - INSERT INTO endnotes (nid, document_lid, nr, clean, body, ocn, ocnd, ocns, metadata_tid, digest_clean) VALUES ('#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}', '#{digest_clean}'); - }) - end - end - end - word_mode=notedata.scan(/\S+/) - end - if notedata =~ /~\[\*.+?\]~/ #% import into database endnotes tables - endnote_array=notedata.scan(/~\[\*.+?\]~/) - endnote_array.each do |inf| - if inf[/~\[\*\d+.+?<[0-9a-f]{#{@@dl}}>\]~/] # dal new endnotes 2003w31/1 - if inf[/~\[[*](\d+)(.+?)<([0-9a-f]{#{@@dl}})>\]~/] # dal new endnotes 2003w31/1 - en,txt,digest_clean=$1,$2,$3 - end - @id_n+=1 - body=SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns],en).endnote - special_character_escape(body) - special_character_escape(txt) - strip_markup(txt) - if txt.size > (endnote_clean - 1) - puts "\n\nTOO LARGE (ENDNOTE - see error log)\n\n" - open("#{Dir.pwd}/pg_documents_error_log",'a') do |error| - error.puts("\n#{@opt.fns}\nENDNOTE\n#{txt.size} object #{@col[:ocn]},#{@col[:ocnd]},#{@col[:ocns]} -> #{txt.slice(0..500)}") - end - txt=%{\n\nLARGE TEXT BLOCK OMITTED\n\n} - end - if txt - #puts "'#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}'" #% endnotes - @conn.execute(%{ - INSERT INTO endnotes_asterisk (nid, document_lid, nr, clean, body, ocn, ocnd, ocns, metadata_tid, digest_clean) VALUES ('#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}', '#{digest_clean}'); - }) - end - end - end - word_mode=notedata.scan(/\S+/) - end - if notedata =~ /~\[\+.+?\]~/ #% import into database endnotes tables - endnote_array=notedata.scan(/~\[\+.+?\]~/) - endnote_array.each do |inf| - if inf[/~\[\+\d+.+?<[0-9a-f]{#{@@dl}}>\]~/] # dal new endnotes 2003w31/1 - if inf[/~\[[+](\d+)(.+?)<([0-9a-f]{#{@@dl}})>\]~/] # dal new endnotes 2003w31/1 - en,txt,digest_clean=$1,$2,$3 - end - @id_n+=1 - body=SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns],en).endnote - special_character_escape(body) - special_character_escape(txt) - strip_markup(txt) - if txt.size > (endnote_clean - 1) - puts "\n\nTOO LARGE (ENDNOTE - see error log)\n\n" - open("#{Dir.pwd}/pg_documents_error_log",'a') do |error| - error.puts("\n#{@opt.fns}\nENDNOTE\n#{txt.size} object #{@col[:ocn]},#{@col[:ocnd]},#{@col[:ocns]} -> #{txt.slice(0..500)}") - end - txt=%{\n\nLARGE TEXT BLOCK OMITTED\n\n} - end - if txt - #puts "'#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}'" #% endnotes - @conn.execute(%{ - INSERT INTO endnotes_plus (nid, document_lid, nr, clean, body, ocn, ocnd, ocns, metadata_tid, digest_clean) VALUES ('#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}', '#{digest_clean}'); - }) - end - end - end - word_mode=notedata.scan(/\S+/) - end - end - end - rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error - ensure - end - end - def endnote_range(word_array) - @col[:en_a]=@col[:en_z]=nil - word_array.each do |w| - if w[/~[{\[][*+]?(\d+)\s+.+?[}\]]~/] # not tested since change 2003w31 - @col[:en_a]=$1 unless @col[:en_a] - @col[:en_z]=@col[:en_a].dup unless @col[:en_a] - @col[:en_z]=$1 if @col[:en_a] - end - end - end - def import_db_urls(dbi_unit,meta) #% import documents OID - populate database - begin - @fnm=meta - @env=SiSU_Env::Info_env.new(@opt.fns) - base=@env.url.root - out=@env.path.output - markup,meta,latex,plaintext,html_toc,html_doc,xml_sax,xml_dom,pdf_p,pdf_l,concordance,sisupod='','','','','','','','','','','','' - markup_li,meta_li,latex_li,plaintext_li,html_li,xml_sax_li,xml_dom_li,pdf_p_li,pdf_l_li,concordance_li,sisupod_li='','','','','','','','','','','' - if @fnb.empty? or @fnb.nil?; p 'file output path error' #remove - end - if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:plain]}")==true) - plaintext,plaintext_li='plaintext,', "'#{base}/#@fnb/#{@md.fn[:plain]}'," - end - if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:toc]}")==true) - html_toc,html_toc_li='html_toc,', "'#{base}/#@fnb/#{@md.fn[:toc]}'," - end - if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:doc]}")==true) - html_doc,html_doc_li='html_doc,', "'#{base}/#@fnb/#{@md.fn[:doc]}'," - end - if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:xhtml]}")==true) - xhtml,xhtml_li='xhtml,', "'#{base}/#@fnb/#{@md.fn[:xhtml]}'," - end - if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:sax]}")==true) - xml_sax,xml_sax_li='xml_sax,', "'#{base}/#@fnb/#{@md.fn[:sax]}'," - end - if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:dom]}")==true) - xml_dom,xml_dom_li='xml_dom,', "'#{base}/#@fnb/#{@md.fn[:dom]}'," - end - if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:odf]}")==true) - odf,odf_li='odf,', "'#{base}/#@fnb/#{@md.fn[:odf]}'," - end - if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:pdf_p]}")==true) - pdf_p,pdf_p_li='pdf_p,', "'#{base}/#@fnb/#{@md.fn[:pdf_p]}'," - end - if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:pdf_l]}")==true) - pdf_l,pdf_l_li='pdf_l,', "'#{base}/#@fnb/#{@md.fn[:pdf_l]}'," - end - if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:concordance]}")==true) - concordance,concordance_li='concordance,', "'#{base}/#@fnb/#{@md.fn[:concordance]}'," - end - if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@opt.fns}.tex")==true) - latex_p,latex_p_li='latex_p,', "'#{base}/#@fnb/#{@opt.fns}.tex'," - end - if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@opt.fns}.landscape.tex")==true) - latex_l,latex_l_li='latex_l,', "'#{base}/#@fnb/#@opt.fns}.landscape.tex'," - end - if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:digest]}")==true) - digest,digest_li='digest,', "'#{base}/#@fnb/#{@md.fn[:digest]}'," - end - if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:manifest]}")==true) #revisit, was to be text, this is html - manifest,manifest_li='manifest,', "'#{base}/#@fnb/#{@md.fn[:manifest]}'," - end - if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@opt.fns}.meta")==true) - markup,markup_li='markup,', "'#{base}/#@fnb/#{@opt.fns}.meta'," - end - if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@opt.fns}.tgz")==true) - sisupod,sisupod_li='sisupod,', "'#{base}/#@fnb/#{@opt.fns}.tgz'," - end - @conn.execute(%{ - INSERT INTO urls (#{plaintext} #{html_toc} #{html_doc} #{xhtml} #{xml_sax} #{xml_dom} #{odf} #{pdf_p} #{pdf_l} #{concordance} #{latex_p} #{latex_l} #{manifest} #{digest} #{markup} #{sisupod} metadata_tid) VALUES (#{plaintext_li} #{html_toc_li} #{html_doc_li} #{xhtml_li} #{xml_sax_li} #{xml_dom_li} #{odf_li} #{pdf_p_li} #{pdf_l_li} #{concordance_li} #{latex_p_li} #{latex_l_li} #{manifest_li} #{digest_li} #{markup_li} #{sisupod_li} #{@@id_t}); - }) - rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error - ensure - end - end - end -end -__END__ diff --git a/lib/sisu/0.52/db_indexes.rb b/lib/sisu/0.52/db_indexes.rb deleted file mode 100644 index cd9b6e87..00000000 --- a/lib/sisu/0.52/db_indexes.rb +++ /dev/null @@ -1,95 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: modules shared by the different db types, dbi, postgresql, sqlite - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_DB_index - class Index # create documents Indexes def initialize(opt,conn='',sql_type='') - def initialize(opt,conn='',sql_type='') - @opt,@conn,@sql_type=opt,conn,sql_type - end - def create_indexes # check added from pg not tested - def base - print ' - create documents common indexes - ' unless @opt.cmd =~/q/ - @conn.execute(' - CREATE INDEX object_nr ON documents(ocn); - CREATE INDEX digest_clean ON documents(digest_clean); - CREATE INDEX digest_all ON documents(digest_all); - CREATE INDEX lev1 ON documents(lev1); - CREATE INDEX lev2 ON documents(lev2); - CREATE INDEX lev3 ON documents(lev3); - CREATE INDEX lev4 ON documents(lev4); - CREATE INDEX lev5 ON documents(lev5); - CREATE INDEX lev6 ON documents(lev6); - CREATE INDEX endnote_nr ON endnotes(nr); - CREATE INDEX digest_en ON endnotes(digest_clean); - CREATE INDEX endnote_nr_asterisk ON endnotes_asterisk(nr); - CREATE INDEX endnote_asterisk ON endnotes_asterisk(clean); - CREATE INDEX digest_en_asterisk ON endnotes_asterisk(digest_clean); - CREATE INDEX endnote_nr_plus ON endnotes_plus(nr); - CREATE INDEX endnote_plus ON endnotes_plus(clean); - CREATE INDEX digest_en_plus ON endnotes_plus(digest_clean); - CREATE INDEX title ON metadata(title); - CREATE INDEX filename ON metadata(filename) - ') unless @opt.cmd =~/q/ - end - def text - print ' - create documents text indexes - ' unless @opt.cmd =~/q/ - @conn.execute(' - CREATE INDEX clean ON documents(clean); - CREATE INDEX endnote ON endnotes(clean); - ') unless @opt.cmd =~/q/ - end - base - @opt.cmd=~/D/ || @opt.mod=~/psql/ ? '' : text - end - end -end -__END__ diff --git a/lib/sisu/0.52/db_load_tuple.rb b/lib/sisu/0.52/db_load_tuple.rb deleted file mode 100644 index 1be35e5a..00000000 --- a/lib/sisu/0.52/db_load_tuple.rb +++ /dev/null @@ -1,94 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: modules shared by the different db types, dbi, postgresql, sqlite - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_DB_tuple - class Load_tuple #% main database populate - require SiSU_lib + '/param' - include SiSU_Param - def initialize(conn,col,opt) - @conn,@col,@opt=conn,col,opt - @col[:lev]=@col[:lev].to_i - @col[:lev]=0 unless @col[:lev]=~/^[1-6]/ or @col[:lev]==1 or @col[:lev]==2 or @col[:lev]==3 or @col[:lev]==4 or @col[:lev]==5 or @col[:lev]==6 #changed from \d+ ?? - @col[:ocn]=0 unless @col[:ocn]=~/\d+/ - @cX=SiSU_Screen::Ansi.new(@opt.cmd).cX - end - def tuple #% import line - begin - if @col[:en_a] - #puts.inspect "#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}', '#{@col[:en_a]}', '#{@col[:en_z]}'" - @conn.execute(%{ - INSERT INTO documents (lid, metadata_tid, lev, clean, body, ocn, ocnd, ocns, seg, lev1, lev2, lev3, lev4, lev5, lev6, en_a, en_z, digest_clean, digest_all) VALUES (#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}', '#{@col[:en_a]}', '#{@col[:en_z]}', '#{@col[:digest_clean]}', '#{@col[:digest_all]}'); - }) - else - #puts.inspect "#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}'" - @conn.execute(%{ - INSERT INTO documents (lid, metadata_tid, lev, clean, body, ocn, ocnd, ocns, seg, lev1, lev2, lev3, lev4, lev5, lev6, digest_clean, digest_all) VALUES (#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}', '#{@col[:digest_clean]}', '#{@col[:digest_all]}'); - }) - end - if @opt.cmd =~/v/ - if @col[:lev].to_s =~/[1235678]/ - lev=case @col[:lev].to_s - when /1/; ':A' - when /2/; ':B' - when /3/; ':C' - when /5/; ' 2' - when /6/; ' 3' - end - puts %{#{lev}>\t#{@col[:lv1]}\t#{@col[:lv2]}\t#{@col[:lv3]}\t#{@col[:lv4]}\t#{@col[:lv5]}\t#{@col[:lv6]}\t#{@col[:ocn]}\t#{@col[:ocnd]}\t#{@col[:ocns]}} - elsif @col[:lev].to_s =~/[4]/ - puts %{ #{@cX.green}1>#{@cX.off}\t#{@col[:lv1]}\t#{@col[:lv2]}\t#{@col[:lv3]}\t#{@col[:lv4]}\t#{@col[:lv5]}\t#{@col[:lv6]}\t#{@col[:ocn]}\t#{@col[:ocnd]}\t#{@col[:ocns]}\t#{@col[:seg]}} - end - end - rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error - ensure - #@conn.execute("COMMIT") - end - end - end -end -__END__ diff --git a/lib/sisu/0.52/db_remove.rb b/lib/sisu/0.52/db_remove.rb deleted file mode 100644 index 81ec3643..00000000 --- a/lib/sisu/0.52/db_remove.rb +++ /dev/null @@ -1,86 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: modules shared by the different db types, dbi, postgresql, sqlite - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_DB_remove - class Remove - def initialize(opt,conn='' ) - @opt,@conn=opt,conn - @md=SiSU_Param::Parameters.new(@opt).get - @fnb=@md.fnb - @db=SiSU_Env::Info_db.new - end - def remove - del=@conn.select_one(%{ SELECT tid FROM metadata WHERE filename LIKE '#{@opt.fns}'; }) - if del - del_id=del.join - #@conn.execute("BEGIN") - @conn.execute(%{ - DELETE FROM endnotes WHERE metadata_tid LIKE '#{del_id}'; - DELETE FROM endnotes_asterisk WHERE metadata_tid LIKE '#{del_id}'; - DELETE FROM endnotes_plus WHERE metadata_tid LIKE '#{del_id}'; - DELETE FROM documents WHERE metadata_tid LIKE '#{del_id}'; - DELETE FROM urls WHERE metadata_tid LIKE '#{del_id}'; - DELETE FROM metadata WHERE tid LIKE '#{del_id}'; - /* - DELETE FROM documents WHERE documents.metadata_tid LIKE '#{del_id}'; - DELETE FROM endnotes WHERE endnotes.metadata_tid LIKE '#{del_id}'; - DELETE FROM endnotes_asterisk WHERE endnotes_asterisk.metadata_tid LIKE '#{del_id}'; - DELETE FROM endnotes_plus WHERE endnotes_plus.metadata_tid LIKE '#{del_id}'; - DELETE FROM urls WHERE urls.metadata_tid LIKE '#{del_id}'; - DELETE FROM metadata WHERE metadata.tid LIKE '#{del_id}'; - */ - }) - #@conn.execute("COMMIT") - else - tell=SiSU_Screen::Ansi.new(@opt.cmd,"no such file in database #{@db.db_psql}::#{@opt.fns}") - tell.puts_grey #if @opt.cmd.include? ?v - end - end - end -end -__END__ diff --git a/lib/sisu/0.52/db_select.rb b/lib/sisu/0.52/db_select.rb deleted file mode 100644 index a6db4bfa..00000000 --- a/lib/sisu/0.52/db_select.rb +++ /dev/null @@ -1,158 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: modules shared by the different db types, dbi, postgresql, sqlite - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_DB_select - class Case - def initialize(opt,conn='',sql_type='pg') - @opt,@conn,@sql_type=opt,conn,sql_type - #@sdb=Create.new(@conn) - @sdb=SiSU_DB::Create.new(@opt,@conn,@sql_type) - @index=SiSU_DB::Index.new(@opt,@conn,@sql_type) - @sdb_no=SiSU_DB::Drop.new(@opt,@conn,@sql_type) - @sdb_import=SiSU_DB::Import.new(@opt,@conn,@sql_type) if @opt.mod.inspect =~/update|import/ - @remove=SiSU_DB::Remove.new(@opt,@conn) if @opt.mod.inspect =~/update|remove/ - @db=SiSU_Env::Info_db.new - end - def cases - @opt.mod.each do |mod| - case mod - when /^--createdb$/ - @sdb.output_dir? - begin - @sdb.create_db - rescue; @sdb.output_dir? - end - when /^--(?:init(?:ialize)?|create(?:all)?)$/ - @sdb.output_dir? - #@sdb.create_db - begin - @sdb.create_table_metadata - @sdb.create_table - @sdb.create_table_endnotes - @sdb.create_table_endnotes_asterisk - @sdb.create_table_endnotes_plus - @sdb.create_table_urls - @index.create_indexes - rescue; SiSU_Errors::Info_error.new($!,$@,'-D').error; @sdb.output_dir? - end - when /^--createtable(s)?$/ - @sdb.output_dir? - begin - @sdb.create_table_metadata - @sdb.create_table - @sdb.create_table_endnotes - @sdb.create_table_endnotes_asterisk - @sdb.create_table_endnotes_plus - @sdb.create_table_urls - @index.create_indexes - rescue; @sdb.output_dir? - end - when /^--recreate$/ - @sdb.output_dir? - begin - @sdb_no.drop_tables - @sdb.create_table_metadata - @sdb.create_table - @sdb.create_table_endnotes - @sdb.create_table_endnotes_asterisk - @sdb.create_table_endnotes_plus - @sdb.create_table_urls - @index.create_indexes - rescue; @sdb.output_dir? - end - when /^--cr(eate)?lex$/ - @sdb.output_dir? - begin - @sdb.create_table - rescue; @sdb.output_dir? - end - when /^--cr(eate)?metadata$/ - @sdb.output_dir? - begin - @sdb.create_table_metadata - rescue; @sdb.output_dir? - end - when /^--import$/ - @sdb_import.marshal_load - tell=case @sql_type - when /sqlite/; SiSU_Screen::Ansi.new(@opt.cmd,"sqlite #{@db.db_sqlite} database?") - when /pg/; SiSU_Screen::Ansi.new(@opt.cmd,"pgaccess or psql #{@db.db_psql} database?") - else '???' - end - tell.puts_grey if @opt.cmd =~/v/ - when /^--remove$/ - @remove.remove - when /^--update$/ - @remove.remove - @sdb_import.marshal_load - tell=SiSU_Screen::Ansi.new(@opt.cmd,"pgaccess or psql #{@db.db_psql} database?") - tell.puts_grey if @opt.cmd =~/v/ - when /^--index$/ - @index.create_indexes - when /^droptable(s)?$/ - @sdb_no.drop_tables - when /^--dropindex(es)?$/ - @sdb_no.drop_indexes - when /^--(?:dropall|drop)$/ - @sdb_no.drop_tables - #@sdb_no.drop_indexes - when /^--(?:db=)?(?:(?:sq)?lite|pg(?:sql)?|my(?:sql)?)$/ - else - help=SiSU_Help::Help.new - help.summary - help.commands - end - end - begin - @conn.commit if @sql_type =~/sqlite/ - rescue; @sdb.output_dir? - end - end - end -end -__END__ diff --git a/lib/sisu/0.52/db_tests.rb b/lib/sisu/0.52/db_tests.rb deleted file mode 100644 index 8d6d7caf..00000000 --- a/lib/sisu/0.52/db_tests.rb +++ /dev/null @@ -1,104 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: modules shared by the different db types, dbi, postgresql, sqlite - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_DB_tests - class Test - def initialize(info,opt) - @ck,@opt=info,opt - unless @opt.cmd =~/q/ - puts @ck.tp[:fns] - puts @ck.tp[:title] - puts @ck.tp[:creator] if @ck.tp[:creator] - end - end - def verify - unless @opt.cmd =~/q/ - puts @ck.tp[:fns].length.to_s + ' checklength ' + @ck.tp[:fns] if @ck.tp[:fns] and @ck.tp[:fns].length >@ck.lt_filename - puts @ck.tp[:title].length.to_s + ' checklength ' + @ck.tp[:title] if @ck.tp[:title] and @ck.tp[:title].length >@ck.lt_title - puts @ck.tp[:subtitle].length.to_s + ' checklength ' + @ck.tp[:subtitle] if @ck.tp[:subtitle] and @ck.tp[:subtitle].length >@ck.lt_subtitle - puts @ck.tp[:creator].length.to_s + ' checklength ' + @ck.tp[:creator] if @ck.tp[:creator] and @ck.tp[:creator].length >@ck.lt_creator - puts @ck.tp[:illustrator].length.to_s + ' checklength ' + @ck.tp[:illustrator] if @ck.tp[:illustrator] and @ck.tp[:illustrator].length >@ck.lt_illustrator - puts @ck.tp[:translator].length.to_s + ' checklength ' + @ck.tp[:translator] if @ck.tp[:translator] and @ck.tp[:translator].length >@ck.lt_translator - puts @ck.tp[:prepared_by].length.to_s + ' checklength ' + @ck.tp[:prepared_by] if @ck.tp[:prepared_by] and @ck.tp[:prepared_by].length >@ck.lt_prepared_by - puts @ck.tp[:digitized_by].length.to_s + ' checklength ' + @ck.tp[:digitized_by] if @ck.tp[:digitized_by] and @ck.tp[:digitized_by].length >@ck.lt_digitized_by - puts @ck.tp[:subject].length.to_s + ' checklength ' + @ck.tp[:subject] if @ck.tp[:subject] and @ck.tp[:subject].length >@ck.lt_subject - puts @ck.tp[:description].length.to_s + ' checklength ' + @ck.tp[:description] if @ck.tp[:description] and @ck.tp[:description].length >@ck.lt_description - puts @ck.tp[:publisher].length.to_s + ' checklength ' + @ck.tp[:publisher] if @ck.tp[:publisher] and @ck.tp[:publisher].length >@ck.lt_publisher - puts @ck.tp[:contributor].length.to_s + ' checklength ' + @ck.tp[:contributor] if @ck.tp[:contributor] and @ck.tp[:contributor].length >@ck.lt_contributor - puts @ck.tp[:date].length.to_s + ' checklength ' + @ck.tp[:date] if @ck.tp[:date] and @ck.tp[:date].length >@ck.lt_date - puts @ck.tp[:date_created].length.to_s + ' checklength ' + @ck.tp[:date_created] if @ck.tp[:date_created] and @ck.tp[:date_created].length >@ck.lt_date_created - puts @ck.tp[:date_issued].length.to_s + ' checklength ' + @ck.tp[:date_issued] if @ck.tp[:date_issued] and @ck.tp[:date_issued].length >@ck.lt_date_issued - puts @ck.tp[:date_valid].length.to_s + ' checklength ' + @ck.tp[:date_valid] if @ck.tp[:date_valid] and @ck.tp[:date_valid].length >@ck.lt_date_valid - puts @ck.tp[:date_available].length.to_s + ' checklength ' + @ck.tp[:date_available] if @ck.tp[:date_available] and @ck.tp[:date_available].length >@ck.lt_date_available - puts @ck.tp[:date_modified].length.to_s + ' checklength ' + @ck.tp[:date_modified] if @ck.tp[:date_modified] and @ck.tp[:date_modified].length >@ck.lt_date_modified - puts @ck.tp[:type].length.to_s + ' checklength ' + @ck.tp[:type] if @ck.tp[:type] and @ck.tp[:type].length >@ck.lt_type - puts @ck.tp[:format].length.to_s + ' checklength ' + @ck.tp[:format] if @ck.tp[:format] and @ck.tp[:format].length >@ck.lt_format - puts @ck.tp[:identifier].length.to_s + ' checklength ' + @ck.tp[:identifier] if @ck.tp[:identifier] and @ck.tp[:identifier].length >@ck.lt_identifier - puts @ck.tp[:source].length.to_s + ' checklength ' + @ck.tp[:source] if @ck.tp[:source] and @ck.tp[:source].length >@ck.lt_source - puts @ck.tp[:language].length.to_s + ' checklength ' + @ck.tp[:language] if @ck.tp[:language] and @ck.tp[:language].length >@ck.lt_language - puts @ck.tp[:language_original].length.to_s + ' checklength ' + @ck.tp[:language_original] if @ck.tp[:language_original] and @ck.tp[:language_original].length >@ck.lt_language_original - #puts @ck.tp[:language_char].length.to_s + ' checklength ' + @ck.tp[:language_char] if @ck.tp[:language_char] and @ck.tp[:language_char].length >@ck.lt_language_char - #puts @ck.tp[:language_original_char].length.to_s + ' checklength ' + @ck.tp[:language_original_char] if @ck.tp[:language_original_char] and @ck.tp[:language_original_char].length >@ck.lt_language_original_char - puts @ck.tp[:relation].length.to_s + ' checklength ' + @ck.tp[:relation] if @ck.tp[:relation] and @ck.tp[:relation].length >@ck.lt_relation - puts @ck.tp[:coverage].length.to_s + ' checklength ' + @ck.tp[:coverage] if @ck.tp[:coverage] and @ck.tp[:coverage].length >@ck.lt_coverage - puts @ck.tp[:rights].length.to_s + ' checklength ' + @ck.tp[:rights] if @ck.tp[:rights] and @ck.tp[:rights].length >@ck.lt_rights - puts @ck.tp[:copyright].length.to_s + ' checklength ' + @ck.tp[:copyright] if @ck.tp[:copyright] and @ck.tp[:copyright].length >@ck.lt_copyright - puts @ck.tp[:owner].length.to_s + ' checklength ' + @ck.tp[:owner] if @ck.tp[:owner] and @ck.tp[:owner].length >@ck.lt_owner - puts @ck.tp[:keywords].length.to_s + ' checklength ' + @ck.tp[:keywords] if @ck.tp[:keywords] and @ck.tp[:keywords].length >@ck.lt_keywords - puts @ck.tp[:abstract].length.to_s + ' checklength ' + @ck.tp[:abstract] if @ck.tp[:abstract] and @ck.tp[:abstract].length >@ck.lt_abstract - puts @ck.tp[:comment].length.to_s + ' checklength ' + @ck.tp[:comment] if @ck.tp[:comment] and @ck.tp[:comment].length >@ck.lt_comment - puts @ck.tp[:loc].length.to_s + ' checklength ' + @ck.tp[:loc] if @ck.tp[:loc] and @ck.tp[:loc].length >@ck.lt_loc - puts @ck.tp[:dewey].length.to_s + ' checklength ' + @ck.tp[:dewey] if @ck.tp[:dewey] and @ck.tp[:dewey].length >@ck.lt_dewey - puts @ck.tp[:isbn].length.to_s + ' checklength ' + @ck.tp[:isbn] if @ck.tp[:isbn] and @ck.tp[:isbn].length >@ck.lt_isbn - puts @ck.tp[:pg].length.to_s + ' checklength ' + @ck.tp[:pg] if @ck.tp[:pg] and @ck.tp[:pg].length >@ck.lt_pg - puts @ck.tp[:date] if @ck.tp[:date] !~/\d\d-\d\d-\d\d/ - end - end - end -end -__END__ diff --git a/lib/sisu/0.52/dbi.rb b/lib/sisu/0.52/dbi.rb deleted file mode 100644 index 6c1b8adf..00000000 --- a/lib/sisu/0.52/dbi.rb +++ /dev/null @@ -1,119 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: postgresql module, dbi import frame - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_DBI #% database building - require SiSU_lib + '/help' - require SiSU_lib + '/sysenv' - include SiSU_Env - include SiSU_Screen - require SiSU_lib + '/param' - include SiSU_Param - require SiSU_lib + '/shared_db' - include SiSU_DB - require SiSU_lib + '/shared_html_lite' - include SiSU_Format_Shared - class SiSU_SQL - def initialize(opt) - SiSU_Env::Load.new('dbi',true).prog - @opt=opt - @db=SiSU_Env::Info_db.new - if @opt.cmd =~/d/i or @opt.mod.inspect =~/--pg(?:sql)?|(?:sq)?lite/ - @sql_type=if @opt.cmd=~/D/ or @opt.mod.inspect =~/--pg(?:sql)?/; 'pg' - elsif @opt.cmd =~/d/ and @opt.mod.inspect =~/--(?:db[=-])?pg(?:sql)?/; 'pg' - elsif @opt.mod.inspect =~/--(?:sq)?lite/; 'sqlite' - elsif @opt.cmd =~/d/ and @opt.mod.inspect =~/--(?:db[=-])?(?:sq)?lite/; 'sqlite' - #elsif @opt.cmd =~/d/ and @opt.mod.select =~/--my(?:sql)?/; 'mysql' - else 'sqlite' - end - end - end - def read_psql - begin - db,user,dbi=@db.db_psql,@db.user,@db.dbi_psql - @conn=DBI.connect(dbi,user,db) - rescue - if @opt.mod.inspect=~/--(createall|create)/ - puts %{manually create the database: "#{db}" if it does not yet exist} - #sudo su -p postgres; createdb #{db}; #[createuser?] - end - SiSU_DB::Case.new(@opt,@conn,@sql_type).cases - @conn=DBI.connect(dbi,user,db) - ensure - end - end - def read_sqlite - begin - sql_type='sqlite' - dbi=@db.dbi_sqlite - @conn=DBI.connect(dbi) - rescue - ensure - end - end - def connect - case @sql_type - when /pg/; read_psql - when /sqlite/; read_sqlite - end - tell=SiSU_Screen::Ansi.new(@opt.cmd,"DBI (#@sql_type) #{@opt.mod}") - tell.dbi_title unless @opt.cmd =~/q/ - begin - SiSU_DB::Case.new(@opt,@conn,@sql_type).cases - rescue; SiSU_Errors::Info_error.new($!,$@,@cf,@opt.fns).error - ensure - end - begin - @conn.disconnect if @sql_type =~/sqlite/ - rescue - connect - end - end - end -end -__END__ - diff --git a/lib/sisu/0.52/defaults.rb b/lib/sisu/0.52/defaults.rb deleted file mode 100644 index 29027b7b..00000000 --- a/lib/sisu/0.52/defaults.rb +++ /dev/null @@ -1,2045 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: Default values (reset by skins) - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -$latex_run=nil -module SiSU_Viz - require 'uri' - require SiSU_lib + '/sysenv' - include SiSU_Env - require SiSU_lib + '/css' - include SiSU_Style - class Skin - #attr_accessor :glyph,:html,:php,:javascript,:path,:text,:url,:color,:icon,:font,:markup,:paragraph,:table,:table_do,:indent,:margin,:png,:nav_txt,:nav_png,:banner,:widget - def initialize - #@css=SiSU_Env::CSS_default.new - @fonts='verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman' # 'verdana, arial, georgia, tahoma, sans-serif, helvetica, "times new roman", times, roman' - @dir=SiSU_Env::Info_env.new - @date=SiSU_Env::Info_date.new - end - #% glyph - def glyph_bullet # • - '• ' # [• flagged] - end - #% html - def html_hardspace - ' ' - end - #% php - def php_persist - end - #% javascript #kxjs knxjs - def js_home - end - def js_infobox - end - def js_knxjs - end - def js_head - end - def js_top - end - def js_sisu - end - def js_home - end - def js_sponsor - end - def js_books - end - def js_journals - end - def js_conferences - end - def js_services - end - def js_catalogue - end - def js_doc - end - def js_toc - end - def js_seg - end - def js_mail - end - def js_manifest - end - def js_status - end - def js_next - end - def js_prev - end - def js_portrait - end - def js_landscape - end - def js_pdf - end - def js_odf - end - def js_concordance - end - def js_instruments - end - def js_external - end - def js_gopher - end - def js_ftp - end - def js_law - end - def js_disclaimer - end - def js_old - end - #% path - def path_stylesheet_home - %{ } - end - #% text #changed from txt to avoid naming conflicts #FOLLOW - def txt_generator - v=SiSU_Env::Info_version.new.get_version - %{ - } - end - def txt_generator_comment - v=SiSU_Env::Info_version.new.get_version - %{ } - end - def txt_hp - ' SiSU' - end - def txt_hp_alias - 'SiSU' - end - def txt_home - 'SiSU' - end - def txt_signature # used in latex/pdf footer - 'SiSU' - end - #% url - def url_urify(uri) - URI.parse(uri) - end - def url_sisu - 'http://www.jus.uio.no/sisu' - end - def url_root - '/sisu' #watch - end - def url_root_http - 'http://www.jus.uio.no/sisu' #watch - end - def url_home - 'http://www.jus.uio.no/sisu' # used in pdf header - end - def url_site #used as stub... where there are subdirectories and is different from home - url_home - #'http://www.jus.uio.no/sisu' # used in pdf header - end - def url_txt - 'www.jus.uio.no/sisu' - end - def url_path_image_base #used for html image display - '../_sisu/image_local' - end - def url_path_image #used for html image display - '../_sisu/image' - end - def url_path_ebook_dir - './ebook' - end - def url_path_ebook_images - '.' - end - def url_promo - '' - end - def url_promo_home - '' - end - #% color - def color_shadow - '"4"' - end - def color_body - %{} - end - def color_white - '"#ffffff"' - end - def color_black - '#000000' - end - def color_shadow #hmmm - '"4"' - end - def color_blue_dark - '#000099' - end - def color_blue - 'blue' - end - def color_blue_base - '#b9d4dd' - #'#eff6ff' #light - #'#c0d9d9' #light - #'#0044cc' #pale - #'#c0d9d9' #sky - end - def color_blue_ink - '#003399' - end - def color_blue_tinge - '#e3ecef' - #'#d7dddd' - #'#f2f5f7' - end - def color_blue_grey - '#8faebf' - end - def color_blue_murky - '#437389' - end - #def color_brown - # '#423a27' - #end - def color_beige - '#f1e8de' - #'#fff3b6'#custard - end - def color_subtleglow - '#dddccc' - end - def color_glow - '#fff0c3' - end - def color_rose - '#ffdec9' - end - def color_turquoise - '#1c869b' - end - def color_grey_pale - '#eeeeee' - # '#dddddd' #light - end - def color_grey_medium - '#cccccc' - end - def color_grey - '#999999' - end - def color_yellow_light - '#fff3b6' - end - def color_yellow - '#ffde14' - end - def color_yellow_dark - '#ffcc00' - end - def color_green_light - '#b7d398' # #e2efd5 #b7d398 #b1c999 # '#aed19e' - end - def color_green - '#0a8400' - end - def color_green_dark - '#086800' - end - def color_ruby - '#a00000' - end - def color_maroon - '#800000' - end - def color_paper - %{"#{color_white}"} - end - def color_band1 - %{"#{color_white}"} - #'"#777777"' - end - def color_band2 - %{"#{color_white}"} - #'"#cccccc"' - end - def color_body - %{\n\n} - end - def color_font_face #was font WATCH - "#{color_black}" - end - def color_surround - %{"#{color_white}"} - end - def color_band - %{"#{color_white}"} - end - def color_table1 - 'ffffcc' - end - def color_table2 - 'c0d0f0' - end - def color_band1 - '"#ffffff"' - end - def color_band2 - '"#ffffff"' - end - #% icon - def icon_ico - 'rb7.ico' - end - def icon_sisu - 'sisu.png' - end - def icon_manifest - 'bullet_red.png' - end - def icon_doc - 'b_doc.png' - end - def icon_toc - 'b_toc.png' - end - def icon_wmp - 'b_wmp.png' - end - def icon_odf - 'b_odf.png' - end - def icon_pdf - 'b_pdf.png' - end - def icon_pdf_portrait - 'b_pdf.png' - end - def icon_pdf_landscape - 'b_pdf.png' - end - def icon_status - 'b_status.png' - end - def icon_external - 'b_ext.png' - end - def icon_external_toc - 'b_ext_toc.png' - end - def icon_seg_toc - 'b_bluebell.png' - end - def icon_crosslink_toc - 'b_amber.png' - end - def icon_mail - 'b_mail.png' - end - def icon_para - 'b_para.png' - end - def icon_pdf - 'b_pdf.png' - end - def icon_ftp - 'b_ftp.png' - end - def icon_gopher - 'b_gopher.png' - end - def icon_choice - 'b_choice.png' - end - def icon_new - 'b_new.png' - end - def icon_book - 'b_amber.png' - # b_book.png - end - def icon_dot_clear - 'dot_clear.png' - end - def icon_dot_white - 'dot_white.png' - end - def icon_dot - icon_dot_white - end - def icon_amber - 'b_amber.png' - end - def icon_rose - 'b_rose.png' - end - def icon_bluebell - 'b_bluebell.png' - end - def icon_home_button - 'sisu.png' - end - def icon_home_banner - 'sisu.png' - end - def icon_site - 'b_home.png' - end - def icon_bluedot - 'blueband.png' - end - def icon_next - 'arrow_next_red.png' - end - def icon_previous - 'arrow_prev_red.png' - end - def icon_up - 'arrow_up_red.png' - end - #% font - def font_fonts - @fonts - end - def font_face - %{face="#{font_fonts}"} - end - def font_lmtoc_face - %{face="#{font_fonts}"} - end - def font_ebook_face - %{face="#{font_fonts}"} - end - def font_face_lmtoc - %{face="#{font_fonts}"} - end - def font_color - 'color="#000000"' - end - def font_size - 'size="4"' - end - def font_size_txt - 'size="4"' - end - def font_size_txt_00 - 'size="3"' - end - def font_size_endnote - 'size="3"' - end - def font_small - 'size="3"' - end - def font_tiny - 'size="2"' - end - #% markup - def markup_italics_list #regular expression of words to be italised - end - def markup_bold_list #regular expression of words to be made bold - 'SiSU' - end - def markup_make_italic - if defined? italics_list and italics_list - #make=italics_list.split(/;\s+/).join('|').strip - make={} - if italics_list - r=italics_list.dup - x=case r - when /\/i$/; 'i' - else '' - end - r.gsub!(/^\/(.+?)\/i?/,'\1') - r.gsub!(/\(/,'(?:') # avoid need to escape use of brackets within regex provided - m='\b(' + r + ')\b' - make[:str] - make[:regx]=if x =~/i/; /#{m}/i - else /#{m}/ - end - else nil - end - end - end - def markup_make_bold - if defined? bold_list and not bold_list.empty? - make={} - if bold_list - #make=bold_list.split(/;\s+/).join('|').strip - r=bold_list.dup - x=case r - when /\/i$/; 'i' - else '' - end - r.gsub!(/^\/(.+?)\/i?/,'\1') - r.gsub!(/\(/,'(?:') # avoid need to escape use of brackets within regex provided - m='\b(' + r + ')\b' - make[:str] - make[:regx]=if x =~/i/; /#{m}/i - else /#{m}/ - end - else nil - end - make - end - end - #% paragraph - def paragraph_txt - %{

} - end - def paragraph_txt_00 - %{

} - end - def paragraph_font_citation - %{} - end - def paragraph_endnote - %{

} - end - def paragraph_table - %{

} - end - def paragraph_table_xml - end - def paragraph_tiny - %{

} - end - def paragraph_small - %{

} # keep but not used? - end - def paragraph_font_tiny - %{} - end - def paragraph_font_small - %{} - end - def paragraph_heading_1 - %{

} - end - def paragraph_heading_1_center - %{

} - end - #% table - def table_close - ' -' - end - def table_close_centered_table - end - def table_align_A - end - def table_align_B - end - def table_align_C - end - def table_width_1 - '"100%"' - end - def table_width_2 - '"99%"' - end - def table_width_3 - '"94%"' - end - def table_width_4 - '"90%"' - end - def table_width_txt - '"94%"' - end - def table_width_txt_avgo - '"100%"' - end - def table_width_txt_r - '"96%"' - end - def table_cellpad_small_paper_margins - '"6"' - end - def table_cellpad_paper_margins - '"36"' - end - def table_cellpad_A - '"0"' - end - def table_cellpad_B - '"20"' - end - def table_cellpad_shadow - '"4"' - end - def table_cellpad_band - '"16"' - end - def table_cellpad_box - '"20"' - end - def table_table_align_A - '
' - end - def table_table_align_B - '
' - end - def table_table_align_C - ' ' - end - #% table_do - def table_do_table_paper - %{#{table_align_C}
\n

\n} - end - def table_do_table_surround - %{ - -
\n} - end - #% indent - def indent_level_0 - '"1%"' - end - def indent_level_1 - '"4%"' - end - def indent_level_2 - '"6%"' - end - def indent_level_3 - '"8%"' - end - def indent_level_4 - '"10%"' - end - #% margin - def margin_num - '

' - end - def margin_numless - '' - end - def margin_num_css - ' ' - end - def margin_num_header - '' - end - def margin_txt_00_1 - %{ - -
-} - end - def margin_txt_w1 - %{ - -
 } - end - def margin_txt_w2 - %{ - -
 } - end - def margin_txt_0 - %{ -
-} - end - def margin_txt_1 - %{ -
} - end - def margin_txt_2 - %{ - -
-} - end - def margin_txt_3 - %{ - -
-} - end - def margin_css - ' -
' - end - #% png - def png_ico - %{ } - end - def png_sisu #check url path - %{ - SiSU - } - end - def png_hp - dir=SiSU_Env::Info_env.new #(@fns) - %{ - #{txt_home} - } - end - def png_site - #dir=SiSU_Env::Info_env.new #(@fns) - %{@} - end - def png_homepage - png_site - end - def png_nav - %{Contents} - end - def png_manifest - %{Document Manifest} - end - def png_doc - %{Full Text} - end - def png_toc - %{TOC linked} - end - def png_odf - %{ODF/ODT} - end - def png_pdf - %{PDF} - end - def png_pdf_portrait - %{PDF portrait} - end - def png_pdf_landscape - %{PDF landscape} - end - def png_wmp - %{Concordance} - end - def png_para - %{Segment} - end - def png_status - %{Membership status} - end - def png_mark - %{*} - end - def png_doc_tiny - %{Doc} - end - def png_toc_tiny - %{TOC} - end - def png_status_tiny - %{Status, Member States} - end - def png_ftp - %{FTP} - end - def png_gopher - %{Gopher} - end - def png_crosslink - %{lateral hop} - end - def png_crosslink_ext - %{lateral hop} - end - def png_home - dir=SiSU_Env::Info_env.new #(@fns) - %{#{txt_home} -->} - end - def png_home_button - #dir=SiSU_Env::Info_env.new #(@fns) - %{#{txt_home} -->} - end - def png_book - %{Cameron May Books} - end - #% png_nav - def png_nav_home - end - def png_nav_toc - %{TOC} - end - def png_nav_doc - end - def png_nav_previous - %{<< previous} - end - def png_nav_next - %{next >>} - end - def png_nav_pre - png_nav_previous - end - def png_nav_nxt - png_nav_next - end - def png_nav_pdf - %{PDF} - end - def png_nav_pdf_portrait - %{pdf portrait} - end - def png_nav_pdf_landscape - %{pdf landscape} - end - def png_nav_dot_toc - %{^} - end - def png_nav_dot_previous - %{<} - end - def png_nav_dot_next - %{>} - end - def png_nav_dot_pre - png_nav_dot_previous - end - def png_nav_dot_nxt - png_nav_dot_next - end - #% nav_txt - def nav_txt_home - %{ - #{png_site}  - } - end - def nav_txt_home_button - %{ - #{png_home_button}  - } - end - def nav_txt_homepage - %{ - #{png_site} homepage  - } - end - def nav_txt_toc_link - %{ - #{png_toc}  toc  - } - end - def nav_txt_toc_link_verbose - %{ - #{png_toc}  segments' toc  - } - end - def nav_txt_doc_link - %{ - #{png_doc}  scroll  - } - end - def nav_txt_manifest - %{ - #{png_manifest}  ?  - } - end - def nav_txt_concordance - %{ -   A-Z  - } - end - def nav_txt_previous - ' -   << Previous   - - Full Text ' - end - def nav_txt_next - %{ -   Next     >>   - } - end - def nav_txt_odf - %{ - #{png_odf}  odt  - } - end - def nav_txt_pdfs - %{ - pdfs   - } - end - def nav_txt_pdf_portrait - %{ - #{png_pdf_portrait} -   pdf  - } - end - def nav_txt_pdf_landscape - %{ - #{png_pdf_landscape} -   pdf  - } - end - #% banner - def banner_home - %{
- - #{png_site} - -
- - an -
- ( international | transnational ) -
- commercial law & e-commerce -
- infrastructure monitor
} - end - def banner_home_guide - %{
- - #{png_doc} LM toc - - - #{png_doc} LM 20** - -
} - end - def banner_home_button_only - %{ - #{png_home_button} - } - end - def banner_home_button #yellow_dark now white - %{ - -
- - #{png_home_button} - - -#{table_close}} - end - def banner_home_and_index_buttons #yellow_dark now white - %{ - - -
- - -
- - #{png_home} - -
-
- - -
- - -  This text's sub-  -
-  Table of Contents  -
-
-
-
-   -#{table_close}} - end - def banner_url_txt_sisu - %{SiSU} - end - def banner_band #yellow_dark now white - %{ - -
- - #{png_home} - - -#{table_close}} - end - def banner_credit_band - %{ -
- -
- -
} - end - def banner_instrument_cover_band_scr - ' -
' - end - def banner_instrument_cover_band_seg - ' -
' - end - #% widget - def widget_promo # Array used to build promo from list.yml and promo.yml - # ['sisu_icon','sisu','sisu_search_libre','open_society','fsf','ruby'] - end - def widget_browsers -< - -
-

- - If you have problems viewing pages on this site please update your browser: - -

-#{table_close} - - - - - - - - - -
-

- - -  Epiphany - - ® | - -

-
-

- - -  Galeon - - ® | - -

-
-

- - - I-Explorer - - ® | - -

-
-

- - - Kazehakase - ® |

- -

- - - Konqueror - ® |

-

- - - Mozilla - - - Firefox - - ® | - -

-
-

- - - Netscape - - ® | - -

-
-

- - - Opera - - ® | - -

-
-

- - - Safari - - ® - -

-#{table_close} - - - - - - - - - - -WOK - end - def widget_pdfviewers -<
-

- - for console/text viewing: - -

-
-

- - - elinks -  | - -

-
-

- - - links2 -  | - -

-
-

- - - w3m - - -

-
-

- - for lightweight gui (X) viewing try: - -

-
-

- - - Dillo - -  | - -

-
-

- - -  Epiphany - - ® | - -

-
-

- - -  Galeon -  | - -

-
-

- - - links2 -g - - -

-#{table_close} -
- -
-

- - & for - - pdf - - viewings of this site we recommend stand alone viewers -
- (rather than web browser plugins): -
-

-#{table_close} - - - - - - - - - - - - -
-

- - - Acrobat Reader - - ® -  | - -

-
-

- - - Evince - - ® - -

-
-

- -  GhostView® , - - GV® - - & - - GSview® - -  | - -

-
-

- - -  Xpdf - - ® - -

-#{table_close} -WOK - end - def widget_googlegroups -< -
- Google Groups - - Subscribe to SiSU e-docs -
- Email: - - - - -
- -
-
- - Browse Archives - at - - groups-beta.google.com -
-WOK - end - def widget_sisu - v=SiSU_Env::Info_version.new.get_version -< -
-

- - presentations' look and feel -
- generated by -
- - SiSU - -
- - #{v[:project]} - -
- version #{v[:version]} -
- #{v[:date_stamp]} (#{v[:date]}) -
-
-

- -
-

- - Generated by - - SiSU - -
- #{v[:project]} #{v[:version]} #{v[:date_stamp]} -
- - www.jus.uio.no/sisu - -
- Using: -
- Standard SiSU markup syntax, -
- Standard SiSU meta-markup syntax, and the -
- Standard SiSU object citation numbering and system, (object/text positioning system) -
- © Ralph Amissah 1997, current #{@date.year}. -
- All Rights Reserved. -
- SiSU is the result of several years of research and development in electronic - publishing, commenced in 1993 and under active development since 1997. -
- SiSU is released under - - GPL 2 - - or later - - http://www.gnu.org/copyleft/gpl.html - -
- (SiSU's first public release on January 4th 2005) -
-
-

-

- - © Ralph Amissah -
- 1993, current #{@date.year} -
- All Rights Reserved -
- w3 since October 3 1993 -
- - ralph@amissah.com - -
-
-

-WOK - end - def widget_way_better - < - - Developed -
- using - - Ruby - -
- on - - Debian/Gnu/Linux - - software infrastructure, -
- & with the usual GPL (or OSS) suspects. -
- Better - "performance, reliability, scalability, security -
- & total cost of ownership" -
- [not to mention flexibility & choice] -
-
- Get With the Future -
- - Way Better! - -
-

-#{table_close} -#{table_close} -WOK - end - def widget_wayBetter - widget_way_better - end - #% credits - def credits_itl_cover_band - %{ -
- -
- -
- - -
- -
- \@ -
- #{txt_home} -
- #{banner_url_txt_sisu} -
-
-#{table_close*4}} - end - def credits_splash - %{
- - -
- #{widget_sisu}#{widget_way_better}#{widget_browsers}#{widget_pdfviewers} -
-
} - end - #% bottom - def bottom_surround - %{
#{table_close} -
- -
-#{table_close} - - #{banner_band} -#{table_close} - -
- - - -} - end - def scroll(text) - if @md.fns =~ /\.[_-]?sst$/ - scroll=%{ -} - end - end - def seg(text) - %{ -} - end - def search - env=SiSU_Env::Info_env.new(@md.fns,@md) - env.widget.search_form - end - def manifest - %{} - end - def pdf - pdf=if @md.programs[:pdf] and @cf_defaults.cf_0 =~/p/ - %{ - - -} - else '' - end - end - def odf - odf=if @cf_defaults.cf_0 =~/o/ - %{ -} - else '' - end - end - def concordance(text) - if @md.concord_make or @cf_defaults.cf_0 =~/w/ - %{} - else '' - end - end - end - class Head_toc < Head_information - def initialize(md) - super(md) - @md=md - @tocband_scroll,@tocband_segtoc=make_scroll,make_seg - end - def scroll_head_navigation_band - pdf=if @md.programs[:pdf] - < - #{make_seg_scroll_pdf} - -WOK - else '' - end - %{
- #{table_close} - - #{credits_splash} -#{table_close} - -} - end - end - class Home < Skin - def initialize - @v=SiSU_Env::Info_version.new.get_version - @dir=SiSU_Env::Info_env.new - end - def redirect - < -SiSU - - - -SiSU informtion provided at www.jus.uio.no/sisu/SiSU

-If your browser supports redirection, you will be escorted there shortly. - - -WOK - end - def index - < - - -SiSU information Structuring Universe - Structured -information, Serialized Units - software for electronic texts, -documents, books, digital libraries in plaintext, html, XHTML, XML, -ODF (OpenDocument), LaTeX, PDF, SQL (PostgreSQL and SQLite), and -for search - - - - - - - - - - - - - -

-

- - SiSU >> - -

-

- SiSU information Structuring Universe -

-

- Structured information, Serialized Units -

-

-software for electronic texts, document collections, books, digital libraries, and search -

-

- with "atomic search" and text positioning system (shared text citation numbering: "ocn") -

-

-outputs include: plaintext, html, XHTML, XML, ODF (OpenDocument), LaTeX, PDF, SQL (PostgreSQL and SQLite) -

-
- -
-

- - SiSU - -

-

- --- -

-

- - What does SiSU do? Summary - -

-

- --- -

-

- - Book Samples and Markup Examples - -

-

- --- -

-

- - Object Citation Numbering - ocn - -

-

(a text positioning system)

-

- --- -

-

- - Search - "granular" - -

- Of interest is the ease of streaming documents to a relational database, at an object (roughly paragraph) level and the potential for increased precision in the presentation of matches that results thereby. The ability to serialise html, LaTeX, XML, SQL, (whatever) is also inherent in / incidental to the design. For a description see the - - abandoned U.S. provisional patent application - -

-

- --- -

-

- - Download - -

-

- --- -

-

- - Changelog - -

-

- --- -

-

- - License - -

-

- Gnu / Linux / Unix -

-

- ============= -

-

- - sisu man pages - -

-

- --- -

-

- document preparation can be on any platform, in any editor: - (syntax highlight support currently for: vim, kate, write, gedit, diakonos) -

-

- - Syntax highlighting - -

-

- ============= -

-

- - * Composite document - -

-

- the composite document is a superset of the following documents: -

-

- - SiSU description - -

-

- - SiSU examples - -

-

- - SiSU chronology - -

-

- - SiSU technical - -

-

- - SiSU FAQ - -

-

- - SiSU download - -

-

- - SiSU changelog - -

-

- - SiSU license - -

-

- - SiSU standard - -

-

- - SiSU abandoned provisional patent - -

-

- Note: the placement of SiSU documents on the Net predate the release of SiSU. -

-
-
-

- For less markup than the most elementary HTML you can have more. -

-

SiSU - Structured information, Serialized Units for electronic documents, is an information structuring, transforming, publishing and search framework with the following features:

-

-(i) markup syntax: -(a) -simpler than html, -(b) -mnemonic, influenced by mail/messaging/wiki markup practices, -(c) human readable, and easily writable,

-

(ii) -(a) -minimal markup requirement, -(b) -single file marked up for multiple outputs,

-

-notes -

-

-* -documents are prepared in a single UTF-8 file using a minimalistic mnemonic syntax. Typical literature, documents like "War and Peace" require almost no markup, and most of the headers are optional. -

-

-* -markup is easily readable/parsed by the human eye, (basic markup is simpler and more sparse than the most basic html), [this may also be converted to XML representations of the same input/source document]. -

-

-* -markup defines document structure (this may be done once in a header pattern-match description, or for heading levels individually); basic text attributes (bold, italics, underscore, strike-through etc.) as required; and semantic information related to the document (header information, extended beyond the Dublin core and easily further extended as required); the headers may also contain processing instructions. -

-

(iii) -(a) -multiple outputs primarily industry established and institutionally accepted open standard formats, include amongst others: plaintext (UTF-8); html; (structured) XML; ODF (Open Document text)l; LaTeX; PDF (via LaTeX); SQL type databases (currently PostgreSQL and SQLite). Also produces: concordance files; document content certificates (md5 or sha256 digests of headings, paragraphs, images etc.) and html manifests (and sitemaps of content). - -(b) - -takes advantage of the strengths implicit in these very different output types, (e.g. PDFs produced using typesetting of LaTeX, databases populated with documents at an individual object/paragraph level, making possible granular search (and related possibilities))

-

(iv) -outputs share a common numbering system (dubbed "object citation numbering" (ocn)) that is meaningful (to man and machine) across various digital outputs whether paper, screen, or database oriented, (PDF, html, XML, sqlite, postgresql), this numbering system can be used to reference content.

-

-(v) -SQL databases are populated at an object level (roughly headings, paragraphs, verse, tables) and become searchable with that degree of granularity, the output information provides the object/paragraph numbers which are relevant across all generated outputs; it is also possible to look at just the matching paragraphs of the documents in the database; [output indexing also work well with search indexing tools like hyperesteier].

-

-(vi) - use of semantic meta-tags in headers permit the addition of semantic information on documents, (the available fields are easily extended)

-

-(vii) -creates organised directory/file structure for (file-system) output, easily mapped with its clearly defined structure, with all text objects numbered, you know in advance where in each document output type, a bit of text will be found (e.g. from an SQL search, you know where to go to find the prepared html output or PDF etc.)... there is more; easy directory management and document associations, the document preparation (sub-)directory may be used to determine output (sub-)directory, the skin used, and the SQL database used,

-

-(viii) -"Concordance file" wordmap, consisting of all the words in a document and their (text/ object) locations within the text, (and the possibility of adding vocabularies),

-

-(ix) -document content certification and comparison considerations: -(a) -the document and each object within it stamped with an md5 hash making it possible to easily check or guarantee that the substantive content of a document is unchanged, -(b) -version control, documents integrated with time based source control system, default RCS or CVS with use of $Id$ tag, which SiSU checks -

-(x) -SiSU's minimalist markup makes for meaningful "diffing" of the substantive content of markup-files,

-

-(xi) -easily skinnable, document appearance on a project/site wide, directory wide, or document instance level easily controlled/changed,

-

-(xii) -in many cases a regular expression may be used (once in the document header) to define all or part of a documents structure obviating or reducing the need to provide structural markup within the document,

-

-(xiii) -prepared files may be batch process, documents produced are static files so this needs to be done only once but may be repeated for various reasons as desired (updated content, addition of new output formats, updated technology document presentations/representations)

-

-(xiv) -possible to pre-process, which permits: the easy creation of standard form documents, and templates/term-sheets, or; building of composite documents (master documents) from other sisu marked up documents, or marked up parts, i.e. import documents or parts of text into a main document should this be desired

-

-there is a considerable degree of future-proofing, output representations are "upgradeable", and new document formats may be added. -

-

-(xv) -there is a considerable degree of future-proofing, output representations are "upgradeable", and new document formats may be added: -(a) -modular, (thanks in no small part to Ruby) another output format required, write another module.... -(b) easy to update output formats (eg html, XHTML, LaTeX/PDF produced can be updated in program and run against whole document set), -(c) easy to add, modify, or have alternative syntax rules for input, should you need to,

-

-(xvi) -scalability, dependent on your file-system (ext3, Reiserfs, XFS, whatever) and on the relational database used (currently Postgresql and SQLite), and your hardware,

-

-(xvii) -only marked up files need be backed up, to secure the larger document set produced,

-

-(xviii) -document management,

-

-(xix) -Syntax highlighting for SiSU markup is available for a number of text editors.

-

(xx) remote operations: -(a) -run SiSU on a remote server, (having prepared sisu markup documents locally or on that server, i.e. this solution where sisu is installed on the remote server, would work whatever type of machine you chose to prepare your markup documents on), -(b) -generated document outputs may be posted by sisu to remote sites (using rsync/scp) -(c) -document source (plaintext utf-8) if shared on the net may be identified by its url and processed locally to produce the different document outputs.

-

-(xxi) -document source may be bundled together (automatically) with associated documents (multiple language versions or master document with inclusions) and images and sent as a zip file called a sisupod, if shared on the net these too may be processed locally to produce the desired document outputs, these may be downloaded, shared as email attachments, or processed by running sisu against them, either using a url or the filename. -

-

-(xxii) -for basic document generation, the only software dependency is Ruby, and a few standard Unix tools (this covers plaintext, html, XML, ODF, LaTeX). To use a database you of course need that, and to convert the LaTeX generated to PDF, a LaTeX processor like tetex or texlive. -

-

-as a developers tool it is flexible and extensible -

-
-

-More information on SiSU provided at www.jus.uio.no/sisu/SiSU

-
-
-

-SiSU ("SiSU information Structuring Universe" or "Structured information, Serialized Units"),1 is a Unix command line oriented framework for document structuring, publishing and search. Featuring minimalistic markup, multiple standard outputs, a common citation system, and granular search. -

-

- Using markup applied to a document, SiSU can produce plain text, HTML, XHTML, XML, OpenDocument, LaTeX or PDF files, and populate an SQL database with objects2 (equating generally to paragraph-sized chunks) so searches may be performed and matches returned with that degree of granularity (e.g. your search criteria is met by these documents and at these locations within each document). Document output formats share a common object numbering system for locating content. This is particularly suitable for "published" works (finalized texts as opposed to works that are frequently changed or updated) for which it provides a fixed means of reference of content. -

- -

-How it works -

-

-SiSU markup is fairly minimalistic, it consists of: a (largely optional) document header, made up of information about the document (such as when it was published, who authored it, and granting what rights) and any processing instructions; and markup within text which is related to document structure and typeface. SiSU must be able to discern the structure of a document, (text headings and their levels in relation to each other), either from information provided in the instruction header or from markup within the text (or from a combination of both). Processing is done against an abstraction of the document comprising of information on the document's structure and its objects,2 which the program serializes (providing the object numbers) and which are assigned hash sum values based on their content. This abstraction of information about document structure, objects, (and hash sums), provides considerable flexibility in representing documents different ways and for different purposes (e.g. search, document layout, publishing, content certification, concordance etc.), and makes it possible to take advantage of some of the strengths of established ways of representing documents, (or indeed to create new ones).

-

-1. also chosen for the meaning of the Finnish term "sisu". -

-

-2 objects include: headings, paragraphs, verse, tables, images, but not footnotes/endnotes which are numbered separately and tied to the object from which they are referenced.

-

- More information on SiSU provided at: - - www.jus.uio.no/sisu/SiSU - -

-SiSU was developed in relation to legal documents, and is strong across a wide variety of texts (law, literature...(humanities, law and part of the social sciences)). SiSU handles images but is not suitable for formulae/ statistics, or for technical writing at this time.

-

-SiSU has been developed and has been in use for several years. Requirements to cover a wide range of documents within its use domain have been explored.

-

- -ralph@amissah.com - -

-

- -ralph.amissah@gmail.com - -

-

-2007 -

-

-w3 since October 3 1993 -

-
- - -WOK - end - def home_toc - ' ' - end - end - class Inserts - end - class TeX < Skin - def initialize(papersize='') - @papersize=papersize - #@vz=SiSU_Env::Get_init.instance.skin #used within skins, however pulls in much that is not otherwise needed - end - def a4 - def portrait - def w - 160 - end - def h - 228 - end - def img_px - 450 - end - self - end - def landscape - def w - 262 - end - def h - 168 - end - def img_px - 348 - end - self - end - self - end - def letter - def portrait - def w - 166 - end - def h - 216 - end - def img_px - 468 - end - self - end - def landscape - def w - 234 - end - def h - 166 - end - def img_px - 310 - end - self - end - self - end - def legal - def portrait - def w - 168 - end - def h - 294 - end - def img_px - 474 - end - self - end - def landscape - def w - 314 - end - def h - 166 - end - def img_px - 420 - end - self - end - self - end - def b5 - def portrait - def w - 126 - end - def h - 180 - end - def img_px - 356 - end - self - end - def landscape - def w - 216 - end - def h - 136 - end - def img_px - 280 - end - self - end - self - end - def a5 - def portrait - def w - 100 - end - def h - 144 - end - def img_px - 280 - end - self - end - def landscape - def w - 176 - end - def h - 110 - end - def img_px - 230 - end - self - end - self - end - def dimensions - d=case @papersize - when /a4/; a4 - when /letter/; letter - when /legal/; legal - when /b5/; b5 - when /a5/; a5 - else a4 - end - end - end -end -__END__ diff --git a/lib/sisu/0.52/digests.rb b/lib/sisu/0.52/digests.rb deleted file mode 100644 index 8aedbc62..00000000 --- a/lib/sisu/0.52/digests.rb +++ /dev/null @@ -1,364 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: document digests (md5|sha256) and structure processing - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Notes: tidy -ascii index.xml >> index.tidy - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_Digest_view - require SiSU_lib + '/dal' - require SiSU_lib + '/sysenv' - require SiSU_lib + '/i18n' - include SiSU_Env - include SiSU_Param - include SiSU_Viz - pwd=Dir.pwd - class Source - @@dg=nil - def initialize(opt) - @opt=opt - @fnb=@opt.fnb - @@endnotes_para=[] - @@dg=nil - @dg=@@dg ||=SiSU_Env::Info_env.new.digest.type - @env=SiSU_Env::Info_env.new(@opt.fns) - end - def read - begin - @md=SiSU_Param::Parameters.new(@opt).get - tool=if @opt.cmd =~/[MVv]/; "#{@env.program.text_editor} #{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:digest]}" - else '' - end - tell=SiSU_Screen::Ansi.new(@opt.cmd,"Document #@dg Digests",tool) - tell.green_hi_blue unless @opt.cmd =~/q/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:digest]}") - tell.flow if @opt.cmd =~/[MV]/ - my_make=SiSU_Env::Create_file.new(@opt.cmd,@opt.fns) - @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here - SiSU_Digest_view::Source::Scroll.new(@dal_array,@md).songsheet - SiSU_Env::Info_skin.new(@md).select - rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error - ensure - end - end - private - class Scroll <([0-9a-f]{#@dl}):([0-9a-f]{#@dl})>/ - ocn,h1,h2,d_clean,d_all=$1,$2,$3,$4,$5 - @ocn=ocn unless ocn.to_i == 0 - if para=~/~\{[\d*+]+.+?<[0-9a-f]{#@dl}>\}~/ - para_endnotes << para.scan(/~[{\[]([\d*+]+).+?<([0-9a-f]{#@dl})>[}\]]~/) - end - ima=[] - if para =~/\{(\S+\.(png|jpg|gif))\s.+?\}(?:(?:https?|ftp):\/\/\S+|image)/ - images=para.scan(/\{(\S+\.(?:png|jpg|gif))\s.+?\}(?:(?:https?|ftp):\/\/\S+|image)/).flatten - else image=nil - end - x=case para - when /^0~title/ - "\n" + ' '*0 +'@' + ' '*9 - when /^0~subtitle/ - "\n" + ' '*1 +'@' + ' '*8 - when /^1~/ - "\n" + ' '*2 +':A ' + ' '*6 +'- ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all - when /^2~/ - "\n" + ' '*3 +':B ' + ' '*5 +'- ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all - when /^3~/ - "\n" + ' '*4 +':C ' + ' '*4 +'- ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all - when /^4~/ - "\n" + ' '*5 +'1' + ' '*4 +'- ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all - when /^5~/ - "\n" + ' '*6 +'2' + ' '*3 +'- ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all - when /^6~/ - "\n" + ' '*7 +'3' + ' '*2 +'- ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all - else - if para =~/MD5\(\S+?\.sst\)=\s*([0-9a-f]{#@dl})<\/u>/ #watch - @n,@s=/MD5\((\S+?\.sst)\)=\s*([0-9a-f]{#@dl})<\/u>/.match(para)[1,2] - end - x=unless ocn =~ /^0$/ - if images and images.length > 0 # then get path of image & produce digest - @image_name,@image_dgst,@img=[],[],[] - images.each do |i| - image_source=if FileTest.file?("#{@env.path.image_source_local_tex}/#{i}") - @env.path.image_source_local_tex - elsif FileTest.file?("#{@env.path.image_source_remote_tex}/#{i}") - @env.path.image_source_remote_tex - elsif FileTest.file?("#{@env.path.image_source_tex}/#{i}") - @env.path.image_source_tex - else - tell=SiSU_Screen::Ansi.new(@md.cmd,"ERROR - image:", %{"#{i}" missing}, "search locations: #{@env.path.image_source_local_tex}, #{@env.path.image_source_remote_tex} and #{@env.path.image_source_tex}") - tell.error2 unless @md.cmd =~/q/ - nil - end - @img << /\S+\.(png|jpg|gif)/.match(i)[1] - not_found_msg='image not found' - if image_source - para_image = image_source + '/' + i - @image_name << i - @image_dgst << if @dg =~/^sha(?:2|256)$/; sys.sha256(para_image) - else sys.md5(para_image) - end - else - @image_name << ' '*16 + i + ' [image missing]' - @image_dgst << '' - @image_dgst[1]=not_found_msg + ' '*(32-not_found_msg.length) - end - end - line= "\n" + ' '*9 + ' - ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all + "\n" - line_image=[] - c=0 - @image_name.each do |ok| - line_image << %{ #{@img[c]} #{@image_dgst[c][1]} #{@image_name[c]}} - c +=1 - end - line=line + line_image.join("\n") - else "\n" + ' '*9 + ' - ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all - end - else - prefix='' - metad=[@tr.dc_title,@tr.creator,@tr.translator,@tr.illustrator,@tr.prepared_by,@tr.digitized_by,@tr.description,@tr.subject,@tr.abstract,@tr.publisher,@tr.contributor,@tr.date_created,@tr.date_issued,@tr.date_available,@tr.date_modified,@tr.date_valid,@tr.date,@tr.type,@tr.format,@tr.rights,@tr.identifier,@tr.source,@tr.language,@tr.language_original,@tr.relation,@tr.coverage,@tr.keywords,@tr.comments,@tr.cls_loc,@tr.cls_dewey,@tr.cls_gutenberg,@tr.cls_isbn,@tr.prefix_a,@tr.prefix_b,@tr.sourcefile,@tr.sourcefile_digest,@tr.last_generated,@tr.sisu_version,@tr.ruby_version,@tr.sc_number,@tr.sc_date,'Skin_Digest: ','Generated by: ','Ruby version: '] - metad.each do |n| - m=rgx_txt(n) - if m=~/\S+/ and para=~/^#{m}:/ - x,o=0,18 - while x < 2; o = o + 2 - x=o - n.length - end - space=' '*x - prefix="#{n.downcase}#{space}" - break - else prefix=' '*9 - end - end - m_dc_title=rgx_txt(@tr.dc_title) - m_creator=rgx_txt(@tr.creator) - m_sourcefile_digest=rgx_txt(@tr.sourcefile_digest) - m_sisu_version=rgx_txt(@tr.sisu_version) - m_last_generated=rgx_txt(@tr.last_generated) - m_ruby_version=rgx_txt(@tr.ruby_version) - case para - when /#{m_dc_title}: / - @t=/#{m_dc_title}: (.+?)<~\d;(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#@dl}:[0-9a-f]{#@dl}>/.match(para)[1].gsub(/<\/?u>/,'').strip - when /#{m_creator}: / - @c=/#{m_creator}: (.+?)<~\d;(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#@dl}:[0-9a-f]{#@dl}>/.match(para)[1].gsub(/<\/?u>/,'').strip - when /#{m_sourcefile_digest}.+?/ #watch - dgst_extra="\n" + ' '*21 +'source' +' '*4 + @md.dgst[1] + ' '*34 + @md.fns - when /Skin_Digest: / - dgst_extra="\n" + ' '*21 + 'skin' +' '*6 + @md.dgst_skin[1] + ' '*34 + /(skin_\S+?\.rb)/.match(@md.dgst_skin[0])[1] - when /#{m_sisu_version}: / - @v=/#{m_sisu_version}: (.+?)<~\d;(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#@dl}:[0-9a-f]{#@dl}>/.match(para)[1].gsub(/<\/?u>/,'').strip - when /#{m_last_generated}: / - @g=/#{m_last_generated}: (.+?)<~\d;(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#@dl}:[0-9a-f]{#@dl}>/.match(para)[1].gsub(/<\/?u>/,'').strip - # 'doc last generated' - when /#{m_ruby_version}: / - @r=/#{m_ruby_version}: (.+?)<~\d;(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#@dl}:[0-9a-f]{#@dl}>/.match(para)[1].gsub(/<\/?u>/,'').strip - end - dgst_extra ||='' - "\n" + prefix +' - ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all + dgst_extra + "\n" - end - end - para_endnotes[0].each { |e| y << "\n" + ' '*(28-e[0].length) + "[#{e[0].to_s}] #{e[1].to_s}" } if para_endnotes[0] - if y; digests(x,y) - else digests(x) - end - end - end - manifest="#{@env.url.root}/#{@md.fnb}/sisu_manifest.html" - a=%{level (if any), ocn: digest clean (no markup/notes), digest all (includes markup & endnotes)\n [endnote number] endnote digest clean\n} - description("#@t\n") - description("#@c\n") - description("#{@md.fns}\n") - description("----------------------------------------------\n") - description("SiSU Document Content Certificate (Digest/DCC)\n") - description("----------------------------------------------\n") - description(" #@dg digests\n") - description("------------\n") - description("Sourcefile digest: #@s\n") - description(" source filename: #@n\n") - description("available outputs: #{manifest}\n") - description(" time generated: #@g\n") - description(" SiSU version used: #@v\n") - description(" Ruby version used: #@r\n") - description("------------\n") - description("Document Digest Tree (from dal):\n") - description(a) - #digests("------------\n") - #digests("#@v\n") - #digests("#@g\n") - #digests("#@r\n") - end - def dal_structure - #there will be a docubook mapping header, fairly complex variations - data=@data - l=Hash.new(0) - dal_structure1("------------\n") - dal_structure1("document structure[*]\n") - ocn,endnotes=nil,nil - data.each do |para| - x=case para - when /^0~/; l[0] +=1 - if para =~/^0~title/; '' #' '*0 +'@ == headers' + "\n" + ' '*0 +'headings:' - end - when /^1~/; l[1] +=1 - ' '*0 +':A' - when /^2~/; l[2] +=1 - ' '*1 +':B' - when /^3~/; l[3] +=1 - ' '*2 +':C' - when /^4~/; l[4] +=1 - ' '*3 +'1' - when /^5~/; l[5] +=1 - ' '*4 +'2' - when /^6~/; l[6] +=1 - ' '*5 +'3' - else nil - end - if para =~/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#@dl}:[0-9a-f]{#@dl}>/ - ocn=$1 unless $1.to_i == 0 - end - if para =~/~[{\[]([\d*+]+).+?<[0-9a-f]{#@dl}>[}\]]~/ - endnotes=$1 unless $1.to_i == 0 - end - dal_structure1("#{x}\n") if x and not x.empty? - end - dal_structure1(" [*] heading levels\n") - dal_structure2("------------\n") - dal_structure2("document structure[*]\n") - [0,1,2,3,4,5,6].each do |y| - v=case y.to_s - when /0/; '@ ' - when /1/; ':A' - when /2/; ':B' - when /3/; ':C' - when /4/; '1 ' - when /5/; '2 ' - when /6/; '3 ' - end - dal_structure2("#{v} = #{l[y]}\n") if l[y] > 0 - end - dal_structure2("objects (ocn) = #{ocn}\n") - dal_structure2("endnotes = #{endnotes}\n") - dal_structure2(" [*] number of headers (@) and of each heading level (:A to :C and 1 to 3)\n") - end - def supplementary - if defined? @md.sc_number and @md.sc_number - rcinfo("------------\n") - rcinfo("source control information\n") - rcinfo(" (the following information while not important for document content certification\n may help the publisher in locating the version referred to)\n") - rcinfo(" rcs version number: #{@md.sc_number}\n") - if defined? @md.sc_date and @md.sc_date - rcinfo(" rcs date: #{@md.sc_date}\n") - end - if defined? @md.sc_time and @md.sc_time - rcinfo(" rcs time: #{@md.sc_time}\n") - end - end - rcinfo("------------\n") - rcinfo("Note: the time generated related fields (text and digests) will vary between otherwise identical document outputs\n") - end - end - end -end -__END__ - diff --git a/lib/sisu/0.52/docbook.rb b/lib/sisu/0.52/docbook.rb deleted file mode 100644 index a58eb17d..00000000 --- a/lib/sisu/0.52/docbook.rb +++ /dev/null @@ -1,561 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: xml (dom style) output processing - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com - - * Notes: tidy -xml dom.xml >> index.tidy -=end -module SiSU_Docbook - require SiSU_lib + '/defaults' - require SiSU_lib + '/param' - include SiSU_Param - include SiSU_Viz - require SiSU_lib + '/sysenv' - include SiSU_Env - require SiSU_lib + '/dal' - require SiSU_lib + '/shared_xml' - require SiSU_lib + '/xml_format' - include SiSU_XML_format - include SiSU_XML_munge - require SiSU_lib + '/rexml' - include SiSU_Rexml - @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0 - @@tablefoot='' - class Source - def initialize(opt) - @opt=opt - end - def read - begin - @md=SiSU_Param::Parameters.new(@opt).get - @env=SiSU_Env::Info_env.new(@opt.fns) - path=@env.path.output_tell - loc=@env.url.output_tell - tool=if @opt.cmd =~/[MV]/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:docbook]}\n\t#{@env.program.xml_viewer} #{path}/#{@md.fnb}/#{@md.fn[:docbook]}" - elsif @opt.cmd =~/v/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:docbook]}" - else '' - end - tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','XML DOM',tool) - tell.colorize unless @opt.cmd =~/q/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:docbook]}") - tell.flow if @opt.cmd =~/[MV]/ - @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here - SiSU_Docbook::Source::Songsheet.new(@dal_array,@md,@env).songsheet - rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error - ensure #file closed in songsheet - end - end - private - class Songsheet - def initialize(data,md='',dir='') - @data,@md,@env=data,md,dir - end - def songsheet - begin - SiSU_Docbook::Source::Scroll.new(@data,@md).songsheet - SiSU_Docbook::Source::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/i # test wellformedness, comment out when not in use - SiSU_Rexml::Rexml.new(@md,@md.fn[:docbook]).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 - ensure - end - end - end - class Scroll - Heading,Heading_close,Contents=[],[],[] - Heading[0]='part' - Heading[1]='part level="1"' - Heading[2]='part level="2"' - Heading[3]='part level="3"' - Heading_close[1]=Heading[0] - Heading_close[2]=Heading[0] - Heading_close[3]=Heading[0] - #Contents[0]='preface' - Contents[1]='chapter' - Contents[2]='sect1' - Contents[3]='sect2' - @@xml={ :body=>[],:open=>[],:close=>[],:head=>[],:sc=[] } - @@dp=nil - require SiSU_lib + '/shared_txt' - include SiSU_text_utils - def initialize(data='',md='') - @data,@md=data,md - @vz=SiSU_Env::Get_init.instance.skin - @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern - @regx=/^(?:(?:<:p[bn]>\s*)?\d~(?:(\S+))?\s+)?(.+?)\s*<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ - @tab="\t" - @trans=SiSU_XML_munge::Trans.new(@md) - @sys=SiSU_Env::System_call.new - end - def songsheet - pre - markup - post - publish - end - protected - def xml_markup(para='') - para.gsub!(/~\{(\d+)\s+(.+?)\s*<#@dp>\}~/, - '\1 \2 ') - end - def xml_head(meta) - txt=meta.text - txt.gsub!(//,'') - txt.gsub!(/ & /,' and ') - @@xml[:head] <<=if meta.type == 'meta' - < -#{@tab*2}#{txt} -#{@tab} -WOK - else '' - end - end - def xml_sc(md='') - sc=if @md.sc_info - < - - #{@md.sc_filename} - - - #{@md.sc_number} - - - #{@md.sc_date} - - -WOK - else '' - end - @@xml[:sc]=sc - end - def xml_element(lv='',ocn='',para='',hname='',tag='',xml_element='') - lv=lv.to_i - n=lv - 1 - n1=lv - n2=lv + 1 - n3=lv + 2 - v=lv - 3 - tag='' - tag="\n#{@tab*n3}#{hname}\n" if hname - @@xml[:body] <<<#{para[@regx, 2]} -WOK - if lv == 4 - @copen[1]=true - @copen[2]=@copen[3]=false - elsif lv == 5 - @copen[2]=true - @copen[3]=false - elsif lv == 6 - @copen[3]=true - end - end - def xml_structure(lv='',ocn='',para='',hname='' ) - lv=lv.to_i - n=lv - 1 - n1=lv - n2=lv + 1 - n3=lv + 2 - v=lv - 3 - tag='' - tag="\n#{@tab*n3}#{hname}\n" if hname !=nil - #if para[@regx] - # paragraph="#{para[@regx, 2]}" - # util=SiSU_text_utils::Paragraph.new(paragraph, 70) - # wrapped=util.line_wrap - #end - case lv - when 1..3 - xml_element="<#{Heading[lv]}>" - 3.downto(lv) do |x| - y=x - 1 - @cont[1]=false if @cont[1] - @cont[2]=false if @cont[2] - @cont[3]=false if @cont[3] - ####### attempt to close contents - if @copen[3] # 6~ - [3,2,1].each do |v| - @@xml[:body] << "#{@tab*n}\n" - end - @copen[1]=@copen[2]=@copen[3]=false - elsif @copen[2] # 5~ - [2,1].each do |v| - @@xml[:body] << "#{@tab*n}\n" - end - @copen[1]=@copen[2]=@copen[3]=false - elsif @copen[1] # 4~ - [1].each do |v| - @@xml[:body] << "#{@tab*n}\n" - end - @copen[1]=@copen[2]=@copen[3]=false - end - @@xml[:body] << "#{@tab*y}\n" if @level[x] - @level[x]=false - end - when 4..6 - 6.downto(lv) do |x| - y=x - 1 - if @level[x] == true - u=x - 3; - @xml_contents_close[x]='' - end - end - cv=lv - 3 - if para =~/^4~\S+/ - m=/^4~(\S+)/.match(para)[1] - id=if m =~/^\d+$/; 'ch' + m - else 'ch_' + m - end - elsif para =~/^5~\S+/ - m=/^5~(\S+)/.match(para)[1] - id= 'sec_' + m - elsif para =~/^6~\S+/ - m=/^6~(\S+)/.match(para)[1] - id= 'subsec_' + m - else '' - end - xml_element=%{<#{Contents[cv]} id="#{id}">} #hmmm gsub were it possible - case lv - when 4 - if @copen[3] == true # 6~ - [3,2,1].each do |v| - @@xml[:body] << "#{@tab*n}\n" - end - elsif @copen[2] == true # 5~ - [2,1].each do |v| - @@xml[:body] << "#{@tab*n}\n" - end - elsif @copen[1] == true # 4~ - [1].each do |v| - @@xml[:body] << "#{@tab*n}\n" - end - end - @cont[1]=true - when 5 - if @copen[3] == true #6~ - [3,2].each do |v| - @@xml[:body] << "#{@tab*n}\n" - end - elsif @copen[2] == true #5~ - [2].each do |v| - @@xml[:body] << "#{@tab*n}\n" - end - end - @cont[2]=true - when 6 - [3].each do |v| - @@xml[:body] << "#{@tab*n}\n" if @copen[3] #watch should possibly be outside... - end - @cont[3]=true - end - end - xml_element(lv,ocn,para,hname,tag,xml_element) - @level[lv]=true - ((lv+1)..6).each { |x| @level[x]=false } - end - def group_structure(para='',ocn='') - para.gsub!(/<:group(?:-end)?>/,'') - para.strip! - @@xml[:body] << %{#{@tab*7}#{@tab*1}\n} - @@xml[:body] << %{#{@tab*8}#{para}#{@tab*1}\n} - @@xml[:body] << %{#{@tab*7}\n} - end - def poem_structure(para='',ocn='') - para.gsub!(/<:verse(?:-end)?>/,'') - para.strip! - @@xml[:body] << %{#{@tab*7}#{@tab*1}\n} - @@xml[:body] << %{#{@tab*8}#{para}#{@tab*1}\n} - @@xml[:body] << %{#{@tab*7}\n} - end - def code_structure(para='',ocn='') - para.gsub!(/<:code(?:-end)?>/,'') - para.strip! - @@xml[:body] << %{#{@tab*7}#{@tab*1}\n} - @@xml[:body] << %{#{@tab*8}#{para}#{@tab*1}\n} - @@xml[:body] << %{#{@tab*7}\n} - end - #def table_structure(table='',ocn='') #tables - # @@xml[:body] << %{#{@tab*1}#{table}\n#{@tab*1}\n} # unless lv # main text, contents, body KEEP #{ocn} - # @endnotes=[] - #end - def tidywords(wordlist) - wordlist.each do |x| - x.gsub!(/&/,'&') unless x =~/&\S+;/ - end - end - def markup - data=@data - dir=SiSU_Env::Info_env.new(@md.fns) - xml_sc(@md) - @rcdc=false - @level,@cont,@copen,@xml_contents_close=[],[],[],[] - (0..6).each { |x| @cont[x]=@level[x]=false } - (4..6).each { |x| @xml_contents_close[x]='' } - data.each do |para| - wordlist=para.scan(/\S+|\n/) #\n needed for tables, check though added 2005w17 - para=tidywords(wordlist).join(' ').strip - para.gsub!(/<[-~]#>/,'') - para.gsub!(/<0;\w\d+;[um]\d+><#@dp:#@dp>/,'') - para.gsub!(/<:pb>\s*/,'') - para.gsub!(/\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|ftp):\/\/\S+|image)/, - %{}) - #para.gsub!(/\{(\S+?\.png) \d+x\d+ \".+?\" \}(?:http:\/\/\S+|image)/,'\1') - para.gsub!(/ /,' ') - @trans.char_enc.utf8(para) if @sys.locale =~/utf-?8/i #% utf8 - if para =~/^0~(\S+)\s+(.+?)\Z/m # for headers - d_meta=SiSU_text_utils::Header_scan.new(@md,para).meta - if d_meta; xml_head(d_meta) - end - end - @rcdc=true if @rcdc ==false and (para =~/^\d~metadata/ or para =~/^1~\s+Document Information/) - if para !~/(^0~||)/ - if para =~/.+?<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ - paranum=para[@regx, 3] - @p_num=SiSU_XML_format::Paragraph_number.new(@md,paranum) - end - @sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para_ocn - ### problem in scroll, it appears tables are getting paragraph numbers - unless @rcdc - m=/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ - if para =~m - format_scroll=SiSU_XML_format::Format_scroll.new(@md,@sto.text) if @sto.format =~/i[12]|null/ - case @sto.format - when /^(1)~(?:(\S+))?/ - xml_markup(para) - xml_structure($1,@sto.ocn,para,$2) - para=@sto.lev_para_ocn.heading_body1 - when /^(2)~(?:(\S+))?/ - xml_markup(para) - xml_structure($1,@sto.ocn,para,$2) - para=@sto.lev_para_ocn.heading_body2 - when /^(3)~(?:(\S+))?/ - xml_markup(para) - xml_structure($1,@sto.ocn,para,$2) - para=@sto.lev_para_ocn.heading_body3 - when /^(4)~(\S+)/ # work on see SiSU_text_parts::Split_text_object - xml_markup(para) - xml_structure($1,@sto.ocn,para,$2) - para=@sto.lev_para_ocn.heading_body4 - when /^(5)~(?:(\S+))?/ - xml_markup(para) - xml_structure($1,@sto.ocn,para,$2) - para=@sto.lev_para_ocn.heading_body5 - when /^(6)~(?:(\S+))?/ - xml_markup(para) - xml_structure($1,@sto.ocn,para,$2) - para=@sto.lev_para_ocn.heading_body6 - #when /^(i1)$/ - # #format_scroll.gsubBody - # #para=@sto.lev_para_ocn.scrIndent1 - #when /^(i2)$/ - # format_scroll.gsubBody - # para=@sto.lev_para_ocn.scrIndent2 - #when /^(center)$/ - # para.gsub!(/(.+)/, - # %{
(\\1)
}) - # para=@sto.lev_para_ocn.scrPara - #when /^(b|bold)$/ - # para.gsub!(/(.+)/, - # %{(\\1)}) - # para=@sto.lev_para_ocn.scrPara - #when /null/ # see whether u can improve - # if (para !~/#{@margin.txt_0}|#{@margin.txt_1}|#{@margin.txt_2}/) - # #format_scroll.gsubBody - # #para=@sto.lev_para_ocn.scrPara - # end - else - matched=/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/mi.match(para) - stamp,ocn=matched[0],matched[1] - if para =~ /<:verse>/ - para.gsub!(/#{stamp}/,'') - poem_structure(para,ocn) - elsif para =~ /<:group>/ - para.gsub!(/#{stamp}/,'') - group_structure(para,ocn) - elsif para =~ /<:code>/ - para.gsub!(/#{stamp}/,'') - code_structure(para,ocn) - elsif para =~/#{para[@regx, 2]}\n" if para[@regx, 2] # main text, contents, body KEEP ocn = #{para[@regx, 3]} == #{ocn} - end - end - elsif para =~/(Note|Endnotes?)/ and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ - #format_scroll=MonoSiSU.new('
Note') - #para=format_scroll.boldPara - elsif para =~/(MetaData)/ and para =~/<~\d+;[m]\d+;\w\d+><#@dp:#@dp>$/ #debug 2003w46 add rc info - format_scroll=Format_scroll.new(@md,'
MetaData') - para=format_scroll.bold_para - elsif para =~/(Owner Details)/ and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ - format_scroll=Format_scroll.new(@md,'
Owner Details') - @@xml[:owner_details]=format_scroll.bold_para - para='' - elsif para =~/(.*)<:#>(.*)/ - one, two=$1,$2 - format_text=Format_text_object.new(one,two) - para=format_text.seg_no_paranum - end - para='' if para =~// and para =~/^(-\{{2}~\d+|)/ # -endnote - if para =~/.*<:#>.*$/ - para=case para - when /<:i1>/ - format_text=Format_text_object.new(para,'') - format_text.scr_inden_ocn_e_no_paranum - when /<:i2>/ - format_text=Format_text_object.new(para,'') - format_text.scr_inden_ocn_e_no_paranum - end - end - if para =~/<:center>/ - one, two=/(.*)<:center>(.*)/.match(para)[1,2] - format_text=Format_text_object.new(one, two) - para=format_text.center - end - else - end - para.gsub!(/<:\S+?>/,'') - para.gsub!(//,' ') - end - end - @content_flag=true - 6.downto(4) do |x| - y=x - 1; v=x - 3 - if @level[x] == true #2004w36 bug fix? watch/test previous logic broke on free.for.all @coontent_flag introduced - if @content_flag==true - @@xml[:body] << "\n#{@tab*y}\n" - @content_flag=false - else - @@xml[:body] << "\n#{@tab*y}\n" - end - end - end - 3.downto(1) do |x| - y=x - 1 - @@xml[:body] << "#{@tab*y}\n" if @level[x] == true - end - end - def pre - rdf=SiSU_XML_tags::RDF.new(@md) - dir=SiSU_Env::Info_env.new - css=SiSU_Env::CSS_select.new(@md).docbook_xml - encoding=' -' - #encoding='' - @@xml[:open] =< -#{rdf.comment_xml} - -WOK - @@xml[:head] << "\n" - end - def post - @@xml[:head] << @@xml[:sc] - @@xml[:head] << "\n" - @@xml[:close] = "\n" - end - def publish - content=[] - data=@data - content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata] - content << @@xml[:owner_details] if @md.stmp =~/\w\w/ - content << @@xml[:tail] << @@xml[:close] - Output.new(content.to_s,@md).xml - @@xml[:head],@@xml[:body],@@xml[:tail]=[],[],[] - end - end - class Output - include SiSU_Param - def initialize(data,md) - @data,@md=data,md - end - def xml - @sisu=[] - @data.each do |para| - para.gsub!(/<:\S+?>/,'') - para.gsub!(//,'') - para="#{para}\n" unless para.empty? - @sisu << para - end - new_file_data=@sisu.to_s - @sisu=new_file_data.scan(/.+/) - SiSU_Env::SiSU_file.new(@md).mkdir - filename_xml=SiSU_Env::SiSU_file.new(@md,@md.fn[:docbook]).mkfile - @sisu.each {|para| filename_xml.puts para} - filename_xml.close - end - end - class Tidy - def initialize(md,dir) - @md,@env=md,dir - @prog=SiSU_Env::Info_program.new - end - def xml - if @prog.tidy !=false - if @md.cmd =~/[VM]/ - tell=SiSU_Screen::Ansi.new(@md.cmd,'invert','Using XML Tidy','check document structure') - tell.colorize unless @md.cmd =~/q/ - tell.grey_open unless @md.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[:docbook]}",tidyfile) - tidy.well_formed? - tell.p_off unless @md.cmd =~/q/ - end - end - end - end - end -end -__END__ - diff --git a/lib/sisu/0.52/errors.rb b/lib/sisu/0.52/errors.rb deleted file mode 100644 index a6646c8a..00000000 --- a/lib/sisu/0.52/errors.rb +++ /dev/null @@ -1,72 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: system environment, error screen reporting - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_Errors - require SiSU_lib + '/sysenv' - include SiSU_Env - include SiSU_Screen - class Info_error - ------------------------------------------ - #{@cX.green}~##{@cX.off} unnumbered paragraph (place marker at end of paragraph) - #{@cX.green}-##{@cX.off} unnumbered paragraph, delete when not required (place marker at end of paragraph) [used in dummy headings, eg. for segmented html] - ------------------------------------------ - manual page breaks (LaTeX/pdf) - #{@cX.green}<:pb>#{@cX.off} page break, which breaks a page, starting a new page in single column text and a new column in double column text - #{@cX.green}<:pn>#{@cX.off} page new, which starts a new page, in both single and double column text (leaving an empty column in double column text if necessary). - Note: page breaks are usually introduced to pdfs either as header instructions, indicating that pages should break at given levels - ------------------------------------------ - #{@cX.cyan}Composite documents#{@cX.off} - It is possible to build a document by requiring other documents. The documents required may complete documents that could be generated independently, or they could be markup snippets, prepared so as to be easily available to be placed within another text. If the calling document is a master document (built mainly from other documents), by convention it should be named with the suffix .ssc or .ssm The documents called if complete documents would have the suffix .sst, [.ssf, or .ssd], and if markup snippets .ssi. A temporary file of the composite document is built prior to processing with the same prefix and the suffix ._sst There are a number of alternative syntaxes for requiring external documents in order to permit use of ascii hypertext linking available in the vim editor. They are as follows (place at start of line): - - #{@cX.cyan}#basic sisu markup alternatives#{@cX.off} - #{@cX.green}{#{@cX.off}filename.si#{@cX.green}}require#{@cX.off} - #{@cX.green}<< {#{@cX.off}filename.si#{@cX.green}}#{@cX.off} - - #{@cX.cyan}#using textlink alternatives#{@cX.off} - #{@cX.green}|#{@cX.off}filename.si#{@cX.green}|@|^|require#{@cX.off} - #{@cX.green}<< |#{@cX.off}filename.si#{@cX.green}|@|^|#{@cX.off} - - #{@cX.cyan}#using thlnk alternatives#{@cX.off} - #{@cX.green}require#{@cX.off} - #{@cX.green}<< #{@cX.off} - - #{@cX.cyan}Composite documents - remote parts#{@cX.off} - Composite documents may be built from remote parts, by using the composite document syntax with a url. This makes sense using either sisu regular syntax (which is just a convenient way of marking up), or thlnk syntax, which also recognises remote urls, and permits hyperlinking ascii to the url location. - - #{@cX.cyan}Remote documents#{@cX.off} - SiSU will download and process remote locations if a url is provided instead of a filename. [this at present works only for sisu markup files without images] - - ------------------------------------------ - #{@cX.green}%#{@cX.off}#{@cX.off} add a comment to text, that will be removed prior to processing (place marker at beginning of line) - #{@cX.green}\\#{@cX.off}#{@cX.off} escape a sepcial character, whether general: { } < > or contextual special characters, (in combination with other characters) ~ - _ / % ^ and occasionally ! # + , - #{@cX.green}%%#{@cX.off}#{@cX.off} same as above but recognised by vim folds for placing fold in document text, in addition to headers and headings - ------------------------------------------ - - #{@cX.ruby}More HELP on Markup#{@cX.off} markup help is available on: - document wide instructions: headers (document structure) - general text markup: headings; endnotes; tables (which also includes a note on preformatted text) - configuration and customisation - document or site wide customisation: customise; skin -WOK - help_markup -# {../_sisu/image/tux.png http://www.jus.uio.no/sisu/ w=64 c=\"a better way\" }:image depreciated image eg -# old form - end - def example - help_markup - end - def example37 - print <to bold to indent for superscript for subscript text - -_1 at the beginning of a line indents the paragraph - -_2 at the beginning of a line double indents the paragraph - -Others include - -Other things to note: - -By default paragraphs are automatically numbered... and is the same across all output formats -This makes citation a lot easier... regardless of the form of output that is being looked at -It also permits the building of various addons, like the concordance feature which identifies each word and the paragraphs in which the word appears with links to the paragraph... - -Urls are automatically turned to live links in the html and pdf files created... -WOK - end - end -end -__END__ - diff --git a/lib/sisu/0.52/html.rb b/lib/sisu/0.52/html.rb deleted file mode 100644 index cb6718d3..00000000 --- a/lib/sisu/0.52/html.rb +++ /dev/null @@ -1,719 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: html generation, processing - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_HTML - require 'pstore' - require SiSU_lib + '/defaults' - require SiSU_lib + '/html_table' - require SiSU_lib + '/html_format_css' - require SiSU_lib + '/html_segments' - require SiSU_lib + '/html_scroll' - require SiSU_lib + '/html_promo' - include SiSU_HTML_seg - include SiSU_HTML_Format_type - include SiSU_HTML_promo - require SiSU_lib + '/param' - include SiSU_Param - include SiSU_Viz - require SiSU_lib + '/html_tune' - include SiSU_Tune - require SiSU_lib + '/dal' - require SiSU_lib + '/shared_xml' - class Source - def initialize(opt) - @opt=opt - end - def read - songsheet - end - def songsheet - begin - @md=SiSU_Param::Parameters.new(@opt).get - @fnb=@md.fnb - @env=SiSU_Env::Info_env.new(@opt.fns) - loc=@env.url.output_tell - tool=if @opt.cmd =~/z/; "#{@env.program.web_browser} #{loc}/#@fnb/#{@md.fn[:index]}" - elsif @opt.cmd =~/[MVv]/; "#{@env.program.web_browser} #{loc}/#@fnb/#{@md.fn[:index]}" - else '' - end - SiSU_Screen::Ansi.new(@opt.cmd,'HTML',tool).green_hi_blue unless @opt.cmd =~/q/ - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#@fnb/#{@md.fn[:index]}").flow if @opt.cmd =~/[MV]/ - SiSU_Env::Info_skin.new(@md).select - data=nil - unless @md.markup =~/url_png/ - my_make=SiSU_Env::Create_file.new(@opt.cmd,@opt.fns,@md) #Beware #FIX opt and md, both not necessary - SiSU_Env::SiSU_file.new(@md).mkdir - @tuned_file_array=SiSU_HTML::Source::Html_environment.new(@md).tuned_file_instructions - data=@tuned_file_array - else - data=IO.readlines(@opt.fns,'') #wasteful, not really necessary? - SiSU_HTML_nav_tune::Tune.new(data,@md).songsheet - @tuned_file_array=data #watch may not be what you want - end - scr_endnotes=SiSU_HTML::Source::Endnotes.new(data,@md).scroll unless @md.markup =~/url_png/ - toc=SiSU_HTML::Source::Toc.new(data,@md).songsheet - doc_ver=SiSU_HTML::Source::Links_guide.new(data,@md).doc_versions - links_guide=SiSU_HTML::Source::Links_guide.new(data,@md).toc - data=@tuned_file_array - scr_toc=SiSU_HTML::Source::Scroll_head_and_segtoc.new(data,@md,toc,links_guide,doc_ver).in_common - SiSU_HTML::Source::Seg.new(data,@md).songsheet #if not_scroll_only - data=@tuned_file_array - scr=SiSU_HTML::Source::Scroll.new(data,@md).songsheet - scroll=SiSU_HTML::Source::Scroll_output.new(scr_toc,scr[:body],scr_endnotes,scr[:metadata],scr[:owner_details],scr[:tails],@md).publish - SiSU_HTML::Source::Output.new(scroll,@md).scroll - rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error - ensure - unless @opt.cmd =~/[MV]/ #check maintenance flag - texfiles = Dir["#{@env.path.tune}/#{@opt.fns}*"] - texfiles.each do |f| - if FileTest.file?(f) - File.unlink(f) - end - end - end - SiSU_Env::Create_file.new(@opt.cmd,@opt.fns).param_instantiate - @@flag,@@scr,@@seg,@@seg_endnotes,@@seg_subtoc,@@seg_ad={},{},{},{},{},{} - @@seg_total,@@tracker,@@loop_count,@@tablehead,@@number_of_cols=0,0,0,0,0 - @@seg_name,@@seg_name_html,@@seg_name_php,@@seg_subtoc_array,@@seg_endnotes_array,@@segtocband,@@tablefoot=Array.new(7){[]} - @@filename_seg,@@seg_url,@@filename_segphp,@@fn,@@to_lev4,@@get_hash_to,@@get_hash_fn='','','','','','','' - @@is4=@@is3=@@is2=@@is1=@@header1=@@header2=@@header3=@@header4=0 - end - end - private - class Html_environment - def initialize(md) - @md=md - @vz=SiSU_Env::Get_init.instance.skin - @env,@css,@symlnk=SiSU_Env::Info_env.new(@md.fns),SiSU_Style::CSS.new,SiSU_Env::Create_system_link.new #home - end - def suffix_linkname #not used at present - sfx=if @md.cmd =~/h/; '.html' - else '' - end - end - def link_images - @symlnk.images - end - def directories - my_make=SiSU_Env::Create_file.new(@md.cmd,@md.fns) - @path={ :root=>my_make.html_root } - title=File.basename(@md.fns,'.rb') - SiSU_Env::SiSU_file.new(@md).mkdir - end - def tuned_file_instructions - @env=SiSU_Env::Info_env.new(@md.fns) - @tell=SiSU_Screen::Ansi.new(@md.cmd) - if @md - @md.sfx='' - @md.file_type='php' if @md.cmd =~/z/ - @md.sfx='' if @md.cmd =~/z/ - if @md.cmd =~/h/ or @md.fns =~/\~[a-z]{2,3}\.s?/ #multilingual document protection is a bit arbitrary, (needed by existing server configuration), add configuration overide... - if @md.cmd =~/H/ and @md.fns =~/\~[a-z]{2,3}\.s?/ - SiSU_Screen::Ansi.new(@md.cmd, - 'multilingual document, creating internal url links with filetype suffix', - "\n\t\t(overriding -H request, using -h mode instead)" - ).warn unless @md.cmd =~/q/ - end - @md.sfx='.html' - @md.pdf='.pdf' - end - end - @md.cmd=@md.cmd.gsub(/H/,'h') - @md.file_type='html' if @md.cmd =~/[hon]/ - directories - newfilename=%{#{@env.path.output}/#{@md.fnb}/#{@md.fn[:index]}} if @md.file_type =~/html/ - my_make_source_file=SiSU_Env::Create_file.new(@md.cmd,@md.fns) - @fnm=my_make_source_file.marshal_meta - @tune_verse_marshal=my_make_source_file.marshal_tune - if @md.markup !~/url_png/ and @md.cmd =~/[hozn]/ - dal_array=SiSU_DAL::Source.new(@md).get # dal file drawn here - @tuned_file_array=SiSU_Tune::Tune.new(dal_array,@md).songsheet - else - SiSU_HTML_nav_tune::Tune.new(@file_array,@md).songsheet #no doc passed originally... 2004w35, revist changes in conditional 2006 - end - require SiSU_lib + '/param' - @tuned_file_array - end - end - class Split_text_object - include SiSU_Viz - include SiSU_HTML_Format_type - @@dp=nil - attr_reader :format,:text,:ocn,:scroll_lev_para_ocn,:seg_lev_para_ocn - def initialize(md,para) - @md,@para=md,para - @format,@ocn='null','null' - #@format,@ocn=nil,nil - @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern - end - def lev_segname_para_ocn #needs work 2003w29 - if @para =~/^\d~.+?<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ - if @para[/^([1-6])~(\S+)\s+(\S.+?)<~(\d+);(?:[ohmu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m] - @format,segname,@text,@ocn=$1,$2,$3,$4 - @format="#@format~#{segname}" # - elsif @para[/^([1-6]~)\s+(\S.+?)<~(\d+);(?:[ohmu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m] - @format,@text,@ocn=$1,$2,$3 #,$4 - end - else - if @para[/^(?:_1\*|<:i[12]>\s*_\*)\s+(.+?)<~(\d+);(?:[ohu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m] - @format,@text,@ocn='_1*',$1,$2,$3 - elsif @para[/^(_\*)\s+(.+?)<~(\d+);(?:[ohu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m] - @format,@text,@ocn=$1,$2,$3 - elsif @para[/<:(i[12])>\s*(.+?)<~(\d+);(?:[ohu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m] - @format,@text,@ocn=$1,$2,$3 - elsif @para[/<:(code|alt|verse|group)>(.+?)<~(\d+);(?:[ohu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m] - @format,@text,@ocn=$1,$2,$3 - elsif @para[/(.+?)<~(\d+);(?:[ohu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m] - @text,@ocn=$1,$2 #,$3 - end - if @para !~/<~(\d+);(?:[ohu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$|^$/ #added 2002w06 - @text=@para[/(.+?)/m,1] - end - if @para[/^(\d)~\S*\s+(.+)/m] - @format,@text=$1,$2 - end - end - @seg_lev_para_ocn=if @para[/.+<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/] - SiSU_HTML_Format_type::Format_seg.new(@md,@format,@text,@ocn) - end - @scroll_lev_para_ocn=if @para[/.+<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/] - SiSU_HTML_Format_type::Format_scroll.new(@md,@format,@text,@ocn) - end - self - end - end - class Links_guide - @links_guide_toc=[] - def initialize(data,md) - @data,@md=data,md - end - def doc_versions - format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@md) - @doc_versions_toc=format_head_toc.document_versions_toc - end - def toc - @links_guide_toc=[] - format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@md) - guide_type='horzontal' #values: horizontal or vertical - @links_guide_toc << format_head_toc.links_guide_open(guide_type) - if defined? @md.lnk and @md.lnk - @md.lnk.each do |l| - if defined? l[:say] - target=if l[:url] !~/^\.(\.)?\//; 'external' - else '_top' - end - s_lnk_url,s_lnk_lnk=l[:url],l[:say] - lev_para_ocn=SiSU_HTML_Format_type::Format_toc.new(@md,s_lnk_url,s_lnk_lnk,target) -#p lev_para_ocn.links_guide if s_lnk_lnk - @links_guide_toc << lev_para_ocn.links_guide if s_lnk_lnk - end - end - end - format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@md) - @links_guide_toc << format_head_toc.links_guide_close #(guide_type) - @links_guide_toc - end - end - class Endnotes - include SiSU_Param - include SiSU_HTML_Format_type - def initialize(data,md) - @data,@md=data,md - end - def scroll - @scr_endnotes=[] - format_head_scroll=SiSU_HTML_Format_type::Head_scroll.new(@md) - @scr_endnotes << format_head_scroll.title_endnote - @data.each do |para| - pg=para.dup - if pg =~/~[{\[][\d*+]+ [],:scr=>[] } - @@seg_url='' - @@dp,@@firstseg=nil,nil - def initialize(data='',md=nil) - @data,@md=data,md - @vz=SiSU_Env::Get_init.instance.skin - @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern - @pat_heading=/^(?:[1-6]~\S*)?(.*)<~(\d+);(?:[hm]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ - @pat_strip_heading_name=/(.+?)<\/a>/ - @tell=SiSU_Screen::Ansi.new(@md.cmd) - end - def songsheet #extracts toc for scroll & seg - SiSU_Screen::Ansi.new(@md.cmd,'Toc').txt_grey unless @md.cmd =~/q/ - toc=nil - @@firstseg=nil - @data.each do |para| - if para =~/^([1-6]~|4~!)/ - para_toc=para.dup - para_toc.gsub!(/  [\d*+]+<\/sup> <\/a>\s+~[{\[].+?[}\]]~/m,'') #remove endnotes from toc - toc=case para_toc - when /^\s*1~(\S+)?/; Toc.new(para_toc,@md).level_1 - when /^\s*2~(\S+)?/; Toc.new(para_toc,@md).level_2 - when /^\s*3~(\S+)?/; Toc.new(para_toc,@md).level_3 - when /^\s*4~(\S+)?/; Toc.new(para_toc,@md).level_4 - when /^\s*5~(\S+)?/; Toc.new(para_toc,@md).level_5 - when /^\s*6~(\S+)?/; Toc.new(para_toc,@md).level_6 - when /^\s*4~!/; Toc.new(para_toc).level_crosslink - else - end - if @@firstseg.nil? and para=~/^4~\S+?/ - @@firstseg=/^4~(\S+)?/.match(para)[1] - end - if toc - begin - @@toc[:seg] << toc[:seg] if toc[:seg] - @@toc[:scr] << toc[:scr] if toc[:scr] - rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error - end - end - end - end - @md.firstseg=@@firstseg - @@toc - end - protected - def rss #sort all wrong, disabled but kept - @@toc[:seg] <<< -
-

-(relatively static) RSS feeds for DOCUMENTS:
-RSS feed http://www.jus.uio.no/lm/rssfeed/documents.xml
-RSS feed http://www.jus.uio.no/lm/rssfeed/tradelaw.xml
-RSS feed http://www.jus.uio.no/lm/rssfeed/environmental.xml
-

info@address.com
-

-
-WOK - end - def level_doc_owner_details - if @md.stmp =~/\w\w/ - format_head_scroll=SiSU_HTML_Format_type::Head_scroll.new(@md) - @@toc[:scr] << format_head_scroll.toc_owner_details - end - end - def level_endnotes - if @md.flag_endnotes - format_head_scroll=SiSU_HTML_Format_type::Head_scroll.new(@md) - @@toc[:scr] << format_head_scroll.toc_endnote - end - end - def level_metadata - format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@md) - @@toc[:scr] << format_head_toc.metadata - @@toc[:seg] << format_head_toc.seg_metadata - end - def level_word_index - format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@d0c) - @@toc[:scr] << format_head_toc.concordance - @@toc[:seg] << format_head_toc.concordance - end - def level_1 - para=@data - unless para =~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ - para.gsub!(@pat_strip_heading_name,'\1') - end - para[@pat_heading] - linkname,link=$1,$2 if $& - p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) if link and link !~/#/ #% keep eye on link - title=unless para =~/Document Information/; linkname - else - link='metadata' - %{
#{linkname}} - end - toc={} - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) - toc[:seg]=format_toc.lev1 - title=if para =~/(<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)$/ - m=/#{$1}/ - para.gsub!(m,'') - linkname - else #if para =~/Document Information/ - @@toc[:scr] << '
' - link='docinfo' - %{#{linkname}} - end - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) - toc[:scr]=format_toc.lev1 - toc - end - def level_2 - para=@data - unless para =~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ - para.gsub!(@pat_strip_heading_name,'\1') - end - para[@pat_heading] - linkname,link=$1,$2 if $& - p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) if link and link !~/#/ - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,linkname) - toc={} - toc[:seg]=format_toc.lev2 - if para =~/(<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)$/ - m=/#{$1}/ - para.gsub!(m,'') - title=linkname - else title=%{#{p_num.goto}#{linkname}} - end - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) - toc[:scr]=format_toc.lev2 - toc - end - def level_3 - para=@data - para.gsub!(@pat_strip_heading_name,'\1') - para.gsub(/(.*?)<\/a>(.*)/,'\1') #2002w42 altered gsub! - problematic? - suspect - para[@pat_heading] - linkname,link=$1,$2 if $& - p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) if link and link !~/#/ - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,linkname) - toc={} - toc[:seg]=format_toc.lev3 - if para =~/(<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)$/ - m=/#{$1}/ - para.gsub!(m,'') - title=linkname - else title=%{#{p_num.goto}#{linkname}} - end - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) - toc[:scr]=format_toc.lev3 - toc - end - def level_4 - para=@data - unless para =~/~metadata/ - unless para =~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ - para.gsub!(@pat_strip_heading_name,'\1') - para[@pat_heading] - linkname,link=$1,$2 if $& - p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) if link - end - para.gsub!(/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/,'') - if para =~/^4~/ - seg_link=para.gsub(/^\s*4~(\S+)\s+(.+?)$/, - %{ - \\2 - }) - @@seg_url=para[/^4~(\S+).+?$/,1] - elsif para =~/\d+.\d+.\d+.\d+|\d+.\d+.\d+|\d+.\d+|\d+/ - seg_link=para.gsub(/^\s*(#{@md.lv4}\s+)\s*(\d+.\d+.\d+.\d+|\d+.\d+.\d+|\d+.\d+|\d+)(.*)/, - %{\\1 \\2 \\3 }) - end - p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) if link - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,seg_link) - toc={} - toc[:seg]=format_toc.lev4 - if para =~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ - m=/#{$1}/ - para.gsub!(m,'') - title=linkname - else title=%{#{p_num.goto}#{linkname}} if p_num - end - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) - toc[:scr]=format_toc.lev4 - toc - end - end - def level_5 - para=@data - if para !~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ - para.gsub!(@pat_strip_heading_name,'\1') - end - para[@pat_heading] - linkname,link=$1,$2 if $& - p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) if link and link !~/#/ - toc={} - if para =~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ - m=/#{$1}/ - para.gsub!(m,'') - title=linkname - else - lnk_n_txt=%{ - #{linkname} - } - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,lnk_n_txt) - toc[:seg]=format_toc.lev5 - title=%{#{p_num.goto}#{linkname}} - end - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) - toc[:scr]=format_toc.lev5 - toc - end - def level_6 - para=@data - if para !~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ - para.gsub!(@pat_strip_heading_name,'\1') - end - para[@pat_heading] - linkname,link=$1,$2 if $& - p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) if link and link !~/#/ - toc={} - if para =~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ - m=/#{$1}/ - para.gsub!(m,'') - title=linkname - else - lnk_n_txt=%{ - #{linkname} - } - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,lnk_n_txt) - toc[:seg]=format_toc.lev6 - title=%{#{p_num.goto}#{linkname}} - end - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) - toc[:scr]=format_toc.lev6 - toc - end - def level_crosslink - para=@data - if para !~/^4~!/ - para.gsub!(/^4~!\s+(\S+)\s+(.+)/, - %{ -
- #{@png.crosslink_ext} -   \\2 - <\/a> -
-}) - else - para.gsub!(/^4~!\s+(\S+)\s+(.+)/, - %{
- - - #{@png.crosslink} -   \\2 - <\/a> -
-}) - end - end - end - class Scroll_head_and_segtoc < Toc - def initialize(data,md='',toc='',links_guide_toc='',doc_versions_toc='') - @data,@md,@toc,@links_guide_toc,@doc_versions_toc=data,md,toc,links_guide_toc,doc_versions_toc - @env=SiSU_Env::Info_env.new(@md.fns) - @vz=SiSU_Env::Get_init.instance.skin - end - def in_common - toc_shared=[] - @segtoc=[] - SiSU_Screen::Ansi.new(@md.cmd,'Scroll & Segtoc').txt_grey unless @md.cmd =~/q/ - format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@md) - dochead=format_head_toc.head - dochead.gsub!(/toc\.(html|php)/,'doc.\1') #kludge - ads=SiSU_HTML_promo::Ad.new(@md) - toc_shared << dochead << ads.div.major - @segtoc << format_head_toc.head << ads.div.major - toc_shared << format_head_toc.toc_head_escript if SiSU_HTML_Format_type::Head_toc.method_defined? :toc_head_escript - @segtoc << format_head_toc.toc_head_escript if SiSU_HTML_Format_type::Head_toc.method_defined? :toc_head_escript - toc_shared << format_head_toc.scroll_head_navigation_band - if @md.dc_rights - rights=format_head_toc.rights - rights=SiSU_Tune::Clean_html.new(rights).clean - end - if @md.prefix_b - prefix_b=format_head_toc.prefix_b - prefix_b=SiSU_Tune::Clean_html.new(prefix_b).clean - end - @seg_toc_band=format_head_toc.seg_head_navigation_band('pdf') #bug, vary depending on type of doc !! examine - @segtoc << @seg_toc_band - toc_shared << format_head_toc.scroll_head_title_banner_open - @segtoc << format_head_toc.seg_head_title_banner_open - tmp_head=nil - doc_title_endnote=@md.title.gsub(/(\*+)/,'\1') - tmp_head=doc_title_endnote + "\n" - format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,tmp_head) - toc_shared << format_txt_obj.center_bold - @segtoc << format_txt_obj.center_bold - if not @md.subtitle.nil? and not @md.subtitle.empty? - tmp_head=@md.subtitle + "\n" - format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,tmp_head) - toc_shared << format_txt_obj.center_bold - @segtoc << format_txt_obj.center_bold - end - if @md.dc_creator - creator_endnote=@md.dc_creator.gsub(/(\*+)/,%{ \\1}) - creator_endnote=%{© #{creator_endnote}} if creator_endnote =~/\S/ - tmp_head=creator_endnote + "\n" - format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,tmp_head) - toc_shared << format_txt_obj.center_bold - @segtoc << format_txt_obj.center_bold - end - toc_shared << format_head_toc.copyat - @segtoc << format_head_toc.copyat - toc_shared << "#{@vz.table_close*1}\n" - @segtoc << "#{@vz.table_close*1}\n" - tmp_head=nil - if @md.prefix_a - tmp_head ||= %{

#{@md.prefix_a}\n} - toc_shared << tmp_head.dup - @segtoc << tmp_head.dup - end - tmp_head=nil - toc_shared << @doc_versions_toc - toc_shared << @links_guide_toc - toc_shared << rights if @md.dc_rights - toc_shared << prefix_b if @md.prefix_b - #Table of Contents added/appended here - toc_shared << @toc[:scr] - @segtoc << @doc_versions_toc - @segtoc << @links_guide_toc - @segtoc << @toc[:seg] - @segtoc << rights if @md.dc_rights - @segtoc << prefix_b if @md.prefix_b - #Segtoc tail added here - @segtoc << "

\n" #bugfix sort later DEBUGNOW - @segtoc << @seg_toc_band - ads=SiSU_HTML_promo::Ad.new(@md) - @segtoc << format_head_toc.seg_navigation_tail << ads.div.close << ads.display << format_head_toc.html_close - Output.new(@segtoc.to_s,@md).segtoc - @segtoc=[] - @toc[:scr],@toc[:seg]=[],[] - toc_shared - end - end - class Table < SiSU_HTML_table::Table - end - class Scroll < SiSU_HTML_scroll::Scroll - end - class Scroll_output - def initialize(scr_toc,scr_body,scr_endnotes,scr_metadata,scr_owner_details,scr_tails,md) - @scr_toc,@scr_body,@scr_endnotes,@scr_metadata,@scr_owner_details,@scr_tails,@md=scr_toc,scr_body,scr_endnotes,scr_metadata,scr_owner_details,scr_tails,md - end - def publish - scroll=[] - scroll << @scr_toc << @scr_body << @scr_endnotes << @scr_metadata << @scr_owner_details << @scr_tails - scroll.to_s - end - end - class Seg < SiSU_HTML_seg::Seg - end - class Output - include SiSU_Param - @@dp=nil - def initialize(data='',md='') - @data,@md=data,md - @my_make=SiSU_Env::Create_file.new(@md.cmd,@md.fns,@md) - @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern - end - def scroll - begin - @sisu=[] - @data.each do |para| - para.strip! - para.gsub!(/<:.+?>/,'') - unless para =~/^\s*$/ - para="#{para}\n" - @sisu << para - end - end - @filename_html_scroll=@my_make.file_html_scroll(@md) - new_file_data=@sisu.to_s - @sisu=new_file_data.split(/\n\n/) - @sisu.each {|para| @filename_html_scroll.puts para,"\n"} - rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error - end - end - def segtoc - begin - @sisu=[] - @data.each do |para| - para.strip! - para.gsub!(/|<~\d+;(?:[ohm]|[0-6]:)\d+;\w\d+><#@dp:#@dp>/,'') - unless para =~/^\s*$/ - para="#{para}\n" - @sisu << para - end - end - new_file_data=@sisu.to_s - @filename_html_segtoc=@my_make.file_html_segtoc(@md) - @filename_html_index=@my_make.file_html_index(@md) - @sisu=new_file_data.split(/\n\n/) - @sisu.each {|para| @filename_html_segtoc.puts para,"\n"} - @sisu.each {|para| @filename_html_index.puts para,"\n"} - rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error - end - end - def seg - begin - @sisu=[] - @data.each do |para| - para.strip! - unless para =~/^\s*$/; @sisu << para - end - end - new_file_data=@sisu.to_s - @sisu=new_file_data.split(/\n\n/) - @sisu.each {|para| @newfile.puts para,"\n"} - rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error - end - end - end - end -end -__END__ diff --git a/lib/sisu/0.52/html_format.rb b/lib/sisu/0.52/html_format.rb deleted file mode 100644 index 780b3253..00000000 --- a/lib/sisu/0.52/html_format.rb +++ /dev/null @@ -1,1056 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: base formatting template for html generation - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - - Summary of GPL 2 - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl2.fsf - - SiSU was first released to the public on January 4th 2005 - - SiSU uses: - - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - © Ralph Amissah 1997, current 2007. - All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com -=end -module SiSU_HTML_Format - require SiSU_lib + '/param' - include SiSU_Param - include SiSU_Viz - class Paragraph_number - def initialize(md,paranum) - @md=md - @paranum=paranum[/(\d+)/m,1] - @paranum ||='' - @paranum='' if @md.mod.inspect =~/--no-ocn/ - end - def ocn_display - ocn_class=if @md.mod.inspect =~/--no-ocn/; 'ocn_off' - else 'ocn' - end - @paranum.gsub(/^(\d+|)$/, - %{

-   \\1 -

}) - end - def name - %{} - end - def id #w3c? "tidy" complains about numbers as identifiers ! annoying - %{id="o#@paranum"} - end - def goto - %{} - end - end - class Paragraph_id_ocn #used by table version #work area 2003w48 - attr_accessor :paranum,:font,:p_num - def initialize(md,paranum) - @paranum,@vz,@p_num=paranum,SiSU_Env::Get_init.instance.skin,SiSU_HTML_Format::Paragraph_number.new(md,paranum) #font - end - def txt - %{

#{@p_num.name} - } - end - def txt_00 - %{

#{@p_num.name} - } - end - def font_citation - %{} - end - def endnote - %{

#{@p_num.name} - } - end - def table - %{

#{@p_num.name} - } - end - def tiny - %{

#{@p_num.name} - } - end - def small - %{

#{@p_num.name} - } # keep but not used? - end - def font_tiny - %{} - end - def font_small - %{} - end - def header_ - %{

#{@p_num.name} - } - end - end - class Head_information - include SiSU_Viz - include SiSU_HTML_Format - include SiSU_Env - attr_reader :md,:sfx,:pdf,:rdf,:vz - def initialize(md='') - @md=md - @sfx,@pdf=@md.sfx,@md.pdf - @rdf=SiSU_XML_tags::RDF.new(md) - # DublinCore 1 - title - @vz=SiSU_Env::Get_init.instance.skin - @css=SiSU_Env::CSS_stylesheet.new(md) - @seg_name_html=(SiSU_HTML::Source::Seg.new.seg_name_html || []) - @seg_name_html_tracker=(SiSU_HTML::Source::Seg.new.seg_name_html_tracker || []) - case @md.file_type - when /php/; @index='index' # @index="index.php" - else @index='index' - end - @metalink='#metadata' - @tocband_scroll,@tocband_segtoc=nil,nil - end - def doc_type - %{ -\n} - end - def toc_head_escript #embedded script in this case PHP - # %{

PHP or other embedded script for object persistence may go HERE

} - end - def seg_head_escript #embedded script in this case PHP - # %{

PHP or other embedded script for object persistence may go HERE

} - end - def table_close - %{
-#{@vz.table_close}} - end - def buttons_home - %{ - #{@vz.banner_home_and_index_buttons} -} - end - def copyat - %{#{@vz.paragraph_heading_1_center}copy @ -
- #{@vz.txt_home} - } - end - end - class Widget < Head_information - def initialize(md) - super(md) - @md=md - @cf_defaults=SiSU_Env::Info_processing_flag.new - end - def home - %{
- - #{@vz.png_homepage} - - - #{text} - - - - #{text} - - - - #{@vz.nav_txt_manifest} - - - - #{@vz.nav_txt_pdf_portrait} - - - - #{@vz.nav_txt_pdf_landscape} - - - - #{@vz.nav_txt_odf} - - - - #{text} - -
-#{pdf} - -} - %{
- #{@vz.banner_band} - -   -#{@vz.table_close} -

} - end - def seg_head_navigation_band(type='') - if type=~/pdf/ - @tocband_segtoc=make_scroll_seg_pdf - end - firstseg=%{ - #{@vz.png_nav_nxt} - } if @md.firstseg =~/\S+/ - %{ - - - -} - %{
- #{@vz.banner_band} - - #@tocband_segtoc - -  #{firstseg}  -#{@vz.table_close} -

} - end - def manifest_link(text) - %{ - #{text} - } - end - def concordance_link(text) - if @md.concord_make - %{ - - #{text} - - } - else '' - end - end - def make_seg_scroll_pdf - wgt=Widget.new(@md) - scroll=%{

- #{@vz.nav_txt_doc_link} -
- - #{scroll} - #{wgt.seg(@vz.nav_txt_toc_link)}#{wgt.pdf}#{wgt.odf} - #{wgt.concordance(@vz.nav_txt_concordance)} - #{wgt.manifest} - #{wgt.search} - #{wgt.home} -
} - end - def make_scroll_seg_pdf - manifest=scroll=seg='' - wgt=Widget.new(@md) - seg=%{

- #{@vz.nav_txt_toc_link} -
- - #{seg} - #{wgt.scroll(@vz.nav_txt_doc_link)}#{wgt.pdf}#{wgt.odf} -
- #{wgt.concordance(@vz.nav_txt_concordance)} - #{wgt.manifest} - #{wgt.search} - #{wgt.home} -
} - end - def head - %{#{doc_type} - - - #{@md.html_title} - - - #{@rdf.rdftoc} - #{@rdf.metatag_html} - #{@vz.font_css_table_file} - -#{@vz.color_body} - - - - #{@vz.js_top}} - end - def document_versions_toc - #document_version_hold - end - def links_guide_vertical_open #??? - url=(defined? @vz.url_hp) && @vz.url_hp =~/^http:\/\/\S+$/ ? @vz.url_hp : @vz.url_home - %{