模块 RDoc::Generator::Markup
处理各种 CodeObject 的常见 RDoc::Markup 任务
该模块由生成器加载。它允许 RDoc 的 CodeObject 树避免加载生成器代码,以提高 ri 的启动速度。
公共实例方法
aref_to(target_path) 点击切换源代码
生成从该对象的路径到 target_path 的相对 URL
# File 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) 点击切换源代码
生成从 from_path 到该对象路径的相对 URL
# File rdoc/generator/markup.rb, line 20 def as_href(from_path) RDoc::Markup::ToHtml.gen_relative_url from_path, path end
cvs_url(url, full_path) 点击切换源代码
使用附加的 full_path 作为目标路径,为给定的 url 构建一个 webcvs URL。如果 url 包含“%s”,则将使用 sprintf 在 url 上替换 %s。
# File 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() 点击切换源代码
用于标记此对象注释的便捷包装器
# File rdoc/generator/markup.rb, line 27 def description markup @comment end
formatter() 点击切换源代码
创建一个 RDoc::Markup::ToHtmlCrossref 格式化程序
# File rdoc/generator/markup.rb, line 34 def formatter return @formatter if defined? @formatter options = @store.rdoc.options this = RDoc::Context === self ? self : @parent @formatter = RDoc::Markup::ToHtmlCrossref.new options, this.path, this @formatter.code_object = self @formatter end