<< | Index | >>
Goal/Estimate/Evaluation:
Task
Review
masa@masa ~/ywesee/ebps $ ruby1.9 -I lib bin/emediat_de_firefox config="emediat_de_firefox.yml"
Result
Experiment
def format_linked_paragraph(paragraph, xml) xml.td do xml.a 'href' => paragraph.url do format paragraph end end end
def format_table table @builder.table 'class' => 'ebps' do |xml| xml.tbody do table.each_normalized do |row| xml.tr do row.each do |cell| #xml.td do format cell end if cell.is_a? EBPS::Text::Picture format_picture(cell, xml)elsif cell.is_a? EBPS::Text::LinkedParagraph
format_linked_paragraph(cell, xml)
else xml.td do format cell end end end end end end end end
def end_monid dir = File.join(EBPS.config.component_dir, @current_target.to_s) file_list = Dir.glob(File.join(dir, "*.jpg")).to_a.sort @current_target = Text::Table.new file_list.each_with_index do |file, i| @current_target.next_row! if i > 0 # picture (right) picture = Text::Picture.new picture << File.read(file) #@current_target.rows.last << picture @current_target.rows[i][0] = picture # picture name (left) @current_target.next_cell! filename = File.basename(file).gsub(/\.jpg/,).gsub(/^\d+_/,) pic_number = if match = File.basename(file).match(/^(\d+)_/) match[1] end url = "https://pictures.e-mediat.net/WV_GetPictures/#{pic_number}_PIF_F.jpg"link = Text::LinkedParagraph.new(url, filename)
@current_target.rows[i][1] = link
#@current_target << filename end @current_chapter.add_paragraph(@current_target) @current_target = nil @current_chapter = nil end
Result
Next
Experiment
.ebps { display: block; text-indent: 0; } h3 { font-size: larger; } h4 { font-weight: normal; font-style: italic; } table.ebps { border-collapse: collapse; } /* table.ebps td { border: 1px solid #999; } */
#stylesheet: /var/ebps/data/css/oddb.css stylesheet: /var/ebps/data/css/emediat.css
Result
Note
Question
wget automatically backup an existing file with incremental number
Note
Experiment
preprocess: copy: targets: - - "ftp://ywesee:xxx@xxx/sample_DE.xml" - "/home/masa/work/hogehoge.xml"
Setup
Run
masa@masa ~/ywesee/ebps $ ruby1.9 -I lib bin/emediat_de_firefox config="emediat_de_firefox.yml"
Note
Result
Reference
Next
stop
Change the following 3 settings
Run
masa@masa ~/ywesee/ebps $ ruby1.9 -I lib bin/emediat_de_firefox config="etc/emediat_de_firefox.yml" masa@masa ~/ywesee/ebps $ ruby1.9 -I lib bin/emediat_de_stanza config="etc/emediat_de_stanza.yml" masa@masa ~/ywesee/ebps $ ruby1.9 -I lib bin/emediat_de_kindle config="etc/emediat_de_kindle.yml"
Result
Input file for conversion: /home/masa/ywesee/ebps/sample_DE.xml Errno::ENOENT: No such file or directory - /tmp/d20110923-5997-w8h0bt/mobipocket.azw /usr/lib64/ruby/1.9.1/fileutils.rb:1407:in `stat' /usr/lib64/ruby/1.9.1/fileutils.rb:1407:in `block in fu_each_src_dest' /usr/lib64/ruby/1.9.1/fileutils.rb:1423:in `fu_each_src_dest0' /usr/lib64/ruby/1.9.1/fileutils.rb:1405:in `fu_each_src_dest' /usr/lib64/ruby/1.9.1/fileutils.rb:391:in `cp' /home/masa/ywesee/ebps/lib/ebps/conversion/mobi_pocket.rb:17:in `compile_azw' /home/masa/ywesee/ebps/lib/ebps/conversion/mobi_pocket.rb:25:in `block in export' /home/masa/ywesee/ebps/lib/ebps/conversion/oebps.rb:489:in `block in export' /home/masa/ywesee/ebps/lib/ebps/conversion/oebps.rb:506:in `call' /home/masa/ywesee/ebps/lib/ebps/conversion/oebps.rb:506:in `with_tmpdir' /home/masa/ywesee/ebps/lib/ebps/conversion/oebps.rb:453:in `export' /home/masa/ywesee/ebps/lib/ebps/conversion/mobi_pocket.rb:24:in `export' bin/emediat_de_kindle:72:in `<main>'
Note
Install kindlegen
Run
masa@masa ~/ywesee/ebps $ ruby1.9 -I lib bin/emediat_de_kindle config="etc/emediat_de_kindle.yml"
Log
"kindlegen /tmp/d20110923-6753-dugxp2/ArzneimittelKompendium_der_Schweiz.opf -c2 -nomin -unicode -o mobipocket.azw" ************************************************** * Amazon.com kindlegen(Linux) V1.2 build 33307 * * A command line e-book compiler * * Copyright Amazon.com 2011 * ************************************************** option: -c2: Kindle Huffdic compression Error(kindlegen): Unsupported argument -nomin "No such file or directory - /tmp/d20110923-6753-dugxp2/mobipocket.azw" ["/usr/lib64/ruby/1.9.1/fileutils.rb:1407:in `stat'", "/usr/lib64/ruby/1.9.1/fileutils.rb:1407:in `block in fu_each_src_dest'", "/usr/lib64/ruby/1.9.1/fileutils.rb:1423:in `fu_each_src_dest0'", "/usr/lib64/ruby/1.9.1/fileutils.rb:1405:in `fu_each_src_dest'", "/usr/lib64/ruby/1.9.1/fileutils.rb:391:in `cp'", "/home/masa/ywesee/ebps/lib/ebps/conversion/mobi_pocket.rb:18:in `compile_azw'", "/home/masa/ywesee/ebps/lib/ebps/conversion/mobi_pocket.rb:30:in `block in export'", "/home/masa/ywesee/ebps/lib/ebps/conversion/oebps.rb:489:in `block in export'", "/home/masa/ywesee/ebps/lib/ebps/conversion/oebps.rb:506:in `call'", "/home/masa/ywesee/ebps/lib/ebps/conversion/oebps.rb:506:in `with_tmpdir'", "/home/masa/ywesee/ebps/lib/ebps/conversion/oebps.rb:453:in `export'", "/home/masa/ywesee/ebps/lib/ebps/conversion/mobi_pocket.rb:29:in `export'", "bin/emediat_de_kindle:72:in `<main>'"]
Copy kindlegen from the server
masa@masa ~/bin $ kindlegen *********************************************** * Amazon.com kindlegen(Linux) V1.0 build 85 * * A command line e-book compiler * * Copyright Amazon.com 2009 * ***********************************************
Note
Run
masa@masa ~/ywesee/ebps $ ruby1.9 -I lib bin/emediat_de_kindle config="etc/emediat_de_kindle.yml"
Log
"kindlegen /tmp/d20110923-6850-1ckcvnt/ArzneimittelKompendium_der_Schweiz.opf -c2 -nomin -unicode -o mobipocket.azw" *********************************************** * Amazon.com kindlegen(Linux) V1.0 build 85 * * A command line e-book compiler * * Copyright Amazon.com 2009 * *********************************************** opt compression: Kindle Huffdic compression opt version: not minimizing opt unicode: forces UTF8 output opt -o: output file name Info(prcgen): Added metadata dc:Title "Arzneimittel-Kompendium der Schweiz" Info(prcgen): Added metadata dc:Date "2011-09-23" Info(prcgen): Added metadata dc:Creator "Documed" Info(prcgen): Parsing files 0000005 Info(prcgen): Resolving hyperlinks Info(prcgen): Building table of content URL: /tmp/d20110923-6850-1ckcvnt/toc.ncx Warning(prcgen): Cover is too small : /tmp/d20110923-6850-1ckcvnt/TitelseiteD.jpg Info(prcgen): Computing UNICODE ranges used in the book Info(prcgen): Found UNICODE range: Basic Latin [20..7E] Info(prcgen): Found UNICODE range: Latin-1 Supplement [A0..FF] Info(prcgen): Found UNICODE range: General Punctuation - Windows 1252 [2013..2014] Info(prcgen): Found UNICODE range: Mathematical Operators [2200..22FF] Info(prcgen): Found UNICODE range: Basic Greek [370..3FF] Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000001 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000002 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000004 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000008 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000016 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000032 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000064 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000128 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000256 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000512 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0001024 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0002048 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0002860 Info(prcgen/compress): Compression pass 0000001 Info(prcgen/compress): Compression pass 0000002 Info(prcgen/compress): Compression pass 0000003 Info(prcgen/compress): Text compressed to (in % of original size): 038.33% Info(prcgen/compress): Compression dictionary statistics: 000027352 bytes 000001603 entries Info(prcgen/compress): Compression pass 0000004 Info(prcgen/compress): Text compressed to (in % of original size): 036.64% Info(prcgen/compress): Compression dictionary statistics: 000023410 bytes 000001270 entries Info(prcgen/compress): Compression pass 0000005 Info(prcgen/compress): Text compressed to (in % of original size): 036.17% Info(prcgen/compress): Compression dictionary statistics: 000021842 bytes 000001030 entries Info(prcgen/compress): Compression pass 0000006 Info(prcgen/compress): Text compressed to (in % of original size): 034.04% Info(prcgen/compress): Compression dictionary statistics: 000018754 bytes 000000838 entries Info(prcgen/compress): Compression pass 0000007 Info(prcgen/compress): Text compressed to (in % of original size): 034.45% Info(prcgen/compress): Compression dictionary statistics: 000017946 bytes 000000685 entries Info(prcgen/compress): Advanced compression successful (decoded and verified). Info(prcgen): Final stats - text compressed to (in % of original size): 034.45% Info(prcgen): The document identifier is: "Arzneimittel-um_der_Schweiz" Info(prcgen): The file format version is V7 Info(prcgen): Saving MOBI file Info(prcgen): MOBI File generated with WARNINGS!
Result
Note
Result
Rspec
masa@masa ~/ywesee/ebps $ rspec spec/suite.rb ... 52 examples, 17 failures
Note
Run
masa@masa ~/ywesee/ebps $ ruby1.9 /usr/bin/rspec -c -fs spec/suite.rb ... 52 examples, 0 failures
Rcov
masa@masa ~/ywesee/ebps $ ruby1.9 -rrspec /usr/bin/rcov spec/suite.rb
Note
Next
Updates
Run
masa@masa ~/ywesee/ebps $ rspec /usr/bin/rcov spec/conversion/fachinfo_xml_spec.rb
Note
Next
Note