allow linking to a object definition in the api docs

For example to link to the collection item description:

Each collection contains many {api:collections:Collection+Item Collection Items}.

Change-Id: I633645be9e12481aa21e6c03d876ee159ec6437d
Reviewed-on: https://gerrit.instructure.com/11775
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
This commit is contained in:
Brian Palmer 2012-06-22 12:42:40 -06:00
parent 14e1aae4be
commit c86323825e
1 changed files with 2 additions and 0 deletions

View File

@ -37,6 +37,8 @@ module YARD::Templates::Helpers::BaseHelper
else
raise "couldn't find API link for #{args.first}"
end
elsif args.first.is_a?(String) && args.first =~ %r{^api:([^:]+):(.*)}
link_url("#{$1.downcase}.html##{$2.gsub('+', ' ')}", args[1])
else
linkify_without_api(*args)
end