From 9800f4b2b666b484c2d9f25445fdfd4cdf112386 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 21 Apr 2010 16:52:35 -0400 Subject: defaults, default sisu home, correct links to document examples and to summary --- lib/sisu/v2/defaults.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/defaults.rb b/lib/sisu/v2/defaults.rb index a654aed7..6056aa61 100644 --- a/lib/sisu/v2/defaults.rb +++ b/lib/sisu/v2/defaults.rb @@ -1775,7 +1775,7 @@ outputs include: plaintext, html, XHTML, XML, ODF (OpenDocument), EPUB, LaTeX, P ---

- + What does SiSU do? Summary

@@ -1783,7 +1783,7 @@ outputs include: plaintext, html, XHTML, XML, ODF (OpenDocument), EPUB, LaTeX, P ---

- + Book Samples and Markup Examples

-- cgit v1.2.3 From 0bb8889dccaba8415bc27952a100dd0cae9dd8fe Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 21 Apr 2010 16:54:38 -0400 Subject: constants, reduce max limit for SQL VARCHAR to 2500 to be within default postgresql range --- lib/sisu/v2/constants.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/sisu/v2/constants.rb b/lib/sisu/v2/constants.rb index 9a24736c..02c76e6a 100644 --- a/lib/sisu/v2/constants.rb +++ b/lib/sisu/v2/constants.rb @@ -150,7 +150,7 @@ Db[:col_classify_small]=16 Db[:col_filename]=256 Db[:col_digest]=64 Db[:col_filesize]=10 -Db[:col_info_note]=3000 +Db[:col_info_note]=2500 __END__ consider: 〔comment〕 -- cgit v1.2.3 From 59fda0080a5e6d7e1caecc67373992ec9fccac77 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 23 Apr 2010 10:40:20 -0400 Subject: defaults, for default home search form, always point to latest db version --- lib/sisu/v2/defaults.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/sisu/v2/defaults.rb b/lib/sisu/v2/defaults.rb index 6056aa61..aa1c8e49 100644 --- a/lib/sisu/v2/defaults.rb +++ b/lib/sisu/v2/defaults.rb @@ -2072,7 +2072,7 @@ More information on SiSU p
- + idx txt -- cgit v1.2.3 From 4cff73e6c4fddbbea1aa23d850bccf6c5341b9bd Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 23 Apr 2010 20:10:55 -0400 Subject: sisupod_make, take new markup into account, done for :skin: * not perfect, improve upon, should probably match @make: then :skin: --- lib/sisu/v2/sisupod_make.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/sisupod_make.rb b/lib/sisu/v2/sisupod_make.rb index 50d55a38..0b4b56d8 100644 --- a/lib/sisu/v2/sisupod_make.rb +++ b/lib/sisu/v2/sisupod_make.rb @@ -161,11 +161,11 @@ module SiSU_Doc def sisupod_build #see also sisupod in sysenv @rgx_rb_image=/["'](\S+?\.(?:png|jpg|gif))["']/ @rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/ - @rgx_skin=/^@skin:\s+(\S+)/ + @rgx_skin=/^\s+:skin:\s+(\S+)/ @rgx_doc_import=/^%\s\s*\|(\S+?\.ss[ti])\|@\|\^\|>>ok/ - use_file=if @opt.fns =~/(?:\.ssm|\.ssm\.sst)$/; "#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst" - else @opt.fns - end + use_file=@opt.fns =~/(?:\.ssm|\.ssm\.sst)$/ \ + ? "#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst" \ + : @opt.fns file_array=IO.readlines(use_file,'') skin,images,doc_import=[],[],[] file_array.each do |f| #% work area -- cgit v1.2.3 From 8b3f9e832f69bcef52f073678bbde1fcc588e695 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 26 Apr 2010 20:58:26 -0400 Subject: git, start experimenting with an alternative/parallel git based sisu document structure * git, start to experiment with file structure to replace sisupod -g and will be in configure options, to track changes to document, enable creation of "pods" (zipped content) and allow for remote versioned (or unversioned) placement of content source; ideally would end up with two co-existing, distinct parse-able structures whether local or remote, the existing directory structure with multiple documents and document images etc. and git directories with all content associated with a single document (including other language versions of it); cannot guarantee at this stage that the file structure will be retained, which may mean recreating any directory started and defeat the purpose of using it, though it is in a version control repo, so perhaps not ... best left alone (unused) for now --- lib/sisu/v2/constants.rb | 6 +- lib/sisu/v2/git.rb | 166 ++++++++++++++++++++++++++++++++++++++++++++++- lib/sisu/v2/hub.rb | 8 ++- lib/sisu/v2/sysenv.rb | 24 ++++++- 4 files changed, 196 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/constants.rb b/lib/sisu/v2/constants.rb index 02c76e6a..8606796a 100644 --- a/lib/sisu/v2/constants.rb +++ b/lib/sisu/v2/constants.rb @@ -58,7 +58,7 @@ =end Sfx={:txt=>'.txt',:html=>'.html',:xhtml=>'.xhtml',:xml=>'.xml',:epub=>'.epub',:epub_xhtml=>'.xhtml',:odt=>'.odt',:pdf=>'.pdf'} -Ax,Xx,Mx,Rx,Hx,Dx,Px,Db,Tex={},{},{},{},{},{},{},{},{} +Ax,Xx,Mx,Rx,Hx,Dx,Px,Db,Gt,Tex=Array.new(10){{}} Ax[:tab]="\t" Xx[:protect]='☞' Xx[:segment]='Ф' @@ -151,6 +151,10 @@ Db[:col_filename]=256 Db[:col_digest]=64 Db[:col_filesize]=10 Db[:col_info_note]=2500 +Gt[:grotto]='sisu:' +Gt[:txt]='txt' +Gt[:image]='images' +Gt[:conf]='conf' __END__ consider: 〔comment〕 diff --git a/lib/sisu/v2/git.rb b/lib/sisu/v2/git.rb index 0a318d83..2d7629fd 100644 --- a/lib/sisu/v2/git.rb +++ b/lib/sisu/v2/git.rb @@ -56,7 +56,167 @@ ** Description: system environment, resource control and configuration details =end - - #___# - +module SiSU_Git + require "#{SiSU_lib}/param" # param.rb + require "#{SiSU_lib}/sysenv" # sysenv.rb + require "#{SiSU_lib}/dal" # dal.rb + class Source + include FileUtils #::Verbose + def initialize(opt) + @opt=opt + @env=SiSU_Env::Info_env.new + @git_path={} + @git_path[:fnb]=@env.path.processing_path_git + '/' + @opt.fnb + @git_path[:src]=@git_path[:fnb] + '/' + Gt[:txt] + @git_path[:image]=@git_path[:fnb] + '/' + Gt[:image] + @git_path[:conf]=@git_path[:fnb] + '/' + Gt[:conf] + @md=SiSU_Param::Parameters.new(@opt).get + SiSU_DAL::Source.new(@opt).read # -m + end + def read + make_dir_fnb + if program_found? + git_init + end + populate.sisusrc_files + if program_found? + git_commit + end + end + def program_found? + found=`whereis git` + (found =~/bin\/git\b/) ? true : false + end + def make_dir_fnb + mkdir_p(@git_path[:fnb]) unless FileTest.directory?(@git_path[:fnb]) + mkdir_p(@git_path[:src]) unless FileTest.directory?(@git_path[:src]) + mkdir_p(@git_path[:conf]) unless FileTest.directory?(@git_path[:conf]) + mkdir_p("#{@git_path[:conf]}/skin") unless FileTest.directory?("#{@git_path[:conf]}/skin") + mkdir_p(@git_path[:image]) unless FileTest.directory?(@git_path[:image]) + end + def git_init + unless FileTest.directory?("#{@git_path[:fnb]}/.git") + system("cd #{@git_path[:fnb]}\ + && git init + ") + end + end + def git_commit + system("cd #{@git_path[:fnb]} \ + && git add . \ + && git commit -a + ") + end + def populate + def identify_language_versions + print __FILE__ + ':' + p __LINE__ + end + def copy_src_head + if @opt.fns =~/\.ssm\.sst/ + ssm=@opt.fns.gsub(/\.ssm\.sst/,'.ssm') + cp_r("#{@env.path.pwd}/#{ssm}",@git_path[:src]) + else + cp_r("#{@env.path.pwd}/#{@opt.fns}",@git_path[:src]) + end + end + def copy_related_sst_ssi + doc_import=[] + @rgx_doc_import=/^<<\s(\S+?\.ss[ti])/ + file_array=IO.readlines(@opt.fns,'') + file_array.each do |f| + if f =~@rgx_doc_import + doc_import = doc_import + f.scan(@rgx_doc_import).uniq.flatten + end + end + doc_import.each do |f| + cp_r("#{@env.path.pwd}/#{f}",@git_path[:src]) + end + end + def locate_parse_file + composite_src=@opt.fns=~/\.ssm$/ ? true : false + parse_file=if composite_src \ + and @opt.cmd.inspect !~/m/ + ##SiSU_Assemble::Composite.new(@opt).read + #SiSU_DAL::Source.new(@opt).read # -m + "#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst" + elsif composite_src + "#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst" + else "#{@env.path.pwd}/#{@opt.fns}" + end + end + def locate_skin + SiSU_Env::Info_skin.new(@md).select + end + def read_composite + #print __FILE__ + ':' + #p __LINE__ + end + def extract_skin + #print __FILE__ + ':' + #p __LINE__ + end + def extract_skin_and_images #(parse_file) + parse_file_name=locate_parse_file + parse_file=IO.readlines(parse_file_name,'') + rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/ + #rgx_rb_image=/["'](\S+?\.(?:png|jpg|gif))["']/ + #rgx_rb_image=/[^\/]?([a-z]\S+?\.(?:png|jpg|gif))/ + rgx_rb_image=/([a-z][^ \/]+?\.(?:png|jpg|gif))/ + rgx_skin=/^\s+:skin:\s+(\S+)/ + skin_get=nil + images=[] + skin_get + parse_file.each do |f| #% work area + if f !~/^%+\s/ + skin_get ||= f.scan(rgx_skin).uniq.flatten if f =~rgx_skin + if f =~rgx_image + images << f.scan(rgx_image).uniq + end + end + end + skin=skin_get[0] if skin_get + skin=locate_skin + parse_skin=IO.readlines(skin,"\n") + parse_skin.each do |f| #% work area + if f !~/^#/ \ + and f =~rgx_rb_image + images << f.scan(rgx_rb_image).uniq + end + end + image_path="#{@env.path.pwd}/_sisu/image" + images.flatten.each do |i| + if FileTest.file?("#{image_path}/#{i}") + cp_r("#{image_path}/#{i}",@git_path[:image]) + end + end + if FileTest.file?(skin) + cp_r(skin,"#{@git_path[:conf]}/skin") + end + {:skin =>skin, :images =>images} + end + def read_src + print __FILE__ + ':' + p __LINE__ + end + def composite_src? + @opt.fns=~/\.ssm$/ ? true : false + end + def sisusrc_files + populate.copy_src_head + if composite_src? + populate.copy_related_sst_ssi + end + populate.extract_skin + #parse_file_name=locate_parse_file + #parse_file=IO.readlines(parse_file_name,'') + populate.extract_skin_and_images #(parse_file) + #populate.extract_composite_source + #populate.read_composite # or read_each_composite + populate.identify_language_versions + end + self + end + end +end __END__ diff --git a/lib/sisu/v2/hub.rb b/lib/sisu/v2/hub.rb index 08a120fa..58f62d0f 100644 --- a/lib/sisu/v2/hub.rb +++ b/lib/sisu/v2/hub.rb @@ -124,6 +124,7 @@ module SiSU @opt.fns=fns.gsub(/\.ssm$/,'.ssm.sst') end SiSU_DAL::Source.new(@opt).read # -m + when /^git$/; SiSU_Git::Source.new(@opt).read # -g when /^concordance$/; SiSU_Concordance::Source.new(@opt).read # -w when /^share_src$/; SiSU_Markup::Source.new(@opt).read # -s when /^sisupod_make$/; SiSU_Doc::Source.new(@opt).read # -S @@ -283,7 +284,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ if @opt.mod.inspect =~/--convert|--to|--from/ require "#{SiSU_lib}/sst_convert_markup" # sst_convert_markup.rb end - if @opt.cmd =~/([AabCcDdeFfGHhIiJjLMmNnOopQqrRSsTtUuVvwWXxYyZ_0-9])/ \ + if @opt.cmd =~/([AabCcDdeFfgGHhIiJjLMmNnOopQqrRSsTtUuVvwWXxYyZ_0-9])/ \ and @opt.cmd =~/^-/ \ and @opt.mod.inspect !~/--(?:sitemaps|query|identify)/ \ or @opt.mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/ #and @@ -292,7 +293,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ flag=SiSU_Env::Info_processing_flag.new extra='' if @opt.cmd !~/[mn]/ - extra+=if @opt.cmd =~/[abeghHhIiJjNOoptTwXxz]/ \ + extra+=if @opt.cmd =~/[abehHhIiJjNOoptTwXxz]/ \ and @opt.cmd !~/[mn]/ 'm' #% add dal elsif ((@opt.cmd =~/[Dd]/ \ @@ -372,6 +373,9 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ if @opt.cmd =~/s/ #% -s sisu source op('share_src','SiSU markup source') end + if @opt.cmd =~/g/ #% -g sisu git + op('git','SiSU Git') + end if @opt.cmd =~/m/ #% -m is remote url requested? (download if) @retry_count= -1 begin diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb index c857468f..ed0fe136 100644 --- a/lib/sisu/v2/sysenv.rb +++ b/lib/sisu/v2/sysenv.rb @@ -115,6 +115,7 @@ module SiSU_Env end processing_path=tmp_processing_individual processing_dir=prcss_dir + processing_git="#{Dir.pwd}/#{Gt[:grotto]}" user=ENV['USER'] port_pgsql=if defined? ENV['PGPORT'] \ and not (ENV['PGPORT'].nil? \ @@ -149,6 +150,7 @@ module SiSU_Env PROCESSING_SQLITE=:processing_sqlite PROCESSING_POSTGRESQL=:processing_postgresql PROCESSING_ENCODING=:processing_encoding + PROCESSING_GIT=:processing_git PAPERSIZE=:papersize LANGUAGE=:language LANGUAGE_CODE=:language_code @@ -191,6 +193,7 @@ module SiSU_Env PROCESSING_SQLITE => 'sqlite', PROCESSING_POSTGRESQL=> 'postgresql', PROCESSING_ENCODING => 'encoding', + PROCESSING_GIT => processing_git, #TEXINFO_STUB => 'texinfo', PAPERSIZE => 'A4', #A4, US_letter, book_b5, book_a5, US_legal LANGUAGE => 'English', @@ -526,7 +529,7 @@ module SiSU_Env end def program_found?(program) found=`whereis #{program}` - state=(found =~/bin\/#{program}\b/) ? true : false + (found =~/bin\/#{program}\b/) ? true : false end def locale #locales utf8 or other unless @@locale_flag @@ -817,7 +820,7 @@ module SiSU_Env class Info_env < Env_call require 'fileutils' include FileUtils - attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:stub_pwd,:stub_src,:webserv_host_cgi,:webserv_port_cgi,:processing,:etc,:yamlrc_dir + attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:stub_pwd,:stub_src,:webserv_host_cgi,:webserv_port_cgi,:processing,:processing_git,:etc,:yamlrc_dir @@image_flag,@@local_image=true,true #warning on @@image_flag @@fb=@@man_path=nil,nil def initialize(fns='',md=nil) @@ -1449,6 +1452,23 @@ WOK end processing end + def processing_path_git + proposed_dir=if defined? @rc['git']['dir'] \ + and not @rc['git']['dir'].nil? \ + and not @rc['git']['dir'].empty? + x=(@rc['git']['dir'] =~/^(?:~|home)$/) \ + ? home + '/' + 'sisu:' \ + : @rc['git']['dir'] + '/' + 'sisu:' + else defaults[:processing_git] + end + end + def processing_git + unless FileTest.directory?(processing_path_git) + mkdir_p(processing_path_git) + File.chmod(0700,processing_path_git) + end + processing_path_git + end def epub "#{processing}/epub/#{@fnb}" end -- cgit v1.2.3 From 361032d47d096c241d562852e71211feb0198b56 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 26 Apr 2010 21:07:14 -0400 Subject: metadata, db sql (table structure), adds OCLC number, and; html metadata, renables showing of topic_register * db (sql) add oclc (Online Computer Library Center) number, affects table structure, (hence breakage & version bump) * new db name prefix "sisu_v2c_"; new pgsql db name prefix "SiSUv2c_" * OCLC == Online Computer Library Center --- lib/sisu/v2/constants.rb | 4 ++-- lib/sisu/v2/db_columns.rb | 26 ++++++++++++++++++++++++-- lib/sisu/v2/db_create.rb | 2 ++ lib/sisu/v2/db_load_tuple.rb | 2 ++ lib/sisu/v2/i18n.rb | 6 ++++++ lib/sisu/v2/manifest.rb | 10 +++++++++- lib/sisu/v2/param.rb | 21 ++++++++++++++++++++- lib/sisu/v2/shared_metadata.rb | 10 ++++++++++ 8 files changed, 75 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/constants.rb b/lib/sisu/v2/constants.rb index 8606796a..83914038 100644 --- a/lib/sisu/v2/constants.rb +++ b/lib/sisu/v2/constants.rb @@ -131,8 +131,8 @@ Px[:lv4]= '-' Px[:lv5]= '.' Px[:lv6]= '.' #Px[:lv5_6]= '.' -Db[:name_prefix]="SiSU#{SiSU_version_dir}b_" -Db[:name_prefix_db]="sisu_#{SiSU_version_dir}b_" +Db[:name_prefix]="SiSU#{SiSU_version_dir}c_" +Db[:name_prefix_db]="sisu_#{SiSU_version_dir}c_" Db[:col_title]=800 Db[:col_title_part]=400 Db[:col_title_edition]=10 diff --git a/lib/sisu/v2/db_columns.rb b/lib/sisu/v2/db_columns.rb index 0c2eb367..ba861f4d 100644 --- a/lib/sisu/v2/db_columns.rb +++ b/lib/sisu/v2/db_columns.rb @@ -1425,7 +1425,7 @@ module SiSU_DB_columns end def column_comment %{COMMENT ON COLUMN metadata_and_text.#{name} - IS 'metadata classify document library of congress (if available)';} + IS 'metadata classify document Library of Congress';} end def tuple t=if defined? @md.classify.loc \ @@ -1447,7 +1447,7 @@ module SiSU_DB_columns end def column_comment %{COMMENT ON COLUMN metadata_and_text.#{name} - IS 'metadata classify document dewey (if available)';} + IS 'metadata classify document Dewey';} end def tuple t=if defined? @md.classify.dewey \ @@ -1460,6 +1460,28 @@ module SiSU_DB_columns end self end + def classify_oclc + def name + 'classify_oclc' + end + def create_column + "#{name} VARCHAR(#{Db[:col_classify_library]}) NULL," + end + def column_comment + %{COMMENT ON COLUMN metadata_and_text.#{name} + IS 'metadata classify document Online Computer Library Center number';} + end + def tuple + t=if defined? @md.classify.oclc \ + and @md.classify.oclc=~/\S+/ + txt=@md.classify.oclc + special_character_escape(txt) + ["#{name}, ","'#{txt}', "] + else ['',''] + end + end + self + end def classify_pg def name 'classify_pg' diff --git a/lib/sisu/v2/db_create.rb b/lib/sisu/v2/db_create.rb index c7ce9a6d..f6c2e50f 100644 --- a/lib/sisu/v2/db_create.rb +++ b/lib/sisu/v2/db_create.rb @@ -166,6 +166,7 @@ module SiSU_DB_create #{column.classify_type.create_column} #{column.classify_loc.create_column} #{column.classify_dewey.create_column} + #{column.classify_oclc.create_column} #{column.classify_pg.create_column} #{column.classify_isbn.create_column} #{column.classify_format.create_column} @@ -418,6 +419,7 @@ module SiSU_DB_create %{#{column.classify_type.column_comment}}, %{#{column.classify_loc.column_comment}}, %{#{column.classify_dewey.column_comment}}, + %{#{column.classify_oclc.column_comment}}, %{#{column.classify_pg.column_comment}}, %{#{column.classify_isbn.column_comment}}, %{#{column.classify_format.column_comment}}, diff --git a/lib/sisu/v2/db_load_tuple.rb b/lib/sisu/v2/db_load_tuple.rb index 67c8008f..f1af99a0 100644 --- a/lib/sisu/v2/db_load_tuple.rb +++ b/lib/sisu/v2/db_load_tuple.rb @@ -176,6 +176,7 @@ module SiSU_DB_tuple #{@tp.column.classify_type.tuple[0]} #{@tp.column.classify_loc.tuple[0]} #{@tp.column.classify_dewey.tuple[0]} +#{@tp.column.classify_oclc.tuple[0]} #{@tp.column.classify_pg.tuple[0]} #{@tp.column.classify_isbn.tuple[0]} #{@tp.column.classify_format.tuple[0]} @@ -259,6 +260,7 @@ tid) #{@tp.column.classify_type.tuple[1]} #{@tp.column.classify_loc.tuple[1]} #{@tp.column.classify_dewey.tuple[1]} +#{@tp.column.classify_oclc.tuple[1]} #{@tp.column.classify_pg.tuple[1]} #{@tp.column.classify_isbn.tuple[1]} #{@tp.column.classify_format.tuple[1]} diff --git a/lib/sisu/v2/i18n.rb b/lib/sisu/v2/i18n.rb index e65e3717..1f81a941 100644 --- a/lib/sisu/v2/i18n.rb +++ b/lib/sisu/v2/i18n.rb @@ -213,6 +213,9 @@ module SiSU_Translate def cls_dewey @lang_class.cls_dewey end + def cls_oclc + @lang_class.cls_oclc + end def cls_gutenberg @lang_class.cls_gutenberg end @@ -428,6 +431,9 @@ module SiSU_Translate def cls_dewey 'Classify Dewey' end + def cls_oclc + 'Classify OCLC number' + end def cls_gutenberg 'Classify Project Gutenberg' end diff --git a/lib/sisu/v2/manifest.rb b/lib/sisu/v2/manifest.rb index c1da4ccb..85881263 100644 --- a/lib/sisu/v2/manifest.rb +++ b/lib/sisu/v2/manifest.rb @@ -485,6 +485,13 @@ module SiSU_Manifest id,info=@translate.cls_dewey,@md.classify.dewey metadata(id,info) end + if defined? @md.classify.oclc \ + and @md.classify.oclc=~/\S+/ + id,info=@translate.cls_oclc,@md.classify.oclc + @manifest[:html] << %{

#{id}:

\n} + @manifest[:html] << %{

#{info}

\n} + @manifest[:html] << %{\n} + end if defined? @md.classify.pg \ and @md.classify.pg=~/\S+/ id,info=@translate.cls_gutenberg,@md.classify.pg @@ -505,7 +512,8 @@ module SiSU_Manifest id,info=@translate.prefix_b,@md.notes.prefix_b metadata(id,info) end - if @md.topic_register_array.length > 1 + if defined? @md.topic_register_array \ + and @md.topic_register_array.length > 0 @manifest[:html] << %{

#{@translate.topic_register}:

\n} @md.topic_register_array.each do |t| t.each_with_index do |st,i| diff --git a/lib/sisu/v2/param.rb b/lib/sisu/v2/param.rb index 87dd9aab..bf32fc59 100644 --- a/lib/sisu/v2/param.rb +++ b/lib/sisu/v2/param.rb @@ -514,6 +514,11 @@ module SiSU_Param l,n=Db[:col_classify_library],'classify.dewey' validate_length(s,l,n) end + def oclc + s=@h['oclc'] + l,n=Db[:col_classify_library],'classify.oclc' + validate_length(s,l,n) + end def pg s=@h['pg'] l,n=Db[:col_classify_small],'classify.pg' @@ -927,7 +932,7 @@ module SiSU_Param l=determine_papersize(l.dup) @papersize=l end - when /^@make:(.+)/m #% metainfo DC + when /^@make:(.+)/m #% metainfo DC @make=Md.new($1.strip,@opt).make if defined? @make.breaks \ and @make.breaks[:page_new] #clearpage @@ -1097,6 +1102,20 @@ module SiSU_Param @rights=Md_default.new.rights("[#{@creator.author}]",'') end end + if defined? @classify.topic_register \ + and @classify.topic_register.length >3 + topic_register=@classify.topic_register + u=topic_register.scan(/[^;]+/) + v=[] + u.each do |l| + v << l.scan(/[^:]+/) + end + v.each do |m| + m[-1]=m[-1].scan(/[^|]+/) if m[-1] =~/[|]/ + @topic_register_array << m + end + @topic_register_array.sort! + end if @markup_version.to_f >= 0.38 #convert values in headers to internal representation translated=[] translate_list=[@pagenew,@pagebreak,@num_top,@toc_lev_limit] diff --git a/lib/sisu/v2/shared_metadata.rb b/lib/sisu/v2/shared_metadata.rb index 07f87e2c..bd1fe73a 100644 --- a/lib/sisu/v2/shared_metadata.rb +++ b/lib/sisu/v2/shared_metadata.rb @@ -633,6 +633,11 @@ WOK tag,inf=tr.date,@md.date.published meta << meta_para(tag,inf) end + if defined? @md.classify.topic_register \ + and @md.classify.topic_register=~/\S+/ + tag,inf=tr.topic_register,@md.classify.topic_register + meta << meta_para(tag,inf) + end if defined? @md.classify.loc \ and @md.classify.loc=~/\S+/ tag,inf=tr.cls_loc,@md.classify.loc @@ -643,6 +648,11 @@ WOK tag,inf=tr.cls_dewey,@md.classify.dewey meta << meta_para(tag,inf) end + if defined? @md.classify.oclc \ + and @md.classify.oclc=~/\S+/ + tag,inf=tr.cls_oclc,@md.classify.oclc + meta << meta_para(tag,inf) + end if defined? @md.classify.pg \ and @md.classify.pg=~/\S+/ tag,inf=tr.cls_gutenberg,@md.classify.pg -- cgit v1.2.3 From 02afaef5fe0b35ee2554b86a98dc9563cd6b5c5f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 27 Apr 2010 11:42:07 -0400 Subject: plaintext, clean up bulleted grouped text output (still not line-wrapped though) --- lib/sisu/v2/plaintext.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/sisu/v2/plaintext.rb b/lib/sisu/v2/plaintext.rb index ddc82839..851da3f8 100644 --- a/lib/sisu/v2/plaintext.rb +++ b/lib/sisu/v2/plaintext.rb @@ -310,6 +310,7 @@ WOK dob.obj.gsub!(/#{Mx[:gl_o]}#169#{Mx[:gl_c]}/,'©') end if dob.of=='group' # watch + dob.obj.gsub!(/#{Mx[:gl_o]}●#{Mx[:gl_c]}/,"* ") dob.obj.gsub!(/#{Mx[:br_line]}|#{Mx[:br_nl]}/,"\n") else dob.obj.gsub!(/#{Mx[:br_line]}|#{Mx[:br_nl]}/,"\n\n") end -- cgit v1.2.3 From 39943bc95dc5bc96cb2af1ac431c395b938e515c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 27 Apr 2010 15:10:57 -0400 Subject: switch markup for bold and emphasis, now !{bold}! and *{emphasis}* (emphais output defaults to bold, later make it possible to configure emphasis output optionally as being represented by italics) --- lib/sisu/v2/dal_syntax.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/dal_syntax.rb b/lib/sisu/v2/dal_syntax.rb index 4a13b069..b7b9ec4b 100644 --- a/lib/sisu/v2/dal_syntax.rb +++ b/lib/sisu/v2/dal_syntax.rb @@ -215,8 +215,8 @@ module SiSU_Syntax def bodymarkup(dob) # << http://www.jus.uio.no/sisu/sisu_markup_table/markup >> # See: data/sisu/sample/document_samples_sisu_markup/ - # !{emphasis}! e{emphasis}e emphasis - # *{bold text}* b{bold}b bold text + # *{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? @@ -411,8 +411,8 @@ module SiSU_Syntax dob end def tech #script markup planned to be more strict for technical documents - # !{emphasis}! e{emphasis}e emphasis - # *{bold text}* b{bold}b bold text + # *{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 -- cgit v1.2.3 From 74e7af807d62161e13335a501bfc1124175a78da Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 27 Apr 2010 19:43:04 -0400 Subject: i18n, mark OCLC number for translation --- lib/sisu/v2/i18n.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib') diff --git a/lib/sisu/v2/i18n.rb b/lib/sisu/v2/i18n.rb index 1f81a941..2aa730be 100644 --- a/lib/sisu/v2/i18n.rb +++ b/lib/sisu/v2/i18n.rb @@ -645,6 +645,9 @@ module SiSU_Translate def cls_dewey 'Classification Dewey' end + def cls_oclc # fix + 'Classify OCLC number' + end def cls_gutenberg 'Classification du project Gutenberg' end @@ -853,6 +856,9 @@ module SiSU_Translate def cls_dewey 'Klassifikation nach Dewey' end + def cls_oclc # fix + 'Classify OCLC number' + end def cls_gutenberg 'Klassifikation nach Projekt Gutenberg' end @@ -1061,6 +1067,9 @@ module SiSU_Translate def cls_dewey 'Clasificación Dewey' end + def cls_oclc # fix + 'Classify OCLC number' + end def cls_gutenberg 'Clasificación Proyecto Gutenberg' end @@ -1269,6 +1278,9 @@ module SiSU_Translate def cls_dewey 'Classificazione Dewey' end + def cls_oclc # fix + 'Classify OCLC number' + end def cls_gutenberg 'Classificazione del Progetto Gutenberg' end @@ -1477,6 +1489,9 @@ module SiSU_Translate def cls_dewey 'Classify Dewey' end + def cls_oclc # fix + 'Classify OCLC number' + end def cls_gutenberg 'Classify Project Gutenberg' end -- cgit v1.2.3