Loading lib/jsduck/app.rb +2 −1 Original line number Diff line number Diff line Loading @@ -80,10 +80,11 @@ module JsDuck # Writes documentation page for each class def write_pages(path, docs) subclasses = Subclasses.new(docs) cache = {} docs.each do |cls| filename = path + "/" + cls[:name] + ".html" puts "Writing to #{filename} ..." if @verbose html = Page.new(cls, subclasses).to_html html = Page.new(cls, subclasses, cache).to_html File.open(filename, 'w') {|f| f.write(html) } end end Loading lib/jsduck/cfg_table.rb +2 −2 Original line number Diff line number Diff line Loading @@ -3,8 +3,8 @@ require 'jsduck/table' module JsDuck class CfgTable < Table def initialize(cls) super(cls) def initialize(cls, cache={}) super(cls, cache) @type = :cfg @id = @cls.full_name + "-configs" @title = "Config Options" Loading lib/jsduck/event_table.rb +2 −2 Original line number Diff line number Diff line Loading @@ -5,8 +5,8 @@ require 'jsduck/long_params' module JsDuck class EventTable < Table def initialize(cls) super(cls) def initialize(cls, cache={}) super(cls, cache) @type = :event @id = @cls.full_name + "-events" @title = "Public Events" Loading lib/jsduck/method_table.rb +2 −2 Original line number Diff line number Diff line Loading @@ -5,8 +5,8 @@ require 'jsduck/long_params' module JsDuck class MethodTable < Table def initialize(cls) super(cls) def initialize(cls, cache={}) super(cls, cache) @type = :method @id = @cls.full_name + "-methods" @title = "Public Methods" Loading lib/jsduck/page.rb +12 −5 Original line number Diff line number Diff line Loading @@ -9,9 +9,16 @@ module JsDuck # Creates HTML documentation page for one class. class Page def initialize(cls, subclasses = {}) # Initializes doc page generator # # - cls : the Class object for which to generate documentation # - subclasses : lookup table for easy access to subclasses # - cache : cache for already generated HTML rows for class members # def initialize(cls, subclasses = {}, cache = {}) @cls = cls @subclasses = subclasses @cache = cache @formatter = DocFormatter.new(cls.full_name) end Loading @@ -23,10 +30,10 @@ module JsDuck abstract, description, "<div class='hr'></div>", CfgTable.new(@cls).to_html, PropertyTable.new(@cls).to_html, MethodTable.new(@cls).to_html, EventTable.new(@cls).to_html, CfgTable.new(@cls, @cache).to_html, PropertyTable.new(@cls, @cache).to_html, MethodTable.new(@cls, @cache).to_html, EventTable.new(@cls, @cache).to_html, "</div>", ].join("\n") end Loading Loading
lib/jsduck/app.rb +2 −1 Original line number Diff line number Diff line Loading @@ -80,10 +80,11 @@ module JsDuck # Writes documentation page for each class def write_pages(path, docs) subclasses = Subclasses.new(docs) cache = {} docs.each do |cls| filename = path + "/" + cls[:name] + ".html" puts "Writing to #{filename} ..." if @verbose html = Page.new(cls, subclasses).to_html html = Page.new(cls, subclasses, cache).to_html File.open(filename, 'w') {|f| f.write(html) } end end Loading
lib/jsduck/cfg_table.rb +2 −2 Original line number Diff line number Diff line Loading @@ -3,8 +3,8 @@ require 'jsduck/table' module JsDuck class CfgTable < Table def initialize(cls) super(cls) def initialize(cls, cache={}) super(cls, cache) @type = :cfg @id = @cls.full_name + "-configs" @title = "Config Options" Loading
lib/jsduck/event_table.rb +2 −2 Original line number Diff line number Diff line Loading @@ -5,8 +5,8 @@ require 'jsduck/long_params' module JsDuck class EventTable < Table def initialize(cls) super(cls) def initialize(cls, cache={}) super(cls, cache) @type = :event @id = @cls.full_name + "-events" @title = "Public Events" Loading
lib/jsduck/method_table.rb +2 −2 Original line number Diff line number Diff line Loading @@ -5,8 +5,8 @@ require 'jsduck/long_params' module JsDuck class MethodTable < Table def initialize(cls) super(cls) def initialize(cls, cache={}) super(cls, cache) @type = :method @id = @cls.full_name + "-methods" @title = "Public Methods" Loading
lib/jsduck/page.rb +12 −5 Original line number Diff line number Diff line Loading @@ -9,9 +9,16 @@ module JsDuck # Creates HTML documentation page for one class. class Page def initialize(cls, subclasses = {}) # Initializes doc page generator # # - cls : the Class object for which to generate documentation # - subclasses : lookup table for easy access to subclasses # - cache : cache for already generated HTML rows for class members # def initialize(cls, subclasses = {}, cache = {}) @cls = cls @subclasses = subclasses @cache = cache @formatter = DocFormatter.new(cls.full_name) end Loading @@ -23,10 +30,10 @@ module JsDuck abstract, description, "<div class='hr'></div>", CfgTable.new(@cls).to_html, PropertyTable.new(@cls).to_html, MethodTable.new(@cls).to_html, EventTable.new(@cls).to_html, CfgTable.new(@cls, @cache).to_html, PropertyTable.new(@cls, @cache).to_html, MethodTable.new(@cls, @cache).to_html, EventTable.new(@cls, @cache).to_html, "</div>", ].join("\n") end Loading