From a19b7494c87f05c895bb3cc76969ad9af0bf6c08 Mon Sep 17 00:00:00 2001
From: Ralph Amissah
Date: Sun, 19 Aug 2007 02:41:50 +0100
Subject: sisu-0.56.3 minor update, small fixes
* manifest make file-type descriptions simpler to understand
* copyright restricted to rights tag, unless none, in which case rights tag
gets creator information
* copyright mark picked up in rights if 'Copyright (C)' is used
* tex/pdf url matching semi-colon following url
* endnote heading, apply tag to exclude numbering and segment heading where
there is no segment
* html scroll endnote text minor fix
* initialize site structure, make copy site images default (sisu -CC)
---
lib/sisu/v0/conf.rb | 3 +-
lib/sisu/v0/dal.rb | 2 +-
lib/sisu/v0/defaults.rb | 4 +--
lib/sisu/v0/html.rb | 1 -
lib/sisu/v0/html_format.rb | 6 ++--
lib/sisu/v0/html_segments.rb | 2 +-
lib/sisu/v0/html_tune.rb | 4 +--
lib/sisu/v0/manifest.rb | 67 ++++++++++++++++++++++++--------------------
lib/sisu/v0/param.rb | 17 ++++++-----
lib/sisu/v0/texpdf.rb | 11 ++++----
lib/sisu/v0/texpdf_format.rb | 29 ++++++++++---------
11 files changed, 77 insertions(+), 69 deletions(-)
(limited to 'lib')
diff --git a/lib/sisu/v0/conf.rb b/lib/sisu/v0/conf.rb
index 108639df..92632e79 100644
--- a/lib/sisu/v0/conf.rb
+++ b/lib/sisu/v0/conf.rb
@@ -72,7 +72,7 @@ module SiSU_Initialize
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/
+ 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
@@ -113,6 +113,7 @@ module SiSU_Initialize
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
+ SiSU_Env::Create_system_link.new.images
end
def css
tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Configuring CSSs','')
diff --git a/lib/sisu/v0/dal.rb b/lib/sisu/v0/dal.rb
index 8880ca9d..a4e512f2 100644
--- a/lib/sisu/v0/dal.rb
+++ b/lib/sisu/v0/dal.rb
@@ -502,7 +502,7 @@ module SiSU_DAL
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
+ @tuned_file << "\n4~endnotes Endnotes <-#> <~0;0:0;u0>"
end
@tuned_file << "\n"
@tuned_file=@tuned_file.flatten
diff --git a/lib/sisu/v0/defaults.rb b/lib/sisu/v0/defaults.rb
index a3a19988..3d5a7c40 100644
--- a/lib/sisu/v0/defaults.rb
+++ b/lib/sisu/v0/defaults.rb
@@ -1327,7 +1327,7 @@ WOK
#{v[:project]}
- © Ralph Amissah.
+ Copyright © Ralph Amissah
1997, current #{@date.year_static}.
All Rights Reserved.
@@ -1356,7 +1356,7 @@ WOK
Standard SiSU meta-markup syntax, and the
Standard SiSU object citation numbering and system, (object/text positioning system)
- © Ralph Amissah 1997, current #{@date.year_static}.
+ Copyright © Ralph Amissah 1997, current #{@date.year_static}.
All Rights Reserved.
diff --git a/lib/sisu/v0/html.rb b/lib/sisu/v0/html.rb
index 62d0a44a..5bec99bc 100644
--- a/lib/sisu/v0/html.rb
+++ b/lib/sisu/v0/html.rb
@@ -598,7 +598,6 @@ WOK
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
diff --git a/lib/sisu/v0/html_format.rb b/lib/sisu/v0/html_format.rb
index cbbcadb4..b78017fd 100644
--- a/lib/sisu/v0/html_format.rb
+++ b/lib/sisu/v0/html_format.rb
@@ -436,7 +436,7 @@ WOK
def prefix_a
end
def rights
- rights=@md.dc_rights.gsub(/^\s*Copyright\s+/,'© ')
+ rights=@md.dc_rights.gsub(/^\s*Copyright\s+\(C\)/,'Copyright © ')
%{#{rights}
}
end
@@ -609,9 +609,7 @@ WOK
def title_endnote
%{#{@vz.margin_txt_0}
#{@vz.paragraph_txt}
-
-
- Endnotes
+
#{@vz.margin_num}
#{@vz.table_close}}
diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb
index 96eb0bee..44ab9033 100644
--- a/lib/sisu/v0/html_segments.rb
+++ b/lib/sisu/v0/html_segments.rb
@@ -208,7 +208,7 @@ module SiSU_HTML_seg
end
@p_num ||= ''
if @@is1 == 1
- @dc_creator=%{© #{@md.dc_creator}\n} if @md.dc_creator.to_s =~/\S/
+ @dc_creator=%{#{@md.dc_creator}\n} if @md.dc_creator.to_s =~/\S/
@@seg[:tocband] << format_head_seg.navigation_band(@@segtocband,@@seg[:dot_nav])
@@seg[:headers] << format_head_seg.seg_head_escript if SiSU_HTML_Format_type::Head_seg.method_defined? :seg_head_escript #debug PHP move up in text #bug
@@seg[:headers] << format_head_seg.title_banner(@md.title,@md.subtitle,@dc_creator).gsub(clean,'')
diff --git a/lib/sisu/v0/html_tune.rb b/lib/sisu/v0/html_tune.rb
index cca41056..7f91641e 100644
--- a/lib/sisu/v0/html_tune.rb
+++ b/lib/sisu/v0/html_tune.rb
@@ -245,8 +245,8 @@ module SiSU_Tune
@words=[]
data.each do |word|
@words << if word=~/\{(.+?)\}((?:https?|ftp)\S+|image)/
- if word =~/\{(.+?)\}((?:https?|ftp)\S+|image)([;.,](?:\s|$))/
- m,u,d=/\{(.+?)\}((?:https?|ftp)\S+|image)([;.,](?:\s|$))/.match(word).captures
+ if word =~/\{(.+?)\}((?:https?|ftp)\S+|image)([;.,]?(?:\s|$))/
+ m,u,d=/\{(.+?)\}((?:https?|ftp)\S+|image)([;.,]?(?:\s|$))/.match(word).captures
else m,u=/\{(.+?)\}((?:https?|ftp)\S+|image)/.match(word).captures
d=''
end
diff --git a/lib/sisu/v0/manifest.rb b/lib/sisu/v0/manifest.rb
index 998d3c59..bca5cd92 100644
--- a/lib/sisu/v0/manifest.rb
+++ b/lib/sisu/v0/manifest.rb
@@ -107,11 +107,11 @@ module SiSU_Manifest
manifest << x
end
end
- def summarize(id,file)
+ def summarize(id,file,img='')
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] << %{#{file} | #{id} #@base_url/#{file} | #{kb} |
\n}
+ @manifest[:html] << %{#{img}#{id} | #{file} <#@base_url/#{file}> | #{kb} |
\n}
end
def summarize_source(id,file)
sys=SiSU_Env::System_call.new
@@ -123,7 +123,9 @@ 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] << %{#{id}: #{file} #@base_url/#{file} | #{dgst[1]} | #{kb} |
\n}
+ @manifest[:html] << %{#{id} | #{file} #{dgst[1]} <#@base_url/#{file}> | #{kb}
+ |
\n} if kb and kb =~/\d+/
+ #@manifest[:html] << %{#{id}: #{file} <#@base_url/#{file}> | #{dgst[1]} | #{kb} |
\n} if kb and kb =~/\d+/
end
def languages(id,file)
flv=@env.published_manifests?(@base_path)
@@ -151,52 +153,57 @@ module SiSU_Manifest
elsif url =~/^\.\.\//; url.gsub(/^\.(\.)?/,@env.url.root)
else url
end
- @manifest[:html] << %{#{lnk} #{static} |
\n}
+ @manifest[:html] << %{#{lnk} <#{static}> |
\n}
end
def output_tests
if FileTest.file?("#@base_path/#{@md.fn[:toc]}")==true
- id,file='HTML table of contents (linked to segmented text)',@md.fn[:toc]
- summarize(id,file)
+ img=' '
+ id,file='table of contents (for segmented HTML text)',@md.fn[:toc]
+ summarize(id,file,img)
end
if FileTest.file?("#@base_path/#{@md.fn[:doc]}")==true
- id,file='HTML document (scroll)',@md.fn[:doc]
- summarize(id,file)
- end
- if FileTest.file?("#@base_path/#{@md.fn[:xhtml]}")==true
- id,file='XHTML',@md.fn[:xhtml]
- summarize(id,file)
+ img=' '
+ id,file='full length document (HTML)',@md.fn[:doc]
+ summarize(id,file,img)
end
- if FileTest.file?("#@base_path/#{@md.fn[:sax]}")==true
- id,file='XML (SAX)',@md.fn[:sax]
- summarize(id,file)
+ if FileTest.file?("#@base_path/#{@md.fn[:pdf_p]}")==true
+ img=' '
+ id,file='full length document (PDF portrait / vertical - recommended for printing)',@md.fn[:pdf_p]
+ summarize(id,file,img)
end
- if FileTest.file?("#@base_path/#{@md.fn[:dom]}")==true
- id,file='XML (DOM)',@md.fn[:dom]
- summarize(id,file)
+ if FileTest.file?("#@base_path/#{@md.fn[:pdf_l]}")==true
+ img=' '
+ id,file='full length document (PDF landscape / horizontal - recommended for screen viewing)',@md.fn[:pdf_l]
+ summarize(id,file,img)
end
if FileTest.file?("#@base_path/#{@md.fn[:odf]}")==true
- id,file='ODF:ODT (Open Document Format)',@md.fn[:odf]
+ img=' '
+ id,file='full length document (ODF:ODT - Open Document Format)',@md.fn[:odf]
+ summarize(id,file,img)
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:xhtml]}")==true
+ id,file='full length document (XHTML)',@md.fn[:xhtml]
summarize(id,file)
end
- if FileTest.file?("#@base_path/#{@md.fn[:pdf_p]}")==true
- id,file='PDF (portrait) - print bias',@md.fn[:pdf_p]
+ if FileTest.file?("#@base_path/#{@md.fn[:sax]}")==true
+ id,file='full length document (XML SAX)',@md.fn[:sax]
summarize(id,file)
end
- if FileTest.file?("#@base_path/#{@md.fn[:pdf_l]}")==true
- id,file='PDF (landscape) - screen view bias (colored links)',@md.fn[:pdf_l]
+ if FileTest.file?("#@base_path/#{@md.fn[:dom]}")==true
+ id,file='full length document (XML DOM)',@md.fn[:dom]
summarize(id,file)
end
if FileTest.file?("#@base_path/#{@md.fn[:plain]}")==true
- if @md.cmd =~/a/; id,file='plaintext Unix (UTF-8) (footnotes)',@md.fn[:plain]
- elsif @md.cmd =~/e/; id,file='plaintext Unix (UTF-8) (endnotes)',@md.fn[:plain]
- elsif @md.cmd =~/A/; id,file='plaintext dos (UTF-8) (footnotes)',@md.fn[:plain]
- elsif @md.cmd =~/E/; id,file='plaintext dos (UTF-8) (endnotes)',@md.fn[:plain]
- else id,file='plaintext (UTF-8)',@md.fn[:plain]
+ if @md.cmd =~/a/; id,file='full length document (plaintext Unix (UTF-8) with footnotes)',@md.fn[:plain]
+ elsif @md.cmd =~/e/; id,file='full length document (plaintext Unix (UTF-8) with endnotes)',@md.fn[:plain]
+ elsif @md.cmd =~/A/; id,file='full length document (plaintext dos (UTF-8) with footnotes)',@md.fn[:plain]
+ elsif @md.cmd =~/E/; id,file='full length document (plaintext dos (UTF-8) with endnotes)',@md.fn[:plain]
+ else id,file='full length document (plaintext (UTF-8))',@md.fn[:plain]
end
summarize(id,file)
end
if FileTest.file?("#@base_path/#{@md.fn[:concordance]}")==true
- id,file='Concordance (wordmap)',@md.fn[:concordance]
+ id,file='Concordance file (HTML - wordmap, alphabetical wordlist)',@md.fn[:concordance]
summarize(id,file)
end
if FileTest.file?("#@base_path/#{@md.fns}.tex")==true
@@ -483,7 +490,7 @@ WOK
@manifest[:html] <<<#{@translate.manifest_description_output}
- #{@translate.filename} | #{@translate.description} | #{@translate.file_size} (kB) |
+ #{@translate.description} | #{@translate.filename} | #{@translate.file_size} (kB) |
WOK
output_tests
diff --git a/lib/sisu/v0/param.rb b/lib/sisu/v0/param.rb
index 211516ad..186901a1 100644
--- a/lib/sisu/v0/param.rb
+++ b/lib/sisu/v0/param.rb
@@ -262,9 +262,6 @@ module SiSU_Param
@creator_home, @dc_creator=$1,$2
else @dc_creator=/(?:0~|@)(?:creator|author)-?:?\s+(.+?)$/m.match(para)[1]
end
- @creator_copymark=if para=~/(?:0~|@)(?:creator|author)-:?/; false
- else true
- end
@dc_creator.strip!
when /^(?:0~(?:translator|translated_by)|@(?:translator|translated_by):)\s+(.+?)$/m #% metainfo
@translator=$1
@@ -516,12 +513,6 @@ module SiSU_Param
@lv4 ||=/^4~/
@lv5 ||=/^5~/
@lv6 ||=/^6~/
- if @dc_creator
- @dc_rights ||=if @dc_date =~/([12][890]\d{2})/ #matches years 1800 through 20\d\d 2004w19
- ('Copyright ' + @dc_creator) + ' ' + $1
- else 'Copyright ' + @dc_creator
- end
- end
else #%
if para =~ /^(?:1|:?A)~/ #% processing
if para=~/^:?A~/
@@ -585,6 +576,14 @@ module SiSU_Param
end
end
end #% here endeth the document loop
+ unless @dc_rights
+ if @dc_creator
+ @dc_rights ||=if @dc_date =~/([12][890]\d{2})/ #matches years 1800 through 20\d\d 2004w19
+ "Copyright (C) #{$1} #@dc_creator"
+ else 'Copyright (C)' + @dc_creator
+ end
+ end
+ 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/v0/texpdf.rb b/lib/sisu/v0/texpdf.rb
index 6ac87240..22c2681d 100644
--- a/lib/sisu/v0/texpdf.rb
+++ b/lib/sisu/v0/texpdf.rb
@@ -258,7 +258,8 @@ module SiSU_TeX
copymark=if @md.creator_copymark; '{\\begin{small}\\raisebox{1ex}{\\copyright}\\end{small}} '
else ''
end
- copyright=do_mono.special_characters_safe.gsub(/^\s*Copyright/, copymark)
+ copymark='Copyright {\\begin{small}\\raisebox{1ex}{\\copyright}\\end{small}} '
+ copyright=do_mono.special_characters_safe.gsub(/^\s*Copyright \(C\)/, copymark)
@@rights||="\n #{@@tex_backslash*2}[3]\\ \\linebreak #{copyright}"
end
if @md.prefix_b
@@ -308,7 +309,6 @@ module SiSU_TeX
def footnote(data)
@tex_file=[]
data.each do |para|
- para2=para.dup
# EMBEDDED FOOTNOTES / ENDNOTES should be straightforward but not quite a synch.
footnote=[]
if para =~/~\\\{[\d*+]+\s|\\\~\[([*+]\d+)\s/ # note escape not necessary in front of ~ has implications for many other matches #debug note
@@ -366,9 +366,10 @@ WOK
sisu_rc_footnote=if @md.sc_info; @tex.doc_sc_info_footnote_full
else @tex.doc_sc_info_footnote_brief
end
- @copymark=if @md.creator_copymark; '^\copyright'
- else ''
- end
+ #@copymark=if @md.creator_copymark; '^\copyright'
+ #else ''
+ #end
+ @copymark='' #check and remove as now is superflous
if @orientation =~/landscape/ # using longtable latex package
@tex_file << SiSU_TeX_Pdf::Format_text_object.new(@md,@md.title,@md.subtitle).title_landscape
if @md.dc_creator
diff --git a/lib/sisu/v0/texpdf_format.rb b/lib/sisu/v0/texpdf_format.rb
index 92333d28..0880a9c7 100644
--- a/lib/sisu/v0/texpdf_format.rb
+++ b/lib/sisu/v0/texpdf_format.rb
@@ -66,7 +66,7 @@ module SiSU_TeX_Pdf
@vz=SiSU_Env::Get_init.instance.skin
@date=SiSU_Env::Info_date.new # #{@date.year}
@copymark='{\\begin{footnotesize}\\raisebox{1ex}{\\copyright}\\end{footnotesize}}'
- #@url_brace=SiSU_Viz::Skin.new.url_decoration
+ @url_brace=SiSU_Viz::Skin.new.url_decoration
end
def skip
"\n\\vspace*{\\smallskipamount} \n"
@@ -144,9 +144,9 @@ WOK
\\\\ ~
{\\begin{footnotesize}#{base_prog_txt}
\\\\ Generated by \\href{http://www.jus.uio.no/sisu}{SiSU} \\begin{tiny}[ #{v[:project]} #{v[:version]} of #{v[:date_stamp]} ]\\end{tiny} \\href{http://www.jus.uio.no/sisu}{www.jus.uio.no/sisu}
-\\\\ #@copymark Ralph Amissah 1997, current #{@date.year_static}, All Rights Reserved.
+\\\\ Copyright #@copymark 1997, current #{@date.year_static} Ralph Amissah, All Rights Reserved.
\\\\ SiSU is software for document structuring, publishing and search (with object citation numbering), \\href{http://www.sisudoc.org}{www.sisudoc.org}
-\\\\ SiSU is released under \\href{http://www.fsf.org/licenses/gpl.html}{GPL 3 } or later, \\href{http://www.fsf.org/licenses/gpl.html}{http://www.fsf.org/licenses/gpl.html}.
+\\\\ SiSU is released under \\href{http://www.fsf.org/licenses/gpl.html}{GPL 3 } or later, #{@url_brace.tex_open}\\href{http://www.fsf.org/licenses/gpl.html}{http://www.fsf.org/licenses/gpl.html}#{@url_brace.tex_close}.
{\\end{footnotesize}
\\\\
WOK
@@ -190,7 +190,7 @@ WOK
</,' ')
@string.gsub!(/<\/a>/,' ')
@string.gsub!(/[^\}>_]((?:https?|ftp):\/\/\S+?)(<\/\S>)/,' \begin{scriptsize}\href{\1}{\1} \end{scriptsize}\2') #special case
- @string.gsub!(/((?:^|\s)[}])((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,'\1\begin{scriptsize}\\href{\2}{\2}\end{scriptsize}\3') #special case \{ e.g. \}http://url
- @string.gsub!(/\B(?:\\_|\\)((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,'\begin{scriptsize}\\href{\1}{\1}\end{scriptsize}\2') #specially escaped url no decoration
- @string.gsub!(/(^|\s)((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?=\s|$))/,"\\1#{@url_brace.tex_open}\\begin{scriptsize}\\href{\\2}{\\2}\\end{scriptsize}#{@url_brace.tex_close}\\3") #url matching with decoration positive lookahead, sequence issue with { linked }http://url cannot use \b at start
+ @string.gsub!(/((?:^|\s)[}])((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,'\1\begin{scriptsize}\\href{\2}{\2}\end{scriptsize}\3') #special case \{ e.g. \}http://url
+ @string.gsub!(/\B(?:\\_|\\)((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,'\begin{scriptsize}\\href{\1}{\1}\end{scriptsize}\2') #specially escaped url no decoration
+ @string.gsub!(/(^|\s)((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?=\s|$))/,"\\1#{@url_brace.tex_open}\\begin{scriptsize}\\href{\\2}{\\2}\\end{scriptsize}#{@url_brace.tex_close}\\3") #url matching with decoration positive lookahead, sequence issue with { linked }http://url cannot use \b at start
@string.gsub!(/<:ee>/,'')
@string.gsub!(//,' ')
#proposed change, insert, but may be redundant
@@ -789,10 +789,13 @@ WOK
dir=SiSU_Env::Info_env.new(@md.fns)
@words=[]
@string.each do |word|
- @words << if word=~/\{.+?\}(?:https?|ftp):\S+/
- if word =~/\\\{(.+?)\\\}((?:https?|ftp)\S+?)([;.,](?:\s|$))/
- r=%r/\\\{(.+?)\\?\}((?:https?|ftp):\S+?)(?:[;.,](?:\s|$)|(?:\s|$))/
- d=/\\\{.+?\\?\}(?:https?|ftp):\S+([;.,](?:\s|$))/.match(word).captures.to_s
+ @words << if word=~/\\\{.+?\\\}(?:https?|ftp):\S+/
+ if word =~/\\\{(.+?)\\\}((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/
+ r=%r/\\\{(.+?)\\?\}((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)(?:[;.,]?(?:\s|$)|(?:\s|$))/
+ d=/\\\{.+?\\?\}(?:https?|ftp):\/\/\S+?\.[^'"><\s]+?([;.,]?(?:\s|$))/.match(word).captures.to_s
+# if word =~/\\\{(.+?)\\\}((?:https?|ftp)\S+?)([;.,]?(?:\s|$))/
+# r=%r/\\\{(.+?)\\?\}((?:https?|ftp):\S+?)(?:[;.,]?(?:\s|$)|(?:\s|$))/
+# d=/\\\{.+?\\?\}(?:https?|ftp):\S+?([;.,]?(?:\s|$))/.match(word).captures.to_s
else
r=%r/\\\{(.+?)\\?\}((?:https?|ftp):\S+)/
d=''
--
cgit v1.2.3