An individual index reference. A reference can point to one of a few types of locations:
- URLs: "http://man.cx/crontab(5)" - Relative paths to ronn manuals: "crontab.5.ronn"
The url method should be used to obtain the href value for HTML.
# File lib/ronn/index.rb, line 149 def initialize(index, name, location) @index = index @name = name @location = location end
# File lib/ronn/index.rb, line 155 def manual? name =~ %r\([0-9]\w*\)$/ end
# File lib/ronn/index.rb, line 179 def path File.expand_path(location, File.dirname(@index.path)) if relative? end
# File lib/ronn/index.rb, line 167 def relative? !remote? end
# File lib/ronn/index.rb, line 163 def remote? location =~ %r^(?:https?|mailto):/ end
# File lib/ronn/index.rb, line 159 def ronn? location =~ %r\.ronn?$/ end
# File lib/ronn/index.rb, line 171 def url if remote? location else location.chomp('.ronn') + '.html' end end