diff options
Diffstat (limited to 'lib/sisu/v3/manifest.rb')
-rw-r--r-- | lib/sisu/v3/manifest.rb | 434 |
1 files changed, 247 insertions, 187 deletions
diff --git a/lib/sisu/v3/manifest.rb b/lib/sisu/v3/manifest.rb index 90f8df55..0c6d5460 100644 --- a/lib/sisu/v3/manifest.rb +++ b/lib/sisu/v3/manifest.rb @@ -67,6 +67,7 @@ module SiSU_Manifest include SiSU_HTML_Format require_relative 'param' # param.rb include SiSU_Param + require_relative 'i18n' # i18n.rb include SiSU_Viz class Source def initialize(opt) @@ -101,11 +102,11 @@ module SiSU_Manifest def initialize(md) @manifest={ txt: [], html: [] } @md,@fns=md,md.fns -# @file=SiSU_Env::SiSU_file.new(@md) @env=SiSU_Env::Info_env.new(@md.fns) @fnb=@md.fnb @base_url="#{@env.url.root}/#{@fnb}" - @base_path=@md.file.output_path.manifest.dir + @f=SiSU_Env::SiSU_file.new(@md) + @base_path=@f.output_path.manifest.dir @@dg ||=SiSU_Env::Info_env.new.digest.type @dg=@@dg l=SiSU_Env::Standardise_language.new(@md.opt.lng).language @@ -114,26 +115,26 @@ module SiSU_Manifest @brace_url=SiSU_Viz::Skin.new.url_decoration end def output - manifest=@md.file.write_file.manifest + manifest=@f.write_file.manifest @manifest[:html].each do |x| - x.gsub!(Xx[:html_relative2],@md.file.path_rel_links.html_scroll_2) - x.gsub!(Xx[:html_relative1],@md.file.path_rel_links.html_scroll_1) + x.gsub!(Xx[:html_relative2],@f.path_rel_links.html_scroll_2) + x.gsub!(Xx[:html_relative1],@f.path_rel_links.html_scroll_1) manifest << x end end - def summarize(id,file,pth='',url='',img='● ') + def summarize(id,file,pth='',rel='',url='',img='● ') size=(File.size("#{pth}/#{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="#{pth}/#{file}">#{img}#{id}</a></p></th><td><p class="small"><a href="#{pth}/#{file}">#{file}</a></p><p class="tiny">#{@brace_url.xml_open}<a href="#{url}/#{file}">#{url}/#{file}</a>#{@brace_url.xml_close}</p></td><td class="right"><p class="right">#{kb}</p></td></tr>\n} + @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{rel}/#{file}">#{img}#{id}</a></p></th><td><p class="small"><a href="#{rel}/#{file}">#{file}</a></p><p class="tiny">#{@brace_url.xml_open}<a href="#{url}/#{file}">#{url}/#{file}</a>#{@brace_url.xml_close}</p></td><td class="right"><p class="right">#{kb}</p></td></tr>\n} end - def summarize_html_seg(id,file,pth='',url='',img='● ') + def summarize_html_seg(id,file,pth='',rel='',url='',img='● ') size=(File.size("#{pth}/#{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="#{pth}/#{file}">#{img}#{id}</a></p></th><td><p class="small"><a href="#{pth}/#{file}">#{file}</a></p><p class="tiny">#{@brace_url.xml_open}<a href="#{url}/#{file}">#{url}/#{file}</a>#{@brace_url.xml_close}</p></td><td class="right"><p class="right">#{kb}</p></td></tr>\n} + @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{rel}/#{file}">#{img}#{id}</a></p></th><td><p class="small"><a href="#{rel}/#{file}">#{file}</a></p><p class="tiny">#{@brace_url.xml_open}<a href="#{url}/#{file}">#{url}/#{file}</a>#{@brace_url.xml_close}</p></td><td class="right"><p class="right">#{kb}</p></td></tr>\n} end - def summarize_sources(id,file,pth,url) + def summarize_sources(id,file,pth,rel,url) sys=SiSU_Env::System_call.new dgst =if @dg =~/^sha(?:2|256)$/; sys.sha256("#{pth}/#{file}") else sys.md5("#{pth}/#{file}") @@ -142,25 +143,62 @@ module SiSU_Manifest size=(File.size("#{pth}/#{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="#{pth}/#{file}">#{id}</a></p></th><td class="right"><p class="tiny"><a href="#{pth}/#{file}">#{file}</a> #{dgst[1]}<br />#{@brace_url.xml_open}<a href="#{url}/#{file}">#{url}/#{file}</a>#{@brace_url.xml_close}</p></td><td class="right"><p class="right">#{kb}</p> + @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{rel}/#{file}">#{id}</a></p></th><td class="right"><p class="tiny"><a href="#{rel}/#{file}">#{file}</a> #{dgst[1]}<br />#{@brace_url.xml_open}<a href="#{url}/#{file}">#{url}/#{file}</a>#{@brace_url.xml_close}</p></td><td class="right"><p class="right">#{kb}</p> </td></tr>\n} if kb and kb =~/\d+/ end + def published_manifests? + @f=SiSU_Env::SiSU_file.new(@md) #.base_filename + @m=[] + url=@f.output_path.base.url + manifests={} + mp,mn,mt,mr=nil,nil,nil,nil + ln=SiSU_i18n::Languages.new.list + Px[:lng_lst].each do |lc| + if @env.output_dir_structure.by_language_code? + mp="#{@f.output_path.base.dir}/#{lc}/manifest" + mn="#{@md.fnb}.html" + mt="#{mp}/#{mn}" + mr="../../#{lc}/manifest/#{mn}" + mu="#{url}/#{lc}/manifest/#{mn}" + elsif @env.output_dir_structure.by_filetype? + mp="#{@f.output_path.base.dir}/manifest" + mn="#{@md.fnb}.#{lc}.html" + mt="#{mp}/#{mn}" + mr=mn + mu="#{url}/manifest/#{mn}" + else + mp="#{@f.output_path.base.dir}/#{@md.fnb}" + mn="sisu_manifest.#{lc}.html" + mt="#{mp}/#{mn}" + mr=mn + mu="#{url}/#{mn}" + end + if FileTest.directory?(mp) \ + && FileTest.file?(mt) + lng=ln[lc][:t] + manifests[lc]={ ln: lng, fn: mn, rel: mr } + @m << { mu: mu, l: lng, rel: mr } + end + end + manifests + @m.uniq! + @m + end def languages(id,file) - flv=@env.published_manifests?(@base_path) + flv=published_manifests? @manifest[:html] << %{<tr><th class="left"><div id="horizontal_links"><ul id="horizontal">\n} flv.each do |l| lang=SiSU_Translate::Source.new(@md,@language,l[:n]).language_list - @manifest[:txt] << "#{l[:m]} #{lang}\n" - @manifest[:html] << %{<li class="norm"><a href="#{l[:m]}">#{lang}</a> </li>} + @manifest[:txt] << "#{l[:mu]} #{l[:l]}\n" + @manifest[:html] << %{<li class="norm"><a href="#{l[:rel]}">#{l[:l]}</a> </li>} end @manifest[:html] << %{</ul></div></th></tr>\n} end def published_languages(id,file) - flv=@env.published_manifests?(@base_path) + flv=published_manifests? flv.each do |l| - lang=SiSU_Translate::Source.new(@md,@language,l[:n]).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">#{@brace_url.xml_open}<a href="#{@base_url}/#{l[:m]}">#{@base_url}/#{l[:m]}</a>#{@brace_url.xml_close}</p></td><td class="right"><p class="right"> </p></td></tr>\n} + @manifest[:txt] << "#{l[:mu]} #{l[:l]}\n" + @manifest[:html] << %{<tr><th class="left"><p class="bold"><a href="#{l[:mu]}">#{l[:l]}</a></p></th><td><p class="norm">#{l[:l]}</p><p class="tiny">#{@brace_url.xml_open}<a href="#{l[:mu]}">#{l[:mu]}</a>#{@brace_url.xml_close}</p></td><td class="right"><p class="right"> </p></td></tr>\n} end end def metadata(id,info) @@ -175,173 +213,191 @@ module SiSU_Manifest @manifest[:html] << %{<tr><th class="right" width=5%><p class="norm">●</p></th><td class="left"><p class="norm"><a href="#{url}">#{lnk}</a></p><p class="tiny"> #{@brace_url.xml_open}<a href="#{static}">#{static}</a>#{@brace_url.xml_close}</p></td></tr>\n} end def output_tests - if FileTest.file?(@md.file.place_file.html_segtoc.dir)==true - img=%{<img border="0" height="18" width="15" src="#{@md.file.path_rel_links.html_scroll_2}_sisu/image_sys/b_toc.png" alt="TOC linked" /> } - pth=@md.file.output_path.html_seg.dir - url=@md.file.output_path.html_seg.url - id,file='HTML, table of contents (for segmented text)',@md.file.base_filename.html_segtoc - summarize_html_seg(id,file,pth,url,img) - end - if FileTest.file?(@md.file.place_file.html_scroll.dir)==true - img=%{<img border="0" height="15" width="15" src="#{@md.file.path_rel_links.html_scroll_2}_sisu/image_sys/b_doc.png" alt="Full Text" /> } - pth=@md.file.output_path.html_scroll.dir - url=@md.file.output_path.html_scroll.url - id,file='HTML, full length document',@md.file.base_filename.html_scroll - summarize(id,file,pth,url,img) - end - if FileTest.file?(@md.file.place_file.html_book_index.dir)==true - pth=@md.file.output_path.html_seg.dir - url=@md.file.output_path.html_seg.url - id,file='HTML, (book type) index',@md.file.base_filename.html_book_index - summarize(id,file,pth,url) - end - if FileTest.file?(@md.file.place_file.html_concordance.dir)==true - pth=@md.file.output_path.html_seg.dir - url=@md.file.output_path.html_seg.url - id,file='HTML, concordance file',@md.file.base_filename.html_concordance - summarize(id,file,pth,url) - end - if FileTest.file?(@md.file.place_file.epub.dir)==true - img=%{<img border="0" height="18" width="18" src="#{@md.file.path_rel_links.html_scroll_2}_sisu/image_sys/b_epub.png" alt="EPUB" /> } - id,file='EPUB (Electronic Publication, e-book standard)',@md.file.base_filename.epub - pth=@md.file.output_path.epub.dir - url=@md.file.output_path.epub.url - summarize(id,file,pth,url,img) - end - if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_p_letter}")==true - img=%{<img border="0" height="18" width="15" src="#{@md.file.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF portrait" /> } - pth=@md.file.output_path.pdf.dir - url=@md.file.output_path.pdf.url - id,file="PDF, U.S. letter size, portrait/vertical document (recommended for printing)","#{@md.file.base_filename.pdf_p_letter}" - summarize(id,file,pth,url,img) - end - if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_l_letter}")==true - img=%{<img border="0" height="15" width="18" src="#{@md.file.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF landscape" /> } - pth=@md.file.output_path.pdf.dir - url=@md.file.output_path.pdf.url - id,file="PDF, U.S. letter size, landscape/horizontal document (recommended for screen viewing)","#{@md.file.base_filename.pdf_l_letter}" - summarize(id,file,pth,url,img) - end - if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_p_a4}")==true - img=%{<img border="0" height="18" width="15" src="#{@md.file.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF portrait" /> } - pth=@md.file.output_path.pdf.dir - url=@md.file.output_path.pdf.url - id,file="PDF, A4 size, portrait/vertical document (recommended for printing)","#{@md.file.base_filename.pdf_p_a4}" - summarize(id,file,pth,url,img) - end - if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_l_a4}")==true - img=%{<img border="0" height="15" width="18" src="#{@md.file.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF landscape" /> } - pth=@md.file.output_path.pdf.dir - url=@md.file.output_path.pdf.url - id,file="PDF, A4 size, landscape/horizontal document (recommended for screen viewing)","#{@md.file.base_filename.pdf_l_a4}" - summarize(id,file,pth,url,img) - end - if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_p_a5}")==true - img=%{<img border="0" height="18" width="15" src="#{@md.file.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF portrait" /> } - pth=@md.file.output_path.pdf.dir - url=@md.file.output_path.pdf.url - id,file="PDF, A5 (book) size, portrait/vertical document (recommended for printing)","#{@md.file.base_filename.pdf_p_a5}" - summarize(id,file,pth,url,img) - end - if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_l_a5}")==true - img=%{<img border="0" height="15" width="18" src="#{@md.file.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF landscape" /> } - pth=@md.file.output_path.pdf.dir - url=@md.file.output_path.pdf.url - id,file="PDF, A5 (book) size, landscape/horizontal document (recommended for screen viewing)","#{@md.file.base_filename.pdf_l_a5}" - summarize(id,file,pth,url,img) - end - if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_p_b5}")==true - img=%{<img border="0" height="18" width="15" src="#{@md.file.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF portrait" /> } - pth=@md.file.output_path.pdf.dir - url=@md.file.output_path.pdf.url - id,file="PDF, B5 (book) size, portrait/vertical document (recommended for printing)","#{@md.file.base_filename.pdf_p_b5}" - summarize(id,file,pth,url,img) - end - if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_l_b5}")==true - img=%{<img border="0" height="15" width="18" src="#{@md.file.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF landscape" /> } - pth=@md.file.output_path.pdf.dir - url=@md.file.output_path.pdf.url - id,file="PDF, B5 (book) size, landscape/horizontal document (recommended for screen viewing)","#{@md.file.base_filename.pdf_l_b5}" - summarize(id,file,pth,url,img) - end - if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_p_legal}")==true - img=%{<img border="0" height="18" width="15" src="#{@md.file.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF portrait" /> } - pth=@md.file.output_path.pdf.dir - url=@md.file.output_path.pdf.url - id,file="PDF, U.S. legal size, portrait/vertical document (recommended for printing)","#{@md.file.base_filename.pdf_p_legal}" - summarize(id,file,pth,url,img) - end - if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_l_legal}")==true - img=%{<img border="0" height="15" width="18" src="#{@md.file.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF landscape" /> } - pth=@md.file.output_path.pdf.dir - url=@md.file.output_path.pdf.url - id,file="PDF, U.S. legal size, landscape/horizontal document (recommended for screen viewing)","#{@md.file.base_filename.pdf_l_legal}" - summarize(id,file,pth,url,img) - end - if FileTest.file?(@md.file.place_file.odt.dir)==true - img=%{<img border="0" height="18" width="18" src="#{@md.file.path_rel_links.html_scroll_2}_sisu/image_sys/b_odf.png" alt="ODF/ODT" /> } - pth=@md.file.output_path.odt.dir - url=@md.file.output_path.odf.url - id,file='ODF:ODT (Open Document Format)',@md.file.base_filename.odt - summarize(id,file,pth,url,img) - end - if FileTest.file?(@md.file.place_file.xhtml.dir)==true - pth=@md.file.output_path.xhtml.dir - url=@md.file.output_path.xhtml.url - id,file='ODF:ODT (Open Document Format)',@md.file.base_filename.odt - id,file='XHTML',@md.file.base_filename.xhtml - summarize(id,file,pth,url) - end - if FileTest.file?(@md.file.place_file.xml_sax.dir)==true - pth=@md.file.output_path.xml_sax.dir - url=@md.file.output_path.xml_sax.url - id,file='XML SAX',@md.file.base_filename.xml_sax - summarize(id,file,pth,url) - end - if FileTest.file?(@md.file.place_file.xml_dom.dir)==true - pth=@md.file.output_path.xml_dom.dir - url=@md.file.output_path.xml_dom.url - id,file='XML DOM',@md.file.base_filename.xml_dom - summarize(id,file,pth,url) - end - if FileTest.file?(@md.file.place_file.txt.dir)==true + if FileTest.file?(@f.place_file.html_segtoc.dir)==true + img=%{<img border="0" height="18" width="15" src="#{@f.path_rel_links.html_scroll_2}_sisu/image_sys/b_toc.png" alt="TOC linked" /> } + pth=@f.output_path.html_seg.dir + rel=@f.output_path.html_seg.rel_sm + url=@f.output_path.html_seg.url + id,file='HTML, table of contents (for segmented text)',@f.base_filename.html_segtoc + summarize_html_seg(id,file,pth,rel,url,img) + end + if FileTest.file?(@f.place_file.html_scroll.dir)==true + img=%{<img border="0" height="15" width="15" src="#{@f.path_rel_links.html_scroll_2}_sisu/image_sys/b_doc.png" alt="Full Text" /> } + pth=@f.output_path.html_scroll.dir + rel=@f.output_path.html_scroll.rel_sm + url=@f.output_path.html_scroll.url + id,file='HTML, full length document',@f.base_filename.html_scroll + summarize(id,file,pth,rel,url,img) + end + if FileTest.file?(@f.place_file.html_book_index.dir)==true + pth=@f.output_path.html_seg.dir + rel=@f.output_path.html_seg.rel_sm + url=@f.output_path.html_seg.url + id,file='HTML, (book type) index',@f.base_filename.html_book_index + summarize(id,file,pth,rel,url) + end + if FileTest.file?(@f.place_file.html_concordance.dir)==true + pth=@f.output_path.html_seg.dir + rel=@f.output_path.html_seg.rel_sm + url=@f.output_path.html_seg.url + id,file='HTML, concordance file',@f.base_filename.html_concordance + summarize(id,file,pth,rel,url) + end + if FileTest.file?(@f.place_file.epub.dir)==true + img=%{<img border="0" height="18" width="18" src="#{@f.path_rel_links.html_scroll_2}_sisu/image_sys/b_epub.png" alt="EPUB" /> } + id,file='EPUB (Electronic Publication, e-book standard)',@f.base_filename.epub + pth=@f.output_path.epub.dir + rel=@f.output_path.epub.rel_sm + url=@f.output_path.epub.url + summarize(id,file,pth,rel,url,img) + end + if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_p_letter}")==true + img=%{<img border="0" height="18" width="15" src="#{@f.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF portrait" /> } + pth=@f.output_path.pdf.dir + rel=@f.output_path.pdf.rel_sm + url=@f.output_path.pdf.url + id,file="PDF, U.S. letter size, portrait/vertical document (recommended for printing)","#{@f.base_filename.pdf_p_letter}" + summarize(id,file,pth,rel,url,img) + end + if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_l_letter}")==true + img=%{<img border="0" height="15" width="18" src="#{@f.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF landscape" /> } + pth=@f.output_path.pdf.dir + rel=@f.output_path.pdf.rel_sm + url=@f.output_path.pdf.url + id,file="PDF, U.S. letter size, landscape/horizontal document (recommended for screen viewing)","#{@f.base_filename.pdf_l_letter}" + summarize(id,file,pth,rel,url,img) + end + if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_p_a4}")==true + img=%{<img border="0" height="18" width="15" src="#{@f.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF portrait" /> } + pth=@f.output_path.pdf.dir + rel=@f.output_path.pdf.rel_sm + url=@f.output_path.pdf.url + id,file="PDF, A4 size, portrait/vertical document (recommended for printing)","#{@f.base_filename.pdf_p_a4}" + summarize(id,file,pth,rel,url,img) + end + if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_l_a4}")==true + img=%{<img border="0" height="15" width="18" src="#{@f.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF landscape" /> } + pth=@f.output_path.pdf.dir + rel=@f.output_path.pdf.rel_sm + url=@f.output_path.pdf.url + id,file="PDF, A4 size, landscape/horizontal document (recommended for screen viewing)","#{@f.base_filename.pdf_l_a4}" + summarize(id,file,pth,rel,url,img) + end + if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_p_a5}")==true + img=%{<img border="0" height="18" width="15" src="#{@f.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF portrait" /> } + pth=@f.output_path.pdf.dir + rel=@f.output_path.pdf.rel_sm + url=@f.output_path.pdf.url + id,file="PDF, A5 (book) size, portrait/vertical document (recommended for printing)","#{@f.base_filename.pdf_p_a5}" + summarize(id,file,pth,rel,url,img) + end + if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_l_a5}")==true + img=%{<img border="0" height="15" width="18" src="#{@f.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF landscape" /> } + pth=@f.output_path.pdf.dir + rel=@f.output_path.pdf.rel_sm + url=@f.output_path.pdf.url + id,file="PDF, A5 (book) size, landscape/horizontal document (recommended for screen viewing)","#{@f.base_filename.pdf_l_a5}" + summarize(id,file,pth,rel,url,img) + end + if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_p_b5}")==true + img=%{<img border="0" height="18" width="15" src="#{@f.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF portrait" /> } + pth=@f.output_path.pdf.dir + rel=@f.output_path.pdf.rel_sm + url=@f.output_path.pdf.url + id,file="PDF, B5 (book) size, portrait/vertical document (recommended for printing)","#{@f.base_filename.pdf_p_b5}" + summarize(id,file,pth,rel,url,img) + end + if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_l_b5}")==true + img=%{<img border="0" height="15" width="18" src="#{@f.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF landscape" /> } + pth=@f.output_path.pdf.dir + rel=@f.output_path.pdf.rel_sm + url=@f.output_path.pdf.url + id,file="PDF, B5 (book) size, landscape/horizontal document (recommended for screen viewing)","#{@f.base_filename.pdf_l_b5}" + summarize(id,file,pth,rel,url,img) + end + if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_p_legal}")==true + img=%{<img border="0" height="18" width="15" src="#{@f.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF portrait" /> } + pth=@f.output_path.pdf.dir + rel=@f.output_path.pdf.rel_sm + url=@f.output_path.pdf.url + id,file="PDF, U.S. legal size, portrait/vertical document (recommended for printing)","#{@f.base_filename.pdf_p_legal}" + summarize(id,file,pth,rel,url,img) + end + if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_l_legal}")==true + img=%{<img border="0" height="15" width="18" src="#{@f.path_rel_links.html_scroll_2}_sisu/image_sys/b_pdf.png" alt="PDF landscape" /> } + pth=@f.output_path.pdf.dir + rel=@f.output_path.pdf.rel_sm + url=@f.output_path.pdf.url + id,file="PDF, U.S. legal size, landscape/horizontal document (recommended for screen viewing)","#{@f.base_filename.pdf_l_legal}" + summarize(id,file,pth,rel,url,img) + end + if FileTest.file?(@f.place_file.odt.dir)==true + img=%{<img border="0" height="18" width="18" src="#{@f.path_rel_links.html_scroll_2}_sisu/image_sys/b_odf.png" alt="ODF/ODT" /> } + pth=@f.output_path.odt.dir + rel=@f.output_path.odt.rel_sm + url=@f.output_path.odf.url + id,file='ODF:ODT (Open Document Format)',@f.base_filename.odt + summarize(id,file,pth,rel,url,img) + end + if FileTest.file?(@f.place_file.xhtml.dir)==true + pth=@f.output_path.xhtml.dir + rel=@f.output_path.xhtml.rel_sm + url=@f.output_path.xhtml.url + id,file='ODF:ODT (Open Document Format)',@f.base_filename.odt + id,file='XHTML',@f.base_filename.xhtml + summarize(id,file,pth,rel,url) + end + if FileTest.file?(@f.place_file.xml_sax.dir)==true + pth=@f.output_path.xml_sax.dir + rel=@f.output_path.xml_sax.rel_sm + url=@f.output_path.xml_sax.url + id,file='XML SAX',@f.base_filename.xml_sax + summarize(id,file,pth,rel,url) + end + if FileTest.file?(@f.place_file.xml_dom.dir)==true + pth=@f.output_path.xml_dom.dir + rel=@f.output_path.xml_dom.rel_sm + url=@f.output_path.xml_dom.url + id,file='XML DOM',@f.base_filename.xml_dom + summarize(id,file,pth,rel,url) + end + if FileTest.file?(@f.place_file.txt.dir)==true if @md.opt.cmd =~/a/; id='Plaintext (Unix (UTF-8) with footnotes)' elsif @md.opt.cmd =~/e/; id='Plaintext (Unix (UTF-8) with endnotes)' elsif @md.opt.cmd =~/A/; id='Plaintext (dos (UTF-8) with footnotes)' elsif @md.opt.cmd =~/E/; id='Plaintext (dos (UTF-8) with endnotes)' else id='Plaintext (UTF-8)' end - pth=@md.file.output_path.txt.dir - url=@md.file.output_path.txt.url - file=@md.file.base_filename.txt - summarize(id,file,pth,url) + pth=@f.output_path.txt.dir + rel=@f.output_path.txt.rel_sm + url=@f.output_path.txt.url + file=@f.base_filename.txt + summarize(id,file,pth,rel,url) end if FileTest.file?("#{@base_path}/#{@md.fns}.tex")==true id,file='LaTeX (portrait)',"#{@md.fns}.tex" - pth,url='','' - summarize(id,file,pth,url) + pth,rel,url='','','' + summarize(id,file,pth,rel,url) end if FileTest.file?("#{@base_path}/#{@md.fns}.tex")==true id,file='LaTeX (landscape)',"#{@md.fns}.landscape.tex" - pth,url='','' - summarize(id,file,pth,url) + pth,rel,url='','','' + summarize(id,file,pth,rel,url) end if FileTest.file?("#{@base_path}/#{@md.fn[:digest]}")==true id,file="Digest/DCC - Document Content Certificate (#{@dg})",@md.fn[:digest] pth=@base_path - url='' + rel,url='','' #pth='' - summarize(id,file,pth,url) + summarize(id,file,pth,rel,url) end end def published_versions - if FileTest.file?("#{@base_path}/sisu_manifest.html")==true - id,file='Markup (SiSU source)',@md.fns - languages(id,file) - end + id,file='Markup (SiSU source)',@md.fns + languages(id,file) end def language_versions - if FileTest.file?(@md.file.place_file.manifest.dir)==true + if FileTest.file?(@f.place_file.manifest.dir)==true id,file='Markup (SiSU source)',@md.fns published_languages(id,file) end @@ -349,31 +405,35 @@ module SiSU_Manifest def source_tests if @md.fns =~/\.ssm\.sst$/ #% decide whether to extract and include requested/required documents req=@md.fns - if FileTest.file?(@md.file.place_file.src.dir)==true - pth=@md.file.output_path.src.dir - url=@md.file.output_path.src.url - id,file='Markup Composite File (SiSU source)',@md.file.base_filename.src - summarize_sources(id,file,pth,url) + if FileTest.file?(@f.place_file.src.dir)==true + pth=@f.output_path.src.dir + rel=@f.output_path.src.rel_sm + url=@f.output_path.src.url + id,file='Markup Composite File (SiSU source)',@f.base_filename.src + summarize_sources(id,file,pth,rel,url) end else - if FileTest.file?(@md.file.place_file.src.dir)==true - pth=@md.file.output_path.src.dir - url=@md.file.output_path.src.url - id,file='Markup (SiSU source)',@md.file.base_filename.src - summarize_sources(id,file,pth,url) + if FileTest.file?(@f.place_file.src.dir)==true + pth=@f.output_path.src.dir + rel=@f.output_path.src.rel_sm + url=@f.output_path.src.url + id,file='Markup (SiSU source)',@f.base_filename.src + summarize_sources(id,file,pth,rel,url) end end - if FileTest.file?(@md.file.place_file.sisupod.dir)==true - pth=@md.file.output_path.sisupod.dir - url=@md.file.output_path.sisupod.url - id,file='SiSU doc (zip)',@md.file.base_filename.sisupod - summarize_sources(id,file,pth,url) + if FileTest.file?(@f.place_file.sisupod.dir)==true + pth=@f.output_path.sisupod.dir + rel=@f.output_path.sisupod.rel_sm + url=@f.output_path.sisupod.url + id,file='SiSU doc (zip)',@f.base_filename.sisupod + summarize_sources(id,file,pth,rel,url) end - if FileTest.file?(@md.file.place_file.pot.dir)==true - pth=@md.file.output_path.pot.dir - url=@md.file.output_path.pot.url - id,file='SiSU pot',@md.file.base_filename.pot - summarize_sources(id,file,pth,url) + if FileTest.file?(@f.place_file.pot.dir)==true + pth=@f.output_path.pot.dir + rel=@f.output_path.pot.rel_sm + url=@f.output_path.pot.url + id,file='SiSU pot',@f.base_filename.pot + summarize_sources(id,file,pth,rel,url) end end def metadata_tests @@ -659,8 +719,8 @@ SiSU manifest: #{@md.title.full} <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta name="sourcefile" content="#{@md.fns}" /> <link rel="generator" href="http://www.jus.uio.no/sisu" /> -<link rel="shortcut icon" href="#{@md.file.path_rel_links.html_scroll_css}_sisu/image_sys/rb7.ico" /> -<link rel="stylesheet" href="#{@md.file.path_rel_links.html_scroll_css}_sisu/css/html.css" type="text/css" /> +<link rel="shortcut icon" href="#{@f.path_rel_links.html_scroll_css}_sisu/image_sys/rb7.ico" /> +<link rel="stylesheet" href="#{@f.path_rel_links.html_scroll_css}_sisu/css/html.css" type="text/css" /> </head> <body bgcolor="#ffffff" text="#000000" link="#003090" lang="en" xml:lang="en"> #{banner_table} @@ -669,8 +729,8 @@ WOK if @env.output_dir_structure.by_language_code? \ or @env.output_dir_structure.by_filetype? minitoc.gsub!(/<a href="(\S+?)"/m,%{<a href="../html/#{@md.fnb}/\\1"}) - minitoc.gsub!(/<a href="\.\.\/html\/#{@md.fnb}\/(?:sisu_manifest\.html|#{@md.file.base_filename.manifest})"/m, - %{<a href="#{@md.file.base_filename.manifest}"}) + minitoc.gsub!(/<a href="\.\.\/html\/#{@md.fnb}\/(?:sisu_manifest\.html|#{@f.base_filename.manifest})"/m, + %{<a href="#{@f.base_filename.manifest}"}) end @manifest[:html] <<<<WOK <div class="toc"> |