diff options
Diffstat (limited to 'lib/sisu/v1')
-rw-r--r-- | lib/sisu/v1/css.rb | 7 | ||||
-rw-r--r-- | lib/sisu/v1/dal_images.rb | 27 | ||||
-rw-r--r-- | lib/sisu/v1/html.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v1/html_format.rb | 14 | ||||
-rw-r--r-- | lib/sisu/v1/manifest.rb | 12 | ||||
-rw-r--r-- | lib/sisu/v1/sysenv.rb | 1 |
6 files changed, 45 insertions, 18 deletions
diff --git a/lib/sisu/v1/css.rb b/lib/sisu/v1/css.rb index 3f2733b1..ced72d17 100644 --- a/lib/sisu/v1/css.rb +++ b/lib/sisu/v1/css.rb @@ -998,6 +998,13 @@ WOK padding: 0; border-left: 13em solid #ffffff; padding-left: 1em; + padding-right: 1em; + } + div.scroll { + margin: 0; + padding: 0; + padding-left: 1em; + padding-right: 1em; } div.content:after { content:' '; diff --git a/lib/sisu/v1/dal_images.rb b/lib/sisu/v1/dal_images.rb index 621ac986..67893025 100644 --- a/lib/sisu/v1/dal_images.rb +++ b/lib/sisu/v1/dal_images.rb @@ -65,16 +65,21 @@ module SiSU_images data=@data tuned_file=[] @rmgk=false - if SiSU_Env::Info_settings.new.program?('rmagick'); @rmgk=SiSU_Env::Load.new('RMagick').prog - else tell=SiSU_Screen::Ansi.new(@md.cmd,'use of RMagick is not enabled in sisurc.yml') - tell.warn if @md.cmd =~/[vVM]/ + imagemagick_=SiSU_Env::Info_settings.new.program?('rmagick') + if imagemagick_ + @rmgk=SiSU_Env::Load.new('RMagick').prog + else + if @md.cmd =~/[vVM]/ + tell=SiSU_Screen::Ansi.new(@md.cmd,'use of RMagick is not enabled in sisurc.yml') + tell.warn + end end data.each do |para| para.strip! if para =~/#{Mx[:lnk_o]}\s*\S+\.(?:png|jpg|gif)(?:\s*|\s+.+)?#{Mx[:lnk_c]}(?:(?:https?|file|ftp):\S+|image)/ if para !~/#{Mx[:lnk_o]}\s*\S+\.(?:png|jpg|gif)\s+\d+x\d+\s+/ m=/#{Mx[:lnk_o]}\s*(\S+\.(?:png|jpg|gif))/ - if @rmgk + if imagemagick_ imgs=para.scan(m).flatten images=imgs.each do |image| dir=SiSU_Env::Info_env.new(@md.fns) @@ -84,8 +89,18 @@ module SiSU_images break if FileTest.exist?("#{image_path}/#{image}") end if FileTest.exist?("#{image_path}/#{image}") - img=Magick::ImageList.new("#{image_path}/#{image}") - img_col,img_row=img.columns,img.rows + if @rmgk + img=Magick::ImageList.new("#{image_path}/#{image}") + img_col,img_row=img.columns,img.rows + else + if @md.cmd =~/[vVM]/ + tell=SiSU_Screen::Ansi.new(@md.cmd,'RMagick not present, will attempt to use imagemagick (identify) directly') + tell.warn + end + imgsys=`identify #{image_path}/#{image}`.strip #system call + img_col,img_row=/(\d+)x(\d+)/m.match(imgsys)[1,2] + img_col,img_row=img_col.to_i,img_row.to_i + end if img_col > img_row #landscape if img_col> 640 #480 img_col=640 #480 diff --git a/lib/sisu/v1/html.rb b/lib/sisu/v1/html.rb index 39775832..6e92c473 100644 --- a/lib/sisu/v1/html.rb +++ b/lib/sisu/v1/html.rb @@ -655,7 +655,7 @@ WOK def publish scroll=[] hr='<center><hr width=90% /></center>' - scroll << @scr_toc << hr << @scr_body << @scr_endnotes << hr << @scr_metadata << @scr_owner_details << @scr_tails + scroll << @scr_toc << '<div class="scroll">' << hr << @scr_body << @scr_endnotes << hr << @scr_owner_details << '</div>' << @scr_tails scroll.flatten!.compact! end end diff --git a/lib/sisu/v1/html_format.rb b/lib/sisu/v1/html_format.rb index eb29f9f9..0ceb1a8b 100644 --- a/lib/sisu/v1/html_format.rb +++ b/lib/sisu/v1/html_format.rb @@ -282,10 +282,10 @@ WOK <tr><td width="20%"> #{@vz.banner_band} </td> -<td width="60%" align="center"> +<td width="75%" align="center"> #@tocband_segtoc </td> -<td width="20%" align="right"> +<td width="5%" align="right"> #{firstseg} #{@vz.table_close} <p />} @@ -301,10 +301,10 @@ WOK <tr><td width="20%"> </td> -<td width="60%" align="center"> +<td width="75%" align="center"> #@tocband_segtoc </td> -<td width="20%" align="right"> +<td width="5%" align="right"> #{firstseg} #{@vz.table_close} <p />} @@ -842,10 +842,10 @@ WOK <td width="20%" align="left"> #{@vz.banner_band} </td> -<td width="60%" align="center"> +<td width="75%" align="center"> #{doc_types} </td> -<td width="20%" align="right"> +<td width="5%" align="right"> #{segtocband} </td></tr> </table> @@ -858,7 +858,7 @@ WOK <td width="70%" align="center"> #{doc_types} </td> - <td width="30%" align="right"> + <td width="5%" align="right"> #{segtocband} </td></tr> </table> diff --git a/lib/sisu/v1/manifest.rb b/lib/sisu/v1/manifest.rb index 73f3bd18..0d289b56 100644 --- a/lib/sisu/v1/manifest.rb +++ b/lib/sisu/v1/manifest.rb @@ -189,6 +189,14 @@ module SiSU_Manifest id,file='HTML, full length document',@md.fn[:doc] summarize(id,file,img) end + if FileTest.file?("#@base_path/#{@md.fn[:book_index]}")==true + id,file='HTML, index',@md.fn[:book_index] + summarize(id,file) + end + if FileTest.file?("#@base_path/#{@md.fn[:concordance]}")==true + id,file='HTML, concordance file',@md.fn[:concordance] + summarize(id,file) + end if FileTest.file?("#@base_path/#{@md.fn[:pdf_p_letter]}")==true img='<img border="0" height="18" width="15" src="../_sisu/image_sys/b_pdf.png" alt="PDF portrait" /> ' id,file="PDF, U.S. letter size, portrait/vertical document (recommended for printing)",@md.fn[:pdf_p_letter] @@ -265,10 +273,6 @@ module SiSU_Manifest end summarize(id,file) end - if FileTest.file?("#@base_path/#{@md.fn[:concordance]}")==true - id,file='Concordance file (HTML - wordmap, alphabetical wordlist)',@md.fn[:concordance] - summarize(id,file) - end if FileTest.file?("#@base_path/#{@md.fns}.tex")==true id,file='LaTeX (portrait)',"#{@md.fns}.tex" summarize(id,file) diff --git a/lib/sisu/v1/sysenv.rb b/lib/sisu/v1/sysenv.rb index 17f0b6be..c3c2a0ee 100644 --- a/lib/sisu/v1/sysenv.rb +++ b/lib/sisu/v1/sysenv.rb @@ -483,6 +483,7 @@ module SiSU_Env def lang(code) @fn={ :html => filename(code,'','.html'), + :book_index => filename(code,'idx','.html'), :concordance => filename(code,'concordance','.html'), :sax => filename(code,'sax','.xml'), :dom => filename(code,'dom','.xml'), |