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
[DOC] New file RI.md #1100
base: master
Are you sure you want to change the base?
[DOC] New file RI.md #1100
Conversation
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 find this document to be very wordy and repetitive. I have a few concerns:
- Who is this targeted towards? Users of
ri
want a quick reference and are probably using theri -h
or theman ri
documentation. - There are many repeated parts in this documentation. The "Class and Module Documents" section on line 326 is pretty similar to the "Ruby Class and Module Documents" section on 572. The documentation for static and interactive are very similar and are repeats of one another.
I'm thinking more of the new user (possibly the never-before-user). This content will need to be someplace where both the user and the search engines will find it. An eventual aim is to show (in -h and --help) ri commands that will fetch relevant documentation. I'd never heard of |
Some of the repetition arises from my misunderstanding about how many things are here. I'd thought four (class/page ruby/gem), but it may be more useful to think of two (class/page only). All classes (including gem classes) are already available in the class list; if we think of I'll look into how to avoid repetition between static/interactive. |
I'm not sure what you mean by "actual source (not derived)". The source is in the file /man/ri.1. I think it's better to improve the man page rather than this document since man pages are the de facto way of reading the documentation for commands in Linux. I'm not sure that it's out-of-date because the ri command hasn't really changed in the past few years. |
Just meant source text -- not derived from something else; e.g., .{html|ri} derived from .{c|rb|rdoc|md}.
I'm willing to work with the man page later on. This page RI.md (though it still needs major work) is for everyone, not just for those on Linux. |
Much more work to be done here, so marking as Draft and removing review requests. |
RI.md
Outdated
| 'IO#readlines' | Document for RUbyinstance method IO::readlines. | | ||
| 'IO.readlines' | Documents for Ruby instance method IO::readlines and class method IO::readlines. | | ||
| '::readlines' | Documents for all class methods ::readlines. | | ||
| '#readlines' | Documents for all instance methods #readlines; see note below. | |
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.
Can we just include the note here inline? It doesn't seem to be referred by anything else.
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.
Inline note would be (IMO) too big for a table cell; I have just omitted it entirely.
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.
The "see note below" part hasn't been removed.
Removed.
RI.md
Outdated
|
||
See also {ri at the Ready}[rdoc-ref:RI.md@ri+at+the+Ready]. | ||
|
||
## Shell Quoting or Escaping |
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 don't think we need this section. We can briefly mention it in the "static mode" section, but the user should know what needs escaping and what doesn't for their shell.
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.
Removed.
RI.md
Outdated
| --server=NUMBER | Set port for RDoc server; default is 8214. | | ||
<br> | ||
|
||
### \Options Details |
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.
Many of the entries in this section are basically the exact same description as the table above and don't offer any additional details.
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 reluctant to remove just some of these (the ones that don't contribute). Leaving all of them in has the virtue of their showing in the TOC (for quick user nav).
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.
Alternatively, what do you think about removing the table and instead moving the headings for each table as headings for each command?
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.
Done.
RI.md
Outdated
| Name | Shows | | ||
|--------------------------------------|----------------------------------------------------------------------------------| | ||
| 'IO::readlines' | Document for Ruby class method IO::readlines. | | ||
| 'IO#readlines' | Document for RUby instance method IO::readlines. | |
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.
| 'IO#readlines' | Document for RUby instance method IO::readlines. | | |
| 'IO#readlines' | Document for Ruby instance method IO::readlines. | |
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.
Fixed.
RI.md
Outdated
| 'IO#readlines' | Document for RUbyinstance method IO::readlines. | | ||
| 'IO.readlines' | Documents for Ruby instance method IO::readlines and class method IO::readlines. | | ||
| '::readlines' | Documents for all class methods ::readlines. | | ||
| '#readlines' | Documents for all instance methods #readlines; see note below. | |
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.
The "see note below" part hasn't been removed.
Removed.
RI.md
Outdated
| --server=NUMBER | Set port for RDoc server; default is 8214. | | ||
<br> | ||
|
||
### \Options Details |
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.
Alternatively, what do you think about removing the table and instead moving the headings for each table as headings for each command?
@peterzhu2118 said: Alternatively, what do you think about removing the table and instead moving the headings for each table as headings for each command? Done. |
@peterzhu2118, do we need to hear from a maintainer (@drbrain or @hsbt) before merging? |
@peterzhu2118, will you be reviewing this? |
I think this looks good, but I would like one of the maintainers to give input before merging. |
- Omits options; in interactive mode the only options in effect | ||
are those taken from environment variable `RI`. | ||
See {Options}[rdoc-ref:RI.md@Options]. | ||
- Supports tab auto-completion for the names of a classes, modules, and methods; |
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.
- Supports tab auto-completion for the names of a classes, modules, and methods; | |
- Supports tab auto-completion for the names of a class, modules, and methods; |
@@ -2,5 +2,6 @@ History.txt | |||
LICENSE.txt | |||
README.txt | |||
RI.txt | |||
RI.md |
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.
👋🏻 You identified this document's primary audience is people new to the ri
command, and they would find this document mostly through GitHub. But, when rendering the document in GitHub, there are lots of weird and missing formatting artifacts coming through that make it challenging to read:
- Document's title header is not rendered correctly
- Links not being rendered correctly, i.e.,
{Ruby online documentation}[https://docs.ruby-lang.org/en/master]:
- Lots of use of links using
rdoc-ref
, but these are not rendered on GitHub. Does this mean the document is intended to be read throughri
? How do i do that?
Perhaps it would be helpful to either commit to Markdown and it's ways of formatting, or stick with the RDoc way and continue to use ri.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.
Perhaps it would be helpful to either commit to Markdown and it's ways of formatting, or stick with the RDoc way and continue to use ri.rdoc?
I'd support committing to markdown format and will be happy to help with that conversion as I did something similar for IRB just not too long ago 🙂
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.
👋🏻 You identified this document's primary audience is people new to the
ri
command, and they would find this document mostly through GitHub. But, when rendering the document in GitHub, there are lots of weird and missing formatting artifacts coming through that make it challenging to read:* Document's title header is not rendered correctly * Links not being rendered correctly, i.e., `{Ruby online documentation}[https://docs.ruby-lang.org/en/master]:` * Lots of use of links using `rdoc-ref`, but these are not rendered on GitHub. Does this mean the document is intended to be read through `ri`? How do i do that?
Perhaps it would be helpful to either commit to Markdown and it's ways of formatting, or stick with the RDoc way and continue to use
ri.rdoc
?
@colby-swandale, is there a way I can view this new file as it's rendered on GitHub? I'd like to see the problems there firsthand.
Also, not sure what you mean by 'commit to markdown'; the new page is .md
-- a markdown page. Maybe some of the text has an rdoc
accent of which I'm not aware?
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.
@colby-swandale, is there a way I can view this new file as it's rendered on GitHub? I'd like to see the problems there firsthand.
Sure! The current version is at: https://github.com/ruby/rdoc/blob/21505b91dd770e31c485205ac74ed44ef832432a/RI.md
Also, not sure what you mean by 'commit to markdown';
The page is Markdown, but the document is utilising RDoc ways of doing things, particularly around links. When Github renders the document, the links are being rendered as raw text:
Links in Markdown need to be denoted with [<text>](<link>)
instead of {<text>}[<link>]
as per the Markdown Spec
Thanks much, @colby-swandale! I'll work with the links. (I have done some other |
Marking as draft while I work on the links (etc.). |
I have converted the links to markdown-style reference links:
I've experimented, and have found various forms that work on one or the other, but not on both. |
@colby-swandalem, any ideas about this? |
I'm a bit lost sorry, if having URLs works for both renders of the document, then that's a good thing right? What issues are there going this route? |
@colby-swandale, do you mean the route of all-URL, no rdoc-ref? Would work for both, but:
Alternatively, RDoc could in its RI output convert rdoc-refs to URLs? Out-of-scope for me, but possibly interesting. |
In general, |
Replaces the very spare
RI.rdoc
with the robustRI.md
.This is meant for new or less-experienced RI users (who may have found this page in a browser search).