require 'jsduck/logger' require 'jsduck/categories/file' require 'jsduck/categories/auto' require 'jsduck/categories/class_name' require 'jsduck/columns' module JsDuck module Categories # Reads in categories and outputs them as HTML div class Factory def self.create(filename, doc_formatter, relations) if filename categories = Categories::File.new(filename, relations) else categories = Categories::Auto.new(relations) end Categories::Factory.new(categories.generate, doc_formatter, relations) end def initialize(categories, doc_formatter, relations={}) @categories = categories @class_name = Categories::ClassName.new(doc_formatter, relations) @columns = Columns.new("classes") end # Returns HTML listing of classes divided into categories def to_html(style="") html = @categories.map do |category| [ "