Loading lib/jsduck/app.rb +1 −0 Original line number Diff line number Diff line Loading @@ -155,6 +155,7 @@ module JsDuck # Formats each class def format_classes doc_formatter = get_doc_formatter doc_formatter.img_path = "images" class_formatter = ClassFormatter.new(@relations, doc_formatter) # Don't format types when exporting class_formatter.include_types = !@opts.export Loading lib/jsduck/doc_formatter.rb +5 −1 Original line number Diff line number Diff line Loading @@ -36,6 +36,10 @@ module JsDuck # This will hold list of all image paths gathered from {@img} tags. attr_accessor :images # Base path to prefix images from {@img} tags. # Defaults to no prefix. attr_accessor :img_path # Sets up instance to work in context of particular class, so # that when {@link #blah} is encountered it knows that # Context#blah is meant. Loading Loading @@ -175,7 +179,7 @@ module JsDuck @img_tpl.gsub(/(%\w)/) do case $1 when '%u' "images/" + url @img_path ? (@img_path + "/" + url) : url when '%a' CGI.escapeHTML(alt_text||"") else Loading lib/jsduck/guides.rb +2 −2 Original line number Diff line number Diff line Loading @@ -49,9 +49,9 @@ module JsDuck FileUtils.cp_r(in_dir, out_dir) @formatter.doc_context = {:filename => guide_file, :linenr => 0} html = @formatter.format(IO.read(guide_file)) name = File.basename(in_dir) html.gsub!(/<img src="/, "<img src=\"guides/#{name}/") @formatter.img_path = "guides/#{name}" html = @formatter.format(IO.read(guide_file)) JsonDuck.write_jsonp(out_dir+"/README.js", name, {:guide => html, :title => guide["title"]}) end Loading Loading
lib/jsduck/app.rb +1 −0 Original line number Diff line number Diff line Loading @@ -155,6 +155,7 @@ module JsDuck # Formats each class def format_classes doc_formatter = get_doc_formatter doc_formatter.img_path = "images" class_formatter = ClassFormatter.new(@relations, doc_formatter) # Don't format types when exporting class_formatter.include_types = !@opts.export Loading
lib/jsduck/doc_formatter.rb +5 −1 Original line number Diff line number Diff line Loading @@ -36,6 +36,10 @@ module JsDuck # This will hold list of all image paths gathered from {@img} tags. attr_accessor :images # Base path to prefix images from {@img} tags. # Defaults to no prefix. attr_accessor :img_path # Sets up instance to work in context of particular class, so # that when {@link #blah} is encountered it knows that # Context#blah is meant. Loading Loading @@ -175,7 +179,7 @@ module JsDuck @img_tpl.gsub(/(%\w)/) do case $1 when '%u' "images/" + url @img_path ? (@img_path + "/" + url) : url when '%a' CGI.escapeHTML(alt_text||"") else Loading
lib/jsduck/guides.rb +2 −2 Original line number Diff line number Diff line Loading @@ -49,9 +49,9 @@ module JsDuck FileUtils.cp_r(in_dir, out_dir) @formatter.doc_context = {:filename => guide_file, :linenr => 0} html = @formatter.format(IO.read(guide_file)) name = File.basename(in_dir) html.gsub!(/<img src="/, "<img src=\"guides/#{name}/") @formatter.img_path = "guides/#{name}" html = @formatter.format(IO.read(guide_file)) JsonDuck.write_jsonp(out_dir+"/README.js", name, {:guide => html, :title => guide["title"]}) end Loading