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

PLEASE make cross references actually work w/ ri #1097

Open
zenspider opened this issue Mar 14, 2024 · 3 comments
Open

PLEASE make cross references actually work w/ ri #1097

zenspider opened this issue Mar 14, 2024 · 3 comments

Comments

@zenspider
Copy link
Contributor

9982 $ ri File.new | tail -6
Optional keyword arguments opts specify:

* {Open Options}[rdoc-ref:IO@Open+Options].
* {Encoding options}[rdoc-ref:encodings.rdoc@Encoding+Options].


9983 $ ri rdoc-ref:IO@Open+Options
Nothing known about rdoc-ref
9984 $ ri rdoc-ref:encodings.rdoc@Encoding+Options
Nothing known about rdoc-ref

(Also, why are there 2 blank lines at the end of File.new output?)

or:

9989 $ ri Array#pack
= Array#pack

(from ruby core)
------------------------------------------------------------------------
  pack(template, buffer: nil) -> string

------------------------------------------------------------------------

Formats each element in self into a binary string; returns that string.
See {Packed Data}[rdoc-ref:packed_data.rdoc].


9990 $ ri rdoc-ref:packed_data.rdoc | head -1
Nothing known about rdoc-ref
9991 $ ri ruby:packed_data.rdoc | head -1
= Packed Data
9992 $ ri ruby:packed_data | head -1
= Packed Data

This just isn't right. rdoc-ref isn't a thing yet ri refers to it ALL OVER the place. There's not the faintest clue that ruby: is the correct prefix. Please make this tool usable again OR stop extracting the useful bits of the doco into cross referenced files that don't work.

@BurdetteLamar
Copy link
Member

@zenspider, I've been aware of this issue, and agree that it would be good for RDoc to do better.

Meanwhile, I have been working on some enhanced documentation for ri (not yet in a PR), and have planned to include some advice about how to mentally 'translate' an rdoc-ref passage into a useful ri command that the reader can type to see the linked doc in ri. This will include advice about class/module, method, and page (such as ruby:) both in Ruby itself and in a gem.

@zenspider
Copy link
Contributor Author

Optional keyword arguments opts specify:

* {Open Options}[rdoc-ref:IO@Open+Options].
* {Encoding options}[rdoc-ref:encodings.rdoc@Encoding+Options].


9993 $ ri rdoc-ref:IO@Open+Options
Nothing known about rdoc-ref

This is unusable. Period. I don't want to "mentally translate it", I want it to work. If I'm supposed to type X to get information, then it should output X, not Y. If that means that all of the xrefs in the documentation need to be changed, then so be it. If it isn't copy/paste-able then it isn't working.

@BurdetteLamar
Copy link
Member

@zenspider, fixing this is out of scope for me (primarily a documentor, not a developer); best I can do is put a workaround in the documentation.

Personally, I think the cut-and-paste is also inadequate; generated RI should have maximal http(s) URLs (not rdoc-refs), which I find in several command windows are recognized as URLs and can be opened with Ctrl-click.

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

No branches or pull requests

2 participants