projects
/
quanlib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adds support for tracking series and generating pages based on them.
[quanlib.git]
/
page.rb
diff --git
a/page.rb
b/page.rb
index 2e5d73524c3fd9d0689b29576b93ab6560bd19b9..1d83add369433cc331c3f1e8ed8099d4d22738c3 100644
(file)
--- a/
page.rb
+++ b/
page.rb
@@
-5,6
+5,7
@@
class Page
def initialize(store)
@back = nil
@forward = nil
def initialize(store)
@back = nil
@forward = nil
+ @index_file = 'index.html'
@output_dir = 'output'
@special = nil
@store = store
@output_dir = 'output'
@special = nil
@store = store
@@
-20,6
+21,10
@@
class Page
@forward = value
end
@forward = value
end
+ def index_file=(value)
+ @index_file = value
+ end
+
def navig_link(data)
if (nil == data)
return ''
def navig_link(data)
if (nil == data)
return ''
@@
-48,8
+53,10
@@
class Page
book = @store.load_book(id)
image = nil
if nil != book.cover
book = @store.load_book(id)
image = nil
if nil != book.cover
- @imageCount += 1
- (path, mimeType) = book.cover.write_image(@output_dir, 'image' + @imageCount.to_s)
+ #@imageCount += 1
+ #(path, mimeType) = book.cover.write_image(@output_dir, 'image' + @imageCount.to_s)
+ #image = '<img class="cover-thumb" src="' + path + '"/>'
+ path = book.cover.path
image = '<img class="cover-thumb" src="' + path + '"/>'
else
image = '(No cover image)'
image = '<img class="cover-thumb" src="' + path + '"/>'
else
image = '(No cover image)'
@@
-87,7
+94,7
@@
class Page
Dir.mkdir(@output_dir)
end
Dir.mkdir(@output_dir)
end
- open(@output_dir + '/
index.html'
, 'w') do |fd|
+ open(@output_dir + '/
' + @index_file
, 'w') do |fd|
fd.puts '<html>'
fd.puts ' <head>'
fd.puts ' <meta charset="utf-8"/>'
fd.puts '<html>'
fd.puts ' <head>'
fd.puts ' <meta charset="utf-8"/>'