Handle common RDoc::Markup tasks for various CodeObjects
This module is loaded by generators. It allows RDoc’s CodeObject tree to avoid loading generator
code to improve startup time for ri
.
Generates a relative URL from this object’s path to
target_path
# File lib/rdoc/generator/markup.rb, line 13 def aref_to(target_path) RDoc::Markup::ToHtml.gen_relative_url path, target_path end
Generates a relative URL from from_path
to this object’s path
# File lib/rdoc/generator/markup.rb, line 20 def as_href(from_path) RDoc::Markup::ToHtml.gen_relative_url from_path, path end
Build a webcvs URL starting for the given url
with
full_path
appended as the destination path. If
url
contains ‘%s’ full_path
will be sprintf’d
into url
instead.
# File lib/rdoc/generator/markup.rb, line 52 def cvs_url(url, full_path) if %r%s/ =~ url then sprintf url, full_path else url + full_path end end
Handy wrapper for marking up this object’s comment
# File lib/rdoc/generator/markup.rb, line 27 def description markup @comment end
Creates an RDoc::Markup::ToHtmlCrossref formatter
# File lib/rdoc/generator/markup.rb, line 34 def formatter return @formatter if defined? @formatter show_hash = RDoc::RDoc.current.options.show_hash hyperlink_all = RDoc::RDoc.current.options.hyperlink_all this = RDoc::Context === self ? self : @parent @formatter = RDoc::Markup::ToHtmlCrossref.new(this.path, this, show_hash, hyperlink_all) @formatter.code_object = self @formatter end