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
Adding links to literals and Kernel #5192
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RDoc is not only for HTML format, should be rdoc-links.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This style is used in a lot of recent documentation, because people aren't sure how to use an rdoc-link to hyperlink to a specific heading in the generated documentation. Can you show an example of using an rdoc-link to generate the same link? Maybe it is possible with
rdoc-label
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, this comes down to these two usages:
I have not found any form for these links that works, other than the above. If someone knows how to write these links without
.html
, please provide examples.Specifically, what's needed is:
Kernel
.doc/syntax/literals.rdoc
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A link to an instance method Kernel would be
Kernel#method_name
. So those should be changed. In the example above, switch to:Similar changes for other method links.
Linking to section headings can be done with
@
, according to the rdoc documentation:That shows how to link to the section heading of a class. However, I'm not sure how to generate a link to a section heading of a file. Maybe
{array literal}[doc/syntax/literals.rdoc@Array+Literals]
works?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried many things, including these:
{Array}[Kernel#Array]
did not work; generated<a href="Kernel#Array">Array</a>
. which did not work.{array literal}[doc/syntax/literals.rdoc@Array+Literals]
; generated<a href="doc/syntax/literals.rdoc@Array+Literals">array literal</a>
, which also did not work.Also, various forms with
#method-i-Array
did not work.Could it be that things are different for a module such as
Kernel
? And for a file such asliterals.rdoc
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No,
Kernel#Array
does not work. Maybe we need to hear from @nobu on this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm asking @aycabta to fix RDoc.
The links are OK for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @nobu. When RDoc is fixed, I will sweep the major classes free of these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to use
foo.rdoc#label-bar
for labeled links tofoo.rdoc
instead offoo_rdoc.html#label-bar
.The
label-
part is a result of RDoc's internal processing, so it's probably not a good idea either, but if RDoc changesfoo.rdoc#bar
tofoo_rdoc.html#label-bar
, the part originally written asabc.rdoc#label-def
will now beabc_rdoc.html#label-label-def
. There are many places like this in the existing documentation. Even if other new notations are introduced, careful consideration is needed to ensure appropriate specifications.I fixed it by ruby/rdoc#853. You can use
Kernel#String
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @aycabta. If I change to Kernel#String, I won't be able to verify in Ruby 3.0.2. If I put the 8 changes in a PR, can you verify?