Module: RDoc::Generator::Markup
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Included In:
::RDoc::Alias,
::RDoc::AnonClass,
::RDoc::AnyMethod,
::RDoc::Attr,
::RDoc::ClassModule,
::RDoc::CodeObject,
::RDoc::Constant,
::RDoc::Context,
::RDoc::Context::Section,
::RDoc::Extend,
::RDoc::GhostMethod,
::RDoc::Include,
::RDoc::MetaMethod,
::RDoc::MethodAttr,
::RDoc::Mixin,
::RDoc::NormalClass,
::RDoc::NormalModule,
::RDoc::Require,
::RDoc::SingleClass,
::RDoc::TopLevel
| |
| Defined in: | lib/rdoc/generator/markup.rb |
Overview
Handle common ::RDoc::Markup tasks for various CodeObjects
This module is loaded by generators. It allows RDoc’s ::RDoc::CodeObject tree to avoid loading generator code to improve startup time for ri.
Instance Method Summary
-
#aref_to(target_path)
Generates a relative URL from this object’s path to
target_path -
#as_href(from_path)
Generates a relative URL from
from_pathto this object’s path. -
#canonical_url
The preferred URL for this object.
-
#cvs_url(url, full_path)
Build a webcvs URL starting for the given
urlwithfull_pathappended as the destination path. -
#description
Handy wrapper for marking up this object’s comment.
-
#formatter
Creates an
::RDoc::Markup::ToHtmlCrossrefformatter.
Instance Method Details
#aref_to(target_path)
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
#as_href(from_path)
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
#canonical_url
The preferred URL for this object.
# File 'lib/rdoc/generator/markup.rb', line 61
def canonical_url = @store. if path File.join(.canonical_root, path.to_s) else .canonical_root end end
#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 will replace the %s using sprintf on the url.
# File 'lib/rdoc/generator/markup.rb', line 50
def cvs_url(url, full_path) if /%s/ =~ url then sprintf url, full_path else url + full_path end end
#description
Handy wrapper for marking up this object’s comment
# File 'lib/rdoc/generator/markup.rb', line 27
def description markup @comment end
#formatter
Creates an ::RDoc::Markup::ToHtmlCrossref formatter