rails / sdoc

Standalone sdoc generator
http://api.rubyonrails.org/
Other
823 stars 131 forks source link

Version explicit links to `api.rubyonrails.org` #345

Closed jonathanhefner closed 8 months ago

jonathanhefner commented 8 months ago

Similar to ffcaf8184e5a30a61038010cbde7d8ea5bfaab83, this uses postprocessing to version explicit links to api.rubyonrails.org. For example, if ENV["HORO_PROJECT_VERSION"] is "3.2.1" (and ENV["HORO_PROJECT_NAME"] is "Ruby on Rails"), then

  <a href="https://api.rubyonrails.org/classes/ActiveRecord/Base.html">Learn more</a>

will be changed to

  <a href="https://api.rubyonrails.org/v3.2.1/classes/ActiveRecord/Base.html">Learn more</a>

This allows such URLs to be used in README.rdoc files instead of using link:classes/ActiveRecord/Base.html, which is not properly resolved when the link is rendered on e.g. GitHub.