Module: RDoc::Generator::Markup
- Defined in:
- lib/rdoc/generator/markup.rb
Overview
Handle common RDoc::Markup tasks for various CodeObjects
Instance Method Summary (collapse)
-
- (Object) aref_to(target_path)
Generates a relative URL from this object's path to target_path.
-
- (Object) as_href(from_path)
Generates a relative URL from from_path to this object's path.
-
- (Object) cvs_url(url, full_path)
Build a webcvs URL starting for the given url with full_path appended as the destination path.
-
- (Object) description
Handy wrapper for marking up this object's comment.
-
- (Object) formatter
Creates an RDoc::Markup::ToHtmlCrossref formatter.
Instance Method Details
- (Object) aref_to(target_path)
Generates a relative URL from this object's path to target_path
18 19 20 |
# File 'lib/rdoc/generator/markup.rb', line 18 def aref_to(target_path) RDoc::Markup::ToHtml.gen_relative_url path, target_path end |
- (Object) as_href(from_path)
Generates a relative URL from from_path to this object's path
25 26 27 |
# File 'lib/rdoc/generator/markup.rb', line 25 def as_href(from_path) RDoc::Markup::ToHtml.gen_relative_url from_path, path end |
- (Object) cvs_url(url, full_path)
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.
53 54 55 56 57 58 59 |
# File 'lib/rdoc/generator/markup.rb', line 53 def cvs_url(url, full_path) if /%s/ =~ url then sprintf url, full_path else url + full_path end end |
- (Object) description
Handy wrapper for marking up this object's comment
32 33 34 |
# File 'lib/rdoc/generator/markup.rb', line 32 def description markup @comment end |
- (Object) formatter
Creates an RDoc::Markup::ToHtmlCrossref formatter
39 40 41 42 43 44 45 46 |
# File 'lib/rdoc/generator/markup.rb', line 39 def formatter return @formatter if defined? @formatter show_hash = RDoc::RDoc.current..show_hash hyperlink_all = RDoc::RDoc.current..hyperlink_all this = RDoc::Context === self ? self : @parent @formatter = RDoc::Markup::ToHtmlCrossref.new this.path, this, show_hash, hyperlink_all end |