aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2007-08-21 21:34:41 +0100
committerRalph Amissah <ralph@amissah.com>2007-08-21 21:34:41 +0100
commit7ef4f9a39e2aeffd9731ac0b68caca4c1b8cf03f (patch)
treefda200da69959ea24f146937bfd9fee843f368c2
parent0.56.3 md5s (diff)
small fixes to manifest and html_scroll, and adjustment to html navigation band use in concordance and manifest
* manifest * use relative link by default * in absence of configured url_root (http://) use info on location on local filesystem (file://) * html outputs, navigation band/banner adjustment, in concordance and manifest * html scroll, fix to document information link in table of contents
-rw-r--r--CHANGELOG15
-rw-r--r--lib/sisu/v0/concordance.rb19
-rw-r--r--lib/sisu/v0/dal.rb4
-rw-r--r--lib/sisu/v0/defaults.rb4
-rw-r--r--lib/sisu/v0/html.rb11
-rw-r--r--lib/sisu/v0/html_format.rb31
-rw-r--r--lib/sisu/v0/html_scroll.rb8
-rw-r--r--lib/sisu/v0/manifest.rb14
-rw-r--r--lib/sisu/v0/sysenv.rb3
9 files changed, 79 insertions, 30 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 04795b45..1b0ff017 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,6 +6,21 @@ Reverse Chronological:
%% STABLE MANIFEST
+%% sisu_0.56.4.orig.tar.gz (2007-08-21:34/2)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.56.4.orig.tar.gz
+ sisu_0.56.4.orig.tar.gz
+ sisu_0.56.4-1.dsc
+ sisu_0.56.4-1.diff.gz
+
+ * manifest
+ * use relative link by default
+ * in absence of configured url_root (http://) use info on location on local
+ filesystem (file://)
+
+ * html outputs, navigation band/banner adjustment
+
+ * html scroll, fix to document information link in table of contents
+
%% sisu_0.56.3.orig.tar.gz (2007-08-19:33/7)
http://www.jus.uio.no/sisu/pkg/src/sisu_0.56.3.orig.tar.gz
6e799836a6e6aa226f34134b44815ae7 1272888 sisu_0.56.3.orig.tar.gz
diff --git a/lib/sisu/v0/concordance.rb b/lib/sisu/v0/concordance.rb
index 251d5b58..111741ab 100644
--- a/lib/sisu/v0/concordance.rb
+++ b/lib/sisu/v0/concordance.rb
@@ -101,6 +101,9 @@ module SiSU_Concordance
require "#{SiSU_lib}/param"
include SiSU_Param
include SiSU_Viz
+ #revisit, both requires (html & shared_xml) needed for stand alone operation (sisu -w [filename])
+ require "#{SiSU_lib}/shared_xml"
+ require "#{SiSU_lib}/html"
def initialize(lnk,md)
@md=md
@vz=SiSU_Env::Get_init.instance.skin
@@ -113,10 +116,11 @@ module SiSU_Concordance
@lex_button=%{<a href="http://www.jus.uio.no/sisu/" target="_top"><img border="0" height="44" width="144" valign="center" src="../_sisu/image/sisu.png" alt="SiSU home --&gt;"></a>}
@lnk=lnk
@doc_details =<<WOK
-<table summary="links to text related to this rudimentary index" width="96%" border="0" bgcolor="white" cellpadding="0" align="center"><tr><td width="2%" align="right">&nbsp;</td><td width="94%" valign="top" align="justify"><p align="justify"><font size="3" color="#000000" face="times new roman"><a href="#{@md.fn[:manifest]}" #{@vz.js_toc}><img border="0" height="12" width="12" src="../_sisu/image/b_info.png" alt="Manifest">&nbsp;<b>#{@md.dc_title}</b></a><br />&nbsp;&nbsp;&nbsp;&nbsp;#{@md.dc_creator}</font></p><p><font size="3" color="#000000" face="times new roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#{@md.fn[:toc]}" #{@vz.js_toc}><img border="0" height="15" width="15" src="../_sisu/image/b_toc.png" alt="TOC">&nbsp;TOC - table of contents for individual articles</a></font></p><p><font size="3" color="#000000" face="times new roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#{@md.fn[:doc]}" #{@vz.js_doc}><img border="0" height="15" width="15" src="../_sisu/image/b_doc.png" alt="Full Text">&nbsp;Full text (with indexed table of contents)</a></font></p><p><font size="3" color="#000000" face="times new roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#{@md.fn[:pdf_p]}" #{@vz.js_portrait}><img border="0" height="18" width="15" src="../_sisu/image/b_pdf.png" alt="PDF portrait">&nbsp;pdf version of the document (portrait)</a></font></p><p><font size="3" color="#000000" face="times new roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#{@md.fn[:pdf_l]}" #{@vz.js_landscape}><img border="0" height="15" width="18" src="../_sisu/image/b_pdf.png" alt="PDF landscape">&nbsp;pdf version of the document (landscape)</a></font></p> </td></tr></table><p>Word index links are to html versions of the text the segmented version followed by the scroll (single document) version.<br />[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).]</p>
+<table summary="links to text related to this rudimentary index" width="96%" border="0" bgcolor="white" cellpadding="0" align="center"><tr><td width="2%" align="right">&nbsp;</td><td width="94%" valign="top" align="justify"><h1 class="small"><a href="#{@md.fn[:toc]}" #{@vz.js_toc}><b>#{@md.dc_title}</b></a></h1><p class="bold">#{@md.dc_creator}</p></td></tr></table>
WOK
end
def create
+ head_banner=SiSU_HTML_Format_type::Head_toc.new(@md)
<<WOK
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
@@ -135,15 +139,10 @@ WOK
</head>
<body>
#{@vz.js_top}
- <table summary="home button" width="100%" border="0" cellpadding="3" bgcolor= "#ffffff" align="center"><tr>
- <td align="left" valign="top" bgcolor="#ffffff" width="20%">
- #{@vz.banner_home_button_only}
- </td>
- <td width="80%" align="right">
- #{@env.widget_static.search_form}
- </td>
- </tr></table>
- #@doc_details<p>(The word listing/index is Case sensitive: Capitalized words appear before lower case)</p>
+ #{head_banner.concordance_navigation_band('pdf')}
+ #@doc_details
+<p>Word index links are to html versions of the text the segmented version followed by the scroll (single document) version.<br />[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).]</p>
+<p>(The word listing/index is Case sensitive: Capitalized words appear before lower case)</p>
<p>
<b>word</b> (number of occurences)<br />linked references to word within document <br />
[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.]
diff --git a/lib/sisu/v0/dal.rb b/lib/sisu/v0/dal.rb
index a4e512f2..2e5075d4 100644
--- a/lib/sisu/v0/dal.rb
+++ b/lib/sisu/v0/dal.rb
@@ -818,9 +818,9 @@ module SiSU_DAL
ocnm=ocnd=ocnv=0
ocnm+=1
header0='<:pn>'
- header1="\n1~ Document Information <~0;0:0;m#{ocnm}>"
+ header1="\n1~ Document Information (metadata) <~0;0:0;m#{ocnm}>"
ocnm+=1
- header4="\n4~metadata MetaData <~0;m#{ocnm};m#{ocnm}>"
+ 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
diff --git a/lib/sisu/v0/defaults.rb b/lib/sisu/v0/defaults.rb
index 3d5a7c40..c46860c3 100644
--- a/lib/sisu/v0/defaults.rb
+++ b/lib/sisu/v0/defaults.rb
@@ -1380,9 +1380,7 @@ WOK
is released under
<a href="http://www.gnu.org/licenses/gpl.html">GPLv3</a>
or later,
- <a href="http://www.gnu.org/licenses/gpl.html">
- http://www.gnu.org/licenses/gpl.html
- </a>
+ #{url_decoration.xml_open}<a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a>#{url_decoration.xml_close}
</font></p>
</td><td valign="top" width="45%">
<p class="tiny_left"><font color="#666666" size="2">
diff --git a/lib/sisu/v0/html.rb b/lib/sisu/v0/html.rb
index 5bec99bc..0798e604 100644
--- a/lib/sisu/v0/html.rb
+++ b/lib/sisu/v0/html.rb
@@ -392,10 +392,15 @@ WOK
title=if para =~/(<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)$/
m=/#{$1}/
para.gsub!(m,'')
- linkname
- else #if para =~/Document Information/
+ if para=~/^\d~\s+Document Information/
+ %{<b><a href="#docinfo">#{linkname}</a></b>}
+ else linkname
+ end
+ else
@@toc[:scr] << '<br />'
- link='docinfo'
+ link=if para =~/<~[1-9];([0-6]):\d+;\w\d+><#@dp:#@dp>$/; $1
+ else ''
+ end
%{<b><a href="##{link}">#{linkname}</a></b>}
end
format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title)
diff --git a/lib/sisu/v0/html_format.rb b/lib/sisu/v0/html_format.rb
index b78017fd..c568a509 100644
--- a/lib/sisu/v0/html_format.rb
+++ b/lib/sisu/v0/html_format.rb
@@ -280,6 +280,24 @@ WOK
#{@vz.table_close}
<p />}
end
+ def concordance_navigation_band(type='')
+ if type=~/pdf/
+ @tocband_concordance=make_concordance
+ end
+ %{<table summary="concordance navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}>
+<tr><td width="20%">
+ #{@vz.banner_band}
+</td>
+<td width="60%" align="center">
+ #@tocband_concordance
+</td>
+<td width="20%" align="right">
+ &nbsp;<a href="index.html" target="_top" alt="-&gt;">
+ #{@vz.png_nav_toc}
+ </a>&nbsp;
+#{@vz.table_close}
+<p />}
+ end
def seg_head_navigation_band(type='')
if type=~/pdf/
@tocband_segtoc=make_scroll_seg_pdf
@@ -348,6 +366,19 @@ WOK
#{wgt.home}
</tr></table>}
end
+ def make_concordance
+ manifest=scroll=seg=''
+ wgt=Widget.new(@md)
+ %{<table summary="toc scroll and segment with pdf" border="0" cellpadding="3" cellspacing="0">
+<tr>
+ #{wgt.seg(@vz.nav_txt_toc_link)}#{wgt.scroll(@vz.nav_txt_doc_link)}#{wgt.pdf}#{wgt.odf}
+<td align="center" bgcolor=#{@vz.color_band2}>
+ #{wgt.concordance(@vz.nav_txt_concordance)}
+ #{wgt.manifest}
+ #{wgt.search}
+ #{wgt.home}
+</tr></table>}
+ end
def head
%{#{doc_type}
<head>
diff --git a/lib/sisu/v0/html_scroll.rb b/lib/sisu/v0/html_scroll.rb
index 03108ba9..3739f660 100644
--- a/lib/sisu/v0/html_scroll.rb
+++ b/lib/sisu/v0/html_scroll.rb
@@ -80,11 +80,11 @@ module SiSU_HTML_scroll
@rcdc=false
@scr={ :body=>[],:metadata=>[],:owner_details=>[] }
data.each do |para|
- if para =~/Document Information/
- para.gsub!(/(Document Information)/,'\1<a name="docinfo"></a>')
+ if para =~/^\d~\s+Document Information/
+ para.gsub!(/(Document Information(?: \(metadata\))?)/,'\1<a name="docinfo"></a>')
end
- if para =~/MetaData/
- para.gsub!(/(MetaData)/,'\1<a name="metadata"></a>')
+ if para =~/^\d~metadata\s+Metadata/
+ para.gsub!(/(Metadata)/,'\1<a name="metadata"></a>')
end
@rcdc=true if @rcdc==false and (para =~/^\d~metadata/ or para =~/^1~\s+Document Information/)
if para !~/(^0~|<ENDNOTES>|<EOF>)/
diff --git a/lib/sisu/v0/manifest.rb b/lib/sisu/v0/manifest.rb
index bca5cd92..da123216 100644
--- a/lib/sisu/v0/manifest.rb
+++ b/lib/sisu/v0/manifest.rb
@@ -99,6 +99,7 @@ module SiSU_Manifest
l=SiSU_Env::Standardise_language.new.file_to_language(@md.fns)
@language=l[:l]
@translate=SiSU_Translate::Source.new(@md,@language)
+ @url_brace=SiSU_Viz::Skin.new.url_decoration
end
def output
SiSU_Env::SiSU_file.new(@md).mkdir
@@ -111,7 +112,7 @@ module SiSU_Manifest
size=(File.size("#{@base_path}/#{file}")/1024.00).to_s
kb=/([0-9]+\.[0-9]{0,1})/m.match(size)[1]
@manifest[:txt] << "#{file} #{id} #{kb}\n"
- @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#@base_url/#{file}">#{img}#{id}</a></p></th><td><p class="small"><a href="#{file}">#{file}</a></p><p class="tiny">&lt;<a href="#@base_url/#{file}">#@base_url/#{file}</a>&gt;</p></td><td class="right"><p class="right">#{kb}</p></td></tr>\n}
+ @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{file}">#{img}#{id}</a></p></th><td><p class="small"><a href="#{file}">#{file}</a></p><p class="tiny">#{@url_brace.xml_open}<a href="#@base_url/#{file}">#@base_url/#{file}</a>#{@url_brace.xml_close}</p></td><td class="right"><p class="right">#{kb}</p></td></tr>\n}
end
def summarize_source(id,file)
sys=SiSU_Env::System_call.new
@@ -123,9 +124,8 @@ module SiSU_Manifest
size=(File.size("#{@base_path}/#{file}")/1024.00).to_s
kb=/([0-9]+\.[0-9]{0,1})/m.match(size)[1]
@manifest[:txt] << "#{file} #{id} #{kb}\n"
- @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{file}">#{id}</a></p></th><td class="right"><p class="tiny"><a href="#{file}">#{file}</a> &nbsp;&nbsp;#{dgst[1]}<br />&lt;<a href="#@base_url/#{file}">#@base_url/#{file}</a>&gt;</p></td><td class="right"><p class="right">#{kb}</p>
+ @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{file}">#{id}</a></p></th><td class="right"><p class="tiny"><a href="#{file}">#{file}</a> &nbsp;&nbsp;#{dgst[1]}<br />#{@url_brace.xml_open}<a href="#@base_url/#{file}">#@base_url/#{file}</a>#{@url_brace.xml_close}</p></td><td class="right"><p class="right">#{kb}</p>
</td></tr>\n} if kb and kb =~/\d+/
- #@manifest[:html] << %{<tr><th class="left"><p class="tiny">#{id}:</p> <p class="norm"><a href="#{file}">#{file}</a></p><p class="tiny">&nbsp;&nbsp;&lt;<a href="#@base_url/#{file}">#@base_url/#{file}</a>&gt;</p></th><td class="right"><p class="tiny">#{dgst[1]}</p></td><td class="right"><p class="right">#{kb}</p></td></tr>\n} if kb and kb =~/\d+/
end
def languages(id,file)
flv=@env.published_manifests?(@base_path)
@@ -142,7 +142,7 @@ module SiSU_Manifest
flv.each do |l|
lang=SiSU_Translate::Source.new(@md,@language,l[:l]).language_list
@manifest[:txt] << "#{l[:m]} #{lang}\n"
- @manifest[:html] << %{<tr><th class="left"><p class="bold"><a href="#{l[:m]}">#{lang}</a></p></th><td><p class="norm">#{lang}</p><p class="tiny"><a href="#@base_url/#{l[:m]}">#@base_url/#{l[:m]}</a></p></td><td class="right"><p class="right">&nbsp;</p></td></tr>\n}
+ @manifest[:html] << %{<tr><th class="left"><p class="bold"><a href="#{l[:m]}">#{lang}</a></p></th><td><p class="norm">#{lang}</p><p class="tiny">#{@url_brace.xml_open}<a href="#@base_url/#{l[:m]}">#@base_url/#{l[:m]}</a>#{@url_brace.xml_close}</p></td><td class="right"><p class="right">&nbsp;</p></td></tr>\n}
end
end
def metadata(id,info)
@@ -153,7 +153,7 @@ module SiSU_Manifest
elsif url =~/^\.\.\//; url.gsub(/^\.(\.)?/,@env.url.root)
else url
end
- @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{url}">#{lnk}</a></p><p class="tiny">&nbsp;&nbsp;&lt;<a href="#{static}">#{static}</a>&gt;</p></th></tr>\n}
+ @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{url}">#{lnk}</a></p><p class="tiny">&nbsp;&nbsp;#{@url_brace.xml_open}<a href="#{static}">#{static}</a>#{@url_brace.xml_close}</p></th></tr>\n}
end
def output_tests
if FileTest.file?("#@base_path/#{@md.fn[:toc]}")==true
@@ -455,13 +455,13 @@ module SiSU_Manifest
banner_table=if vz.banner_home_button_only !~ /http:\/\/www\.jus\.uio\.no\/sisu/ and vz.banner_home_button_only !~ /sisu\.home\.png/
<<WOK
<table summary="band" width="100%" border="0" cellpadding="3" cellspacing="0">
-<tr><td align="left" bgcolor="#ffffff">#{vz.banner_home_button}</td><td width="60%"><p class="tiny"><a href="#@base_url/#{file}"><img border="0" height="12" width="12" src="#{vz.url_path_image}/bullet_red.png" alt="TOC linked" />&nbsp;#@base_url/#{file}</a></p></td><td width="20%">#{@env.widget_static.search_form}</td><td><a href="http://www.jus.uio.no/sisu/" target="_top"><img border="0" src="#{vz.url_path_image}/sisu.png" alt="SiSU --&gt;" /></a></td></tr>
+<tr><td align="left" bgcolor="#ffffff">#{vz.banner_band}</td><td width="60%"><p class="tiny">#{@url_brace.xml_open}<a href="#@base_url/#{file}">#@base_url/#{file}</a>#{@url_brace.xml_close}</p></td><td width="20%">#{@env.widget_static.search_form}</td><td><a href="http://www.jus.uio.no/sisu/" target="_top"><img border="0" src="#{vz.url_path_image}/sisu.png" alt="SiSU --&gt;" /></a></td></tr>
</table>
WOK
else
<<WOK
<table summary="band" border="0" cellpadding="3" cellspacing="0">
-<tr><td align="left" bgcolor="#ffffff"><a href="http://www.jus.uio.no/sisu/" target="_top"><img border="0" src="#{vz.url_path_image}/sisu.png" alt="SiSU --&gt;" /></a></td><td><p class="tiny"><a href="#@base_url/#{file}"><img border="0" height="12" width="12" src="#{vz.url_path_image}/bullet_red.png" alt="TOC linked" />&nbsp;#@base_url/#{file}</a></p></td><td>#{@env.widget_static.search_form}</td></tr>
+<tr><td align="left" bgcolor="#ffffff"><a href="http://www.jus.uio.no/sisu/" target="_top"><img border="0" src="#{vz.url_path_image}/sisu.png" alt="SiSU --&gt;" /></a></td><td><p class="tiny">#{@url_brace.xml_open}<a href="#@base_url/#{file}">#@base_url/#{file}</a>#{@url_brace.xml_close}</p></td><td>#{@env.widget_static.search_form}</td></tr>
</table>
WOK
end
diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb
index 10ec5e33..9052ac91 100644
--- a/lib/sisu/v0/sysenv.rb
+++ b/lib/sisu/v0/sysenv.rb
@@ -1275,7 +1275,8 @@ module SiSU_Env
end
def root
if defined? @rc['webserv']['url_root'] and @rc['webserv']['url_root'] =~/http:\/\//; "#{@rc['webserv']['url_root']}/#@stub_pwd"
- else "http://localhost/#@stub_pwd"
+ elsif defined? @rc['webserv']['url_root'] and @rc['webserv']['url_root'] =~/localhost/; "http://localhost/#@stub_pwd"
+ else "file://#{path.output}"
end
end
def remote