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

[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? #781

Open
rubyFeedback opened this issue Sep 5, 2020 · 0 comments

Comments

@rubyFeedback
Copy link

rubyFeedback commented Sep 5, 2020

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?

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

1 participant