-require 'page'
-require 'store'
+require_relative 'page'
+require_relative 'store'
class Navigator
def initialize(store)
atoz_counts[letter] = write_authors_starting_with(letter)
end
- content = '<table><tr><th>Author</th><th>Books</th></tr>'
+ content = '<p><table><tr><th>Author</th><th>Books</th></tr>'
('A'..'Z').each do |letter|
content += ' <tr><td><a href="../atoz/output_' + letter + '.html">Starting with ' + letter + '</a></td><td>' + atoz_counts[letter].to_s + '</td></tr>'
end
+ content += '</table></p>'
page = Page.new(@store)
page.output_dir = 'atoz'
page.special = content
return book_ids.length
end
+ def write_dewey
+ book_ids = @store.query_books_by_ddc()
+ puts 'Non-fiction books arranged by Dewey Decimal Classification: ' + book_ids.length.to_s() + ' books.'
+
+ page = Page.new(@store)
+ page.output_dir = 'ddc'
+ page.index_file = 'index.html'
+ page.title = "Non-fiction books arranged by Dewey Decimal call number"
+ page.up = ['../output/index.html', 'Up']
+
+ page.write_html(book_ids)
+ return book_ids.length
+ end
+
def write_series_for_age(age)
series_infos = []