From 1b8c2dbfb474dce40548bc1cfc052017a9682a12 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 11 Dec 2008 21:30:36 -0500 Subject: harvest, better integrated into sisu [note sql module not yet updated to include topic_register, as requires recreation of all sisu db(s)] --- lib/sisu/v0/css.rb | 90 ++++++++++++++++++++++++++++++++++++------ lib/sisu/v0/harvest.rb | 4 ++ lib/sisu/v0/harvest_authors.rb | 33 ++++++++++++++-- lib/sisu/v0/harvest_topics.rb | 33 ++++++++++++++-- lib/sisu/v0/hub.rb | 6 +-- lib/sisu/v0/i18n.rb | 21 ++++++++++ lib/sisu/v0/manifest.rb | 16 +++++++- 7 files changed, 181 insertions(+), 22 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v0/css.rb b/lib/sisu/v0/css.rb index d5a15971..2094134f 100644 --- a/lib/sisu/v0/css.rb +++ b/lib/sisu/v0/css.rb @@ -248,6 +248,7 @@ WOK } th, td { display: inline; + vertical-align: top; } */ a:link { @@ -334,7 +335,7 @@ WOK .norm, .bold { line-height: 150%; - margin-left: 1em; + margin-left: 0em; margin-right: 2em; margin-top: 10px; margin-bottom: 0px; @@ -347,22 +348,83 @@ WOK font-weight: normal; line-height: 150%; text-align: justify; - margin-left: 1em; + margin-left: 0em; margin-right: 2em; text-indent: 0mm; margin-top: 3px; margin-bottom: 3px; } p.norm { } - p.i1 {margin-left: 2em;} - p.i2 {margin-left: 3em;} - p.i3 {margin-left: 4em;} - p.i4 {margin-left: 5em;} - p.i5 {margin-left: 6em;} - p.i6 {margin-left: 7em;} - p.i7 {margin-left: 8em;} - p.i8 {margin-left: 9em;} - p.i9 {margin-left: 10em;} + p.i1 {margin-left: 1em;} + p.i2 {margin-left: 2em;} + p.i3 {margin-left: 3em;} + p.i4 {margin-left: 4em;} + p.i5 {margin-left: 5em;} + p.i6 {margin-left: 6em;} + p.i7 {margin-left: 7em;} + p.i8 {margin-left: 8em;} + p.i9 {margin-left: 9em;} + + p.it0 { + margin-left: 0em; + margin-top: 6px; + margin-bottom: 0px; + line-height: 100%; + } + p.it1 { + margin-left: 1em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it2 { + margin-left: 2em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it3 { + margin-left: 3em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it4 { + margin-left: 4em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it5 { + margin-left: 5em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it6 { + margin-left: 6em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it7 { + margin-left: 7em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it8 { + margin-left: 8em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it9 { + margin-left: 9em; + margin-bottom: 0px; + margin-top: 0px; + line-height: 100%; + } p.code { font-family: inconsolata, andale mono, courier new, courier, monospace; @@ -396,6 +458,10 @@ WOK p.bold { font-weight: bold; } + p.bold_left { + font-weight: bold; + text-align: left; + } p.centerbold { text-align: center; font-weight: bold; @@ -534,7 +600,7 @@ WOK table { } tr { } - th, td { } + th, td { vertical-align: top; } p.left, th.left, td.left { text-align: left; diff --git a/lib/sisu/v0/harvest.rb b/lib/sisu/v0/harvest.rb index e8609a93..49303571 100644 --- a/lib/sisu/v0/harvest.rb +++ b/lib/sisu/v0/harvest.rb @@ -80,6 +80,10 @@ def cases(opt) css(opt) if opt.cmd.inspect =~/M/ HARVEST_authors::Songsheet.new(opt).songsheet HARVEST_topics::Songsheet.new(opt).songsheet + if opt.cmd.inspect =~/R/ + require "#{SiSU_lib}/remote" + SiSU_Remote::Put.new(opt).rsync_harvest + end else help end diff --git a/lib/sisu/v0/harvest_authors.rb b/lib/sisu/v0/harvest_authors.rb index 7a5e1cea..9586fcc3 100644 --- a/lib/sisu/v0/harvest_authors.rb +++ b/lib/sisu/v0/harvest_authors.rb @@ -168,38 +168,57 @@ module HARVEST_authors @env=SiSU_Env::Info_env.new @rc=Get_init.instance.yamlrc @page='sisu_manifest.html' + @alph=%W[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] + @letter=@alph.shift + @vz=SiSU_Env::Get_init.instance.skin + end + def html_file_open @output={} @output[:html]=File.new("#{@env.path.output_md_harvest}/harvest_authors.html",'w') @output[:html_mnt]= if @opt.cmd.inspect =~/-M/ File.new("#{@env.path.pwd}/harvest_authors.html",'w') else nil end - @alph=%W[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] - @letter=@alph.shift + end + def html_file_close + @output[:html].close + @output[:html_mnt].close if @output[:html_mnt].class == File end def html_print def html_songsheet + html_file_open html_head html_alph html_body html_tail + html_file_close end def html_head_adjust(type='') css_path=if type !~/maintenance/ '../_sisu/css/harvest.css' else 'harvest.css' end + sv=SiSU_Env::Info_version.new.get_version < SiSU Metadata Harvest - Authors + + + + + + + + +

SiSU Metadata Harvest - Authors

-

also see SiSU Metadata Harvest - Topics

+

[ HOME ] also see SiSU Metadata Harvest - Topics


WOK end @@ -222,6 +241,14 @@ WOK def html_tail a=[] a <<< + + + + + + +#{@vz.credits_sisu} WOK diff --git a/lib/sisu/v0/harvest_topics.rb b/lib/sisu/v0/harvest_topics.rb index bda82629..51f55b2b 100644 --- a/lib/sisu/v0/harvest_topics.rb +++ b/lib/sisu/v0/harvest_topics.rb @@ -251,37 +251,56 @@ module HARVEST_topics @env=SiSU_Env::Info_env.new @rc=Get_init.instance.yamlrc @page='sisu_manifest.html' + @alph=%W[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] + @letter=@alph.shift + @vz=SiSU_Env::Get_init.instance.skin + end + def html_file_open @output={} @output[:html]=File.new("#{@env.path.output_md_harvest}/harvest_topics.html",'w') if @opt.cmd.inspect =~/-M/ @output[:html_mnt]=File.new("#{@env.path.pwd}/harvest_topics.html",'w') end - @alph=%W[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] - @letter=@alph.shift + end + def html_file_close + @output[:html].close + @output[:html_mnt].close if @output[:html_mnt].class == File end def html_print def html_songsheet + html_file_open html_head html_alph html_body html_tail + html_file_close end def html_head_adjust(type='') css_path=if type !~/maintenance/ '../_sisu/css/harvest.css' else 'harvest.css' end + sv=SiSU_Env::Info_version.new.get_version < SiSU Metadata Harvest - Topics + + + + + + + + +

SiSU Metadata Harvest - Topics

-

also see SiSU Metadata Harvest - Authors

+

[ HOME ] also see SiSU Metadata Harvest - Authors


WOK end @@ -304,6 +323,14 @@ WOK def html_tail a=[] a <<< + + + + + + +#{@vz.credits_sisu} WOK diff --git a/lib/sisu/v0/hub.rb b/lib/sisu/v0/hub.rb index 93766140..33af71f9 100644 --- a/lib/sisu/v0/hub.rb +++ b/lib/sisu/v0/hub.rb @@ -181,7 +181,7 @@ module SiSU end end end - SiSU_Remote::Put.new(@opt).rsync_harvest if @opt.cmd.inspect =~/R/ and @opt.mod.inspect =~/harvest/ + #SiSU_Remote::Put.new(@opt).rsync_harvest if @opt.cmd.inspect =~/R/ and @opt.mod.inspect =~/harvest/ elsif @req =~/^dbi$/; SiSU_DBI::SiSU_SQL.new(@opt).connect # -D -d elsif @req=~/^sisupod_make$/; SiSU_Doc::Source.new(@opt).read # -S end @@ -495,8 +495,8 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ if @opt.cmd =~/R/; op('remote','rsync') #% -R copy to remote server end else - if @opt.cmd =~/R/; op('remote','rsync_harvest') #% -R copy to remote server - end + #if @opt.cmd =~/R/; op('remote','rsync_harvest') #% -R copy to remote server + #end end if @opt.cmd =~/[QuUvVM]/; op('urls','urls') #% -Q -u -v -V -M urls end diff --git a/lib/sisu/v0/i18n.rb b/lib/sisu/v0/i18n.rb index 673ab08d..20f788f5 100644 --- a/lib/sisu/v0/i18n.rb +++ b/lib/sisu/v0/i18n.rb @@ -227,6 +227,9 @@ module SiSU_Translate def prefix_b @lang_class.prefix_b end + def topic_register + @lang_class.topic_register + end def fns @lang_class.fns end @@ -436,6 +439,9 @@ module SiSU_Translate def prefix_b 'Prefix (b)' end + def topic_register + 'Topics Registered' + end def sourcefile 'Sourcefile' end @@ -641,6 +647,9 @@ module SiSU_Translate def prefix_b 'Préfixe (b)' end + def topic_register + 'Topics Registered' + end def sourcefile 'Fichier source' end @@ -846,6 +855,9 @@ module SiSU_Translate def prefix_b 'Präfix (b)' end + def topic_register + 'Topics Registered' + end def sourcefile 'Quelldatei' end @@ -1051,6 +1063,9 @@ module SiSU_Translate def prefix_b 'Prefijo (b)' end + def topic_register + 'Topics Registered' + end def sourcefile 'Fichero fuente' end @@ -1256,6 +1271,9 @@ module SiSU_Translate def prefix_b 'Premessa (b)' end + def topic_register + 'Topics Registered' + end def sourcefile 'Sorgente' end @@ -1461,6 +1479,9 @@ module SiSU_Translate def prefix_b 'Prefix (b)' end + def topic_register + 'Topics Registered' + end def sourcefile 'Lähdetiedosto' end diff --git a/lib/sisu/v0/manifest.rb b/lib/sisu/v0/manifest.rb index 0b7c7bfc..793ecdc2 100644 --- a/lib/sisu/v0/manifest.rb +++ b/lib/sisu/v0/manifest.rb @@ -170,7 +170,7 @@ module SiSU_Manifest end end def metadata(id,info) - @manifest[:html] << %{

#{id}:

#{info}

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

#{id}:

#{info}

\n} end def links(url,lnk,target) static=if url =~/^\.\//; url.gsub(/^\.(\.)?/,@base_url) @@ -465,6 +465,20 @@ module SiSU_Manifest id,info=@translate.prefix_b,@md.prefix_b metadata(id,info) end + if @md.topic_register_array.length > 1 + @manifest[:html] << %{

#{@translate.topic_register}:

\n} + @md.topic_register_array.each do |t| + t.each_with_index do |st,i| + if st.class == Array + st.each do |v| + @manifest[:html] << %{

#{v}

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

#{st}

\n} + end + end + end + @manifest[:html] << %{\n} + end if @md.fns id,info=@translate.sourcefile,@md.fns metadata(id,info) -- cgit v1.2.3