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

More on auto-link #9907

Merged
merged 6 commits into from Feb 12, 2024
Merged

More on auto-link #9907

merged 6 commits into from Feb 12, 2024

Conversation

BurdetteLamar
Copy link
Member

@BurdetteLamar BurdetteLamar commented Feb 9, 2024

@nobu suggests that a reference to a class such as IO (even the local one) should be +IO+ (to force monofont), not \IO (plain text). In my view, if it's not plain text, it may as well be auto-linked (IO), since both forced monofont and auto-linking cause both the font and the background color to be changed.

Therefore I propose allowing auto-linking in almost all cases.

This proposed change does not imply that current docs should be revised for this purpose, but only that additions or revisions should consider this.

@BurdetteLamar BurdetteLamar added the Documentation Improvements to documentation. label Feb 9, 2024
- The reference is to the current class document
(e.g., _Array_ in the documentation for class `Array`).
- The same reference is repeated many times
(e.g., _RDoc_ on this page).
- The reference is to a class or module that users
usually don't deal with, including these:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend removing the last bullet as well. It mentions Class, Module, and Method. First, I'm not sure users don't usually deal with them. Second, even if they don't usually deal with them, there is no problem auto-linking when referring to the Ruby class/entity.

I think the only time auto-linking should be supressed is if the usage does not refer to the Ruby class/entity. Maybe:

In general, \RDoc's auto-linking should not be suppressed.
For example, we should write `Array`, not `\Array`.
However, suppress when the word in question does not refer to the Ruby entity
(e.g., some uses of _Class_ or _English_).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

@jeremyevans jeremyevans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to remove the blank line above the new paragraph, but that's up to you.

@peterzhu2118
Copy link
Member

In my view, if it's not plain text, it may as well be auto-linked (IO), since both forced monofont and auto-linking cause both the font and the background color to be changed.

I don't agree. Using monofont signals that it's code, but linking to the same page (except linking to a particular section) is pointless and distracts the user from which links are useful to click on.

@BurdetteLamar
Copy link
Member Author

BurdetteLamar commented Feb 10, 2024

In my view, if it's not plain text, it may as well be auto-linked (IO), since both forced monofont and auto-linking cause both the font and the background color to be changed.

I don't agree. Using monofont signals that it's code, but linking to the same page (except linking to a particular section) is pointless and distracts the user from which links are useful to click on.

You'd be comfortable with code for page self-reference, and auto-links for others?

Text adjusted.

For example, we should write `Array`, not `\Array`.
However, suppress when the word in question does not refer to a Ruby entity
(e.g., some uses of _Class_ or _English_).
For example, we should write `Array`, not `\Array`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No period at the end?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@BurdetteLamar
Copy link
Member Author

Once we have consensus/approval for the specific reviewers here, I'd like to leave this open for a few days for any others to comment.

@peterzhu2118 peterzhu2118 merged commit 4f1a466 into ruby:master Feb 12, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements to documentation.
4 participants