Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version explicit links to api.rubyonrails.org #345

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

jonathanhefner
Copy link
Member

@jonathanhefner jonathanhefner commented Nov 14, 2023

Similar to ffcaf81, 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.

Similar to ffcaf81, 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

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

will be changed to

  ```html
  <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.
@jonathanhefner jonathanhefner force-pushed the version-rubyonrails-links branch from 46930b8 to 87683a1 Compare November 14, 2023 22:01
@jonathanhefner jonathanhefner merged commit e26cca7 into rails:main Nov 14, 2023
9 checks passed
jonathanhefner added a commit to jonathanhefner/rails that referenced this pull request Nov 14, 2023
Prior to this commit, `link:classes/...` URLs were used in `README.rdoc`
files so that the URLs would be versioned when rendered at
api.rubyonrails.org.  However, outside of api.rubyonrails.org, such URLs
aren't properly resolved.

Since rails/sdoc#345, `https://api.rubyonrails.org/classes/...` URLs
will also be versioned when rendered at api.rubyonrails.org, and such
URLs properly resolve everywhere.  Therefore, this commit converts
`link:classes/...` URLs to that form.
jonathanhefner added a commit to jonathanhefner/rails that referenced this pull request Nov 14, 2023
Follow-up to rails#49995.

Prior to this commit, `link:classes/...` URLs were used in `README.rdoc`
files so that the URLs would be versioned when rendered at
api.rubyonrails.org.  However, outside of api.rubyonrails.org, such URLs
aren't properly resolved.

Since rails/sdoc#345, `https://api.rubyonrails.org/classes/...` URLs
will also be versioned when rendered at api.rubyonrails.org, and such
URLs are properly resolved everywhere.  Therefore, this commit converts
`link:classes/...` URLs to that form.
jonathanhefner added a commit to jonathanhefner/sdoc that referenced this pull request Dec 24, 2023
Follow-up to 87683a1.

This adds a CHANGELOG entry, plus a minor code cleanup.
jonathanhefner added a commit to jonathanhefner/sdoc that referenced this pull request Dec 24, 2023
Follow-up to 87683a1.

This adds a CHANGELOG entry, plus a minor code cleanup.
jonathanhefner added a commit to jonathanhefner/sdoc that referenced this pull request Dec 24, 2023
Follow-up to 87683a1.

This adds a CHANGELOG entry, plus a minor code cleanup.
jonathanhefner added a commit that referenced this pull request Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant