ruby / ruby/rdoc

[Documentation] Could the main README.md link to examples, and could one example show how to obtain the information that we obtain from the commandline, into a String?

Open
#781 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
930
Forks
465
Avg merge
3d 10h
Merged PRs (30d)
27

Description

Hello rdoc-maintainers,

I am creating a "pseudo" shell in ruby; actually it is embedded into a gtk-widget, and that part works
fine on windows too (WSL + xming).

One part of that shell shall display documentation from ruby. rdoc is the logical choice here.

Unfortunately, obtaining the string from a method-lookup in rdoc is a bit difficult; I can use
rdoc driver to display it but I am not sure how to easily capture it (and I don't want to mess
with stdout and StringIO anymore either, it just leads to more complicated code IMO).

A simple API would be nice that could be used, something like:

.result?
.string?

Ideally it should reside in one of the toplevel methods, perhaps not necessarily on
Rdoc. directly, but the rdoc-driver, or some other place (I have no preference here).

Would it then be possible to also add documentation showing how to easily obtain
the string? Once I have that string, I have to modify it a bit before I can then either
display it on the commandline (in this case I don't even need any modification) or
display it in the gtk-widget (in which case I have to sanitize it, e. g. make sure no
faulty characters are included, no ASCII colour escape codes and so forth, which
is why I need to obtain the String).

I tried to go through the source code, but I have to admit that the ruby style in use
here is really really absolutely not what I am familiar with. It makes reading that
code really hard for me.

PS: I could have asked this on SO perhaps but SO is a bit inactive in regards to
ruby, and ideally we would have great documentation so that this could be
found (and exists) within a given ruby project. I suppose rdoc is quite old now,
almost 20 years or so?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with README.md and the RDoc driver or related entry points that produce method-lookup output. Determine where a supported string-returning API should live, document its use with an example, and confirm that the example obtains the same information without requiring stdout capture.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.