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

[DOC] New file RI.md #1100

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from
Draft

[DOC] New file RI.md #1100

wants to merge 25 commits into from

Conversation

BurdetteLamar
Copy link
Member

@BurdetteLamar BurdetteLamar commented Mar 22, 2024

Replaces the very spare RI.rdoc with the robust RI.md.

This is meant for new or less-experienced RI users (who may have found this page in a browser search).

Copy link
Member

@peterzhu2118 peterzhu2118 left a 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:

  1. Who is this targeted towards? Users of ri want a quick reference and are probably using the ri -h or the man ri documentation.
  2. 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.

RI.md Outdated Show resolved Hide resolved
RI.md Outdated Show resolved Hide resolved
RI.md Outdated Show resolved Hide resolved
RI.md Outdated Show resolved Hide resolved
RI.md Outdated Show resolved Hide resolved
@BurdetteLamar
Copy link
Member Author

1. Who is this targeted towards? Users of `ri` want a quick reference and are probably using the `ri -h` or the `man ri` documentation.

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 man ri. It's very old (and no doubt out-of-date). Seems to be actual source (not derived); is that right? I find that it's available on my Linux machine, but not on Windows; don't know about elsewhere.

@BurdetteLamar
Copy link
Member Author

2. 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.

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 ruby: is a pseudo-gem, all pages are of one kind.

I'll look into how to avoid repetition between static/interactive.

@peterzhu2118
Copy link
Member

I'd never heard of man ri. It's very old (and no doubt out-of-date). Seems to be actual source (not derived); is that right? I find that it's available on my Linux machine, but not on Windows; don't know about elsewhere.

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.

@BurdetteLamar
Copy link
Member Author

I'm not sure what you mean by "actual source (not derived)". The source is in the file /man/ri.1.

Just meant source text -- not derived from something else; e.g., .{html|ri} derived from .{c|rb|rdoc|md}.

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 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.

@BurdetteLamar
Copy link
Member Author

Much more work to be done here, so marking as Draft and removing review requests.

@BurdetteLamar BurdetteLamar marked this pull request as draft April 1, 2024 16:44
@BurdetteLamar BurdetteLamar requested review from peterzhu2118 and removed request for olleolleolle, drbrain, hsbt and peterzhu2118 April 1, 2024 16:44
RI.md Outdated Show resolved Hide resolved
RI.md Outdated Show resolved Hide resolved
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. |
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

@peterzhu2118 peterzhu2118 Apr 14, 2024

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 Show resolved Hide resolved
RI.md Outdated Show resolved Hide resolved
RI.md Outdated

See also {ri at the Ready}[rdoc-ref:RI.md@ri+at+the+Ready].

## Shell Quoting or Escaping
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed.

RI.md Outdated Show resolved Hide resolved
RI.md Outdated Show resolved Hide resolved
RI.md Outdated
| --server=NUMBER | Set port for RDoc server; default is 8214. |
<br>

### \Options Details
Copy link
Member

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.

Copy link
Member Author

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).

Copy link
Member

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?

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.

RI.md Outdated Show resolved Hide resolved
RI.md Outdated
| Name | Shows |
|--------------------------------------|----------------------------------------------------------------------------------|
| 'IO::readlines' | Document for Ruby class method IO::readlines. |
| 'IO#readlines' | Document for RUby instance method IO::readlines. |
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
| 'IO#readlines' | Document for RUby instance method IO::readlines. |
| 'IO#readlines' | Document for Ruby instance method IO::readlines. |

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.

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. |
Copy link
Member

@peterzhu2118 peterzhu2118 Apr 14, 2024

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
Copy link
Member

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?

@BurdetteLamar
Copy link
Member Author

@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.

@BurdetteLamar
Copy link
Member Author

@peterzhu2118, do we need to hear from a maintainer (@drbrain or @hsbt) before merging?

@BurdetteLamar
Copy link
Member Author

@peterzhu2118, will you be reviewing this?

@peterzhu2118
Copy link
Member

I think this looks good, but I would like one of the maintainers to give input before merging.

@BurdetteLamar
Copy link
Member Author

I think this looks good, but I would like one of the maintainers to give input before merging.

Agreed. @drbrain and @hsbt, can you review or recommend a reviewer?

- 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;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- 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
Copy link
Member

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?

Copy link
Member

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 🙂

Copy link
Member Author

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?

Copy link
Member

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:

Screenshot 2024-05-02 at 7 50 40 AM

Links in Markdown need to be denoted with [<text>](<link>) instead of {<text>}[<link>] as per the Markdown Spec

@BurdetteLamar
Copy link
Member Author

@drbrain and @hsbt: Are you at all interested in this work? If so, will you (or someone you suggest) be reviewing? If not, I think no one should spend more time on this.

@BurdetteLamar
Copy link
Member Author

Thanks much, @colby-swandale! I'll work with the links.

(I have done some other .md pages that will also need attention.)

@BurdetteLamar BurdetteLamar marked this pull request as draft May 2, 2024 03:50
@BurdetteLamar
Copy link
Member Author

Marking as draft while I work on the links (etc.).

@BurdetteLamar
Copy link
Member Author

I have converted the links to markdown-style reference links:

  • Those that have URLs work fine, both in the HTML and on the GitHub page.
  • Those that have rdoc-ref work in the HTML, but not on the GitHub page.

I've experimented, and have found various forms that work on one or the other, but not on both.
Any hints, anyone?

@BurdetteLamar
Copy link
Member Author

I have converted the links to markdown-style reference links:

* Those that have URLs work fine, both in the HTML and on the GitHub page.

* Those that have `rdoc-ref` work in the HTML, but not on the GitHub page.

I've experimented, and have found various forms that work on one or the other, but not on both. Any hints, anyone?

@colby-swandalem, any ideas about this?

@colby-swandale
Copy link
Member

I have converted the links to markdown-style reference links:

  • Those that have URLs work fine, both in the HTML and on the GitHub page.
  • Those that have rdoc-ref work in the HTML, but not on the GitHub page.

I've experimented, and have found various forms that work on one or the other, but not on both. Any hints, anyone?

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?

@BurdetteLamar
Copy link
Member Author

BurdetteLamar commented May 10, 2024

I have converted the links to markdown-style reference links:

  • Those that have URLs work fine, both in the HTML and on the GitHub page.
  • Those that have rdoc-ref work in the HTML, but not on the GitHub page.

I've experimented, and have found various forms that work on one or the other, but not on both. Any hints, anyone?

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:

  • At a minimum would need to be added to the Documentation Guide; thoughts from the Guide guide @jeremyevans?

  • At a maximum, would need to be put up as an issue for the dev meeting.

Alternatively, RDoc could in its RI output convert rdoc-refs to URLs? Out-of-scope for me, but possibly interesting.

@jeremyevans
Copy link
Contributor

In general, rdoc-ref is useful because it makes the references internally consistent. If all references are to URLs, then there is no need for rdoc-ref, but if you are referencing something else in the documentation currently being generated, you want to use rdoc-ref as opposed to URLs. It's a shame GitHub doesn't handle rdoc-ref, but that's a GitHub issue, and I don't think we should avoid rdoc-ref just because GitHub doesn't render it correctly. The goal should be something that works best with rdoc/ri generated documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

6 participants