Improve metadata extraction from epubs, and clean up the display of popups in the...
[quanlib.git] / main.rb
diff --git a/main.rb b/main.rb
index 8617ab0146577146d30e6ec73c21c7856ab03a1c..2d7f68b25c33c6bf45dbb0e909e17e3146f53e5b 100644 (file)
--- a/main.rb
+++ b/main.rb
@@ -26,6 +26,12 @@ open(outputDir + '/index.html', 'w') do |fd|
   fd.puts '  margin: 10px;'
   fd.puts '  border 3px solid #73ad21;'
   fd.puts '}'
+  fd.puts 'span.popup {  }'
+  fd.puts 'span.popup:hover {text-decoration: none; background: #cfffff; z-index: 6; }'
+  fd.puts 'span.popup span {display: none; position: absolute; '
+  fd.puts '  margin: 4px 0 0 0px; padding: 3px 3px 3px 3px;'
+  fd.puts '  border-style:solid; border-color:black; border-width:1px;}'
+  fd.puts 'span.popup:hover span {display: block; margin: 20px 0 0 0px; background: #ffffaf; z-index:6;}'
   fd.puts '    </style>'
   fd.puts '  </head>'
   fd.puts '  <body>'
@@ -41,7 +47,16 @@ open(outputDir + '/index.html', 'w') do |fd|
     end
 
     fd.puts '    <div><table>'
-    fd.puts '      <tr><td><a href="' + book.path + '">' + image + '</a></td><td>' + book.describe() + '</td></tr>'
+    fd.puts '      <tr><td><a href="' + book.path + '">' + image + '</a></td>'
+
+    heading = book.heading()
+    description = book.description()
+    if nil != description
+      fd.puts '          <td><span class="popup">' + heading + '<span><p>' + heading + '</p><p>' + description + '</p></span></span></td></tr>'
+    else
+      fd.puts '          <td>' + heading + '</td></tr>'
+    end
+      
     fd.puts '    </table></div>'
   end