8 @index_file = 'index.html'
24 def index_file=(value)
32 return '<a href="' + data[0] + '">' + data[1] + '</a>'
35 def output_dir=(value)
51 def write_books(fd, book_ids)
53 book = @store.load_book(id)
57 #(path, mimeType) = book.cover.write_image(@output_dir, 'image' + @imageCount.to_s)
58 #image = '<img class="cover-thumb" src="' + path + '"/>'
59 path = book.cover.path
60 image = '<img class="cover-thumb" src="' + path + '"/>'
62 image = '(No cover image)'
65 fd.puts ' <div><table>'
66 fd.puts ' <tr><td><a href="' + book.path + '">' + image + '</a></td>'
68 heading = book.heading()
69 description = book.description()
71 fd.puts ' <td><span class="popup">' + heading + '<span class="pop-inner"><p>' + heading + '</p><p>' + description + '</p></span></span></td></tr>'
73 fd.puts ' <td>' + heading + '</td></tr>'
76 fd.puts ' </table></div>'
81 fd.puts ' <p class="navigator">' + navig_link(@back) + ' ' + navig_link(@up) + ' ' + navig_link(@forward) + '</p>'
85 fd.puts ' <h1 class="header">' + @title + '</h1>'
87 fd.puts ' <p class="navigator">' + navig_link(@back) + ' ' + navig_link(@up) + ' ' + navig_link(@forward) + '</p>'
90 def write_html(book_ids)
93 if ! Dir.exist?(@output_dir)
94 Dir.mkdir(@output_dir)
97 open(@output_dir + '/' + @index_file, 'w') do |fd|
100 fd.puts ' <meta charset="utf-8"/>'
101 fd.puts ' <title>' + @title + '</title>'
103 write_style_sheet(fd)
111 write_books(fd, book_ids)
120 def write_special(fd)
126 def write_style_sheet(fd)
131 display: inline-block;
134 border 3px solid #73ad21;
141 img.cover-thumb { max-height: 200px; max-width: 200px; }
144 span.popup:hover { text-decoration: none; background: #cfffff; z-index: 6; }
145 span.popup span.pop-inner {
151 padding: 3px 3px 3px 3px;
154 span.popup:hover span.pop-inner {
157 margin: 20px 0 0 0px;