X-Git-Url: http://jaekl.net/gitweb/?p=quanlib.git;a=blobdiff_plain;f=navigator.rb;h=70c13e3be04510efe22695192643538677293831;hp=16da65269054c1ab40c7ef9eac98fa71e0585671;hb=HEAD;hpb=fcaeedd4d1c128ff84371c0a7db5d0af6751492a diff --git a/navigator.rb b/navigator.rb index 16da652..881b1fa 100644 --- a/navigator.rb +++ b/navigator.rb @@ -1,5 +1,5 @@ -require 'page' -require 'store' +require_relative 'page' +require_relative 'store' class Navigator def initialize(store) @@ -13,10 +13,11 @@ class Navigator atoz_counts[letter] = write_authors_starting_with(letter) end - content = '' + content = '

AuthorBooks
' ('A'..'Z').each do |letter| content += ' ' end + content += '
AuthorBooks
Starting with ' + letter + '' + atoz_counts[letter].to_s + '

' page = Page.new(@store) page.output_dir = 'atoz' page.special = content @@ -45,6 +46,20 @@ class Navigator 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 = []