Loading lib/jsduck/guides.rb +11 −12 Original line number Diff line number Diff line Loading @@ -36,15 +36,13 @@ module JsDuck end # Modified each_item that also loads HTML for each guide def each_item(&block) unless @loaded def each_item super do |guide| guide[:html] = load_guide(guide) # Load the guide if not loaded guide[:html] = load_guide(guide) if guide[:html] == nil # Pass guide to block if it was successfully loaded. yield guide if guide[:html] end @loaded = true end super(&block) end # Modified to_array that excludes the :html from guide nodes Loading @@ -60,12 +58,13 @@ module JsDuck def load_guide(guide) in_dir = @path + "/guides/" + guide["name"] begin return Logger.instance.warn(:guide, "Guide #{in_dir} not found") unless File.exists?(in_dir) guide_file = in_dir + "/README.md" return Logger.instance.warn(:guide, "README.md not found in #{in_dir}") unless File.exists?(guide_file) begin @formatter.doc_context = {:filename => guide_file, :linenr => 0} name = File.basename(in_dir) @formatter.img_path = "guides/#{name}" Loading lib/jsduck/logger.rb +2 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,8 @@ module JsDuck elsif !@warnings.has_key?(type) warn(nil, "Unknown warning type #{type}") end return false end # Formats filename and line number for output Loading Loading
lib/jsduck/guides.rb +11 −12 Original line number Diff line number Diff line Loading @@ -36,15 +36,13 @@ module JsDuck end # Modified each_item that also loads HTML for each guide def each_item(&block) unless @loaded def each_item super do |guide| guide[:html] = load_guide(guide) # Load the guide if not loaded guide[:html] = load_guide(guide) if guide[:html] == nil # Pass guide to block if it was successfully loaded. yield guide if guide[:html] end @loaded = true end super(&block) end # Modified to_array that excludes the :html from guide nodes Loading @@ -60,12 +58,13 @@ module JsDuck def load_guide(guide) in_dir = @path + "/guides/" + guide["name"] begin return Logger.instance.warn(:guide, "Guide #{in_dir} not found") unless File.exists?(in_dir) guide_file = in_dir + "/README.md" return Logger.instance.warn(:guide, "README.md not found in #{in_dir}") unless File.exists?(guide_file) begin @formatter.doc_context = {:filename => guide_file, :linenr => 0} name = File.basename(in_dir) @formatter.img_path = "guides/#{name}" Loading
lib/jsduck/logger.rb +2 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,8 @@ module JsDuck elsif !@warnings.has_key?(type) warn(nil, "Unknown warning type #{type}") end return false end # Formats filename and line number for output Loading