11 puts 'Purging database...'
13 elsif arg.start_with?("--")
14 abort('ERROR: Unrecognized option "' + arg + '".')
28 if ! arg.start_with?("--")
29 puts 'Scanning directory "' + arg + '"...'
30 w = WalkDir.new(@store, arg)
35 puts 'Creating output...'
37 if ! Dir.exist?(outputDir)
41 open(outputDir + '/index.html', 'w') do |fd|
44 fd.puts ' <meta charset="utf-8"/>'
45 fd.puts ' <title>Books</title>'
48 fd.puts ' display: inline-block;'
49 fd.puts ' width: 400px;'
50 fd.puts ' margin: 10px;'
51 fd.puts ' border 3px solid #73ad21;'
53 fd.puts 'span.popup { }'
54 fd.puts 'span.popup:hover {text-decoration: none; background: #cfffff; z-index: 6; }'
55 fd.puts 'span.popup span {display: none; position: absolute; '
56 fd.puts ' margin: 4px 0 0 0px; padding: 3px 3px 3px 3px;'
57 fd.puts ' border-style:solid; border-color:black; border-width:1px;}'
58 fd.puts 'span.popup:hover span {display: block; margin: 20px 0 0 0px; background: #ffffaf; z-index:6;}'
67 (path, mimeType) = book.cover.write_image(outputDir, 'image' + imageCount.to_s)
68 image = '<img height="200px" src="' + path + '"/>'
70 image = '(No cover image)'
73 fd.puts ' <div><table>'
74 fd.puts ' <tr><td><a href="' + book.path + '">' + image + '</a></td>'
76 heading = book.heading()
77 description = book.description()
79 fd.puts ' <td><span class="popup">' + heading + '<span><p>' + heading + '</p><p>' + description + '</p></span></span></td></tr>'
81 fd.puts ' <td>' + heading + '</td></tr>'
84 fd.puts ' </table></div>'