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/manifest.rb | 67 +++++++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 30 deletions(-) (limited to 'lib/sisu/v0/manifest.rb') 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='TOC linked ' + 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='Full Text ' + 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='PDF portrait ' + 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='PDF landscape ' + 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='ODF/ODT ' + 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} - + WOK output_tests -- cgit v1.2.3

#{@translate.filename}

#{@translate.description}

#{@translate.file_size}

(kB)

#{@translate.description}

#{@translate.filename}

#{@translate.file_size}

(kB)