diff options
Diffstat (limited to 'lib/sisu/v0/manifest.rb')
| -rw-r--r-- | lib/sisu/v0/manifest.rb | 67 | 
1 files changed, 37 insertions, 30 deletions
| 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] << %{<tr><th class="left"><p class="bold"><a href="#{file}">#{file}</a></p></th><td><p class="norm">#{id}</p><p class="tiny"><a href="#@base_url/#{file}">#@base_url/#{file}</a></p></td><td class="right"><p class="right">#{kb}</p></td></tr>\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"><<a href="#@base_url/#{file}">#@base_url/#{file}</a>></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,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] << %{<tr><th class="left"><p class="tiny">#{id}:</p> <p class="norm"><a href="#{file}">#{file}</a></p><p class="tiny"><a href="#@base_url/#{file}">#@base_url/#{file}</a></p></th><td class="right"><p class="tiny">#{dgst[1]}</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}">#{id}</a></p></th><td class="right"><p class="tiny"><a href="#{file}">#{file}</a>   #{dgst[1]}<br /><<a href="#@base_url/#{file}">#@base_url/#{file}</a>></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">  <<a href="#@base_url/#{file}">#@base_url/#{file}</a>></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) @@ -151,52 +153,57 @@ 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"><a href="#{static}">#{static}</a></p></th></tr>\n} +        @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{url}">#{lnk}</a></p><p class="tiny">  <<a href="#{static}">#{static}</a>></p></th></tr>\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='<img border="0" height="18" width="15" src="../_sisu/image/b_toc.png" alt="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='<img border="0" height="15" width="15" src="../_sisu/image/b_doc.png" alt="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='<img border="0" height="18" width="15" src="../_sisu/image/b_pdf.png" alt="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='<img border="0" height="15" width="18" src="../_sisu/image/b_pdf.png" alt="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='<img border="0" height="18" width="18" src="../_sisu/image/b_odf.png" alt="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] <<<<WOK  <h2 class="small"><a name="output">#{@translate.manifest_description_output}</a></h2>  <table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center"> -<tr> <th class="left"><p class="bold">#{@translate.filename}</p></th><th class="left"><p class="bold">#{@translate.description}</p></th><th class="right"><p class="right"><b>#{@translate.file_size}</b></p><p class="tiny_right">(kB)</p></th></tr> +<tr> <th class="left"><p class="bold">#{@translate.description}</p></th><th class="left"><p class="bold">#{@translate.filename}</p></th><th class="right"><p class="right"><b>#{@translate.file_size}</b></p><p class="tiny_right">(kB)</p></th></tr>  WOK            output_tests | 
