Is there a cli tool to read documentation?

Is there a command-line tool (like man) that would display the relevant documentation of Crystal or that would take me to correct page in my browser? e.g. one that I could run

crystal docs --html HTTP::Client::Response

that would open my browser at HTTP::Client - Crystal 1.0.0


crystal docs --show HTTP::Client::Response

that would pipe the document through less on Linux.

1 Like

The former is pretty trivial. That’s essentially just open "docs/${1//::/\/}.html".

1 Like

A while ago I did some experiments with consuming the API docs JSON data. It also includes a CLI for extracting information. I don’t think the feature you’re looking for is exactly implemented, but it shouldn’t be hard to do. The data is all there.
Code is at GitHub - straight-shoota/crystal-api, but I haven’t tested it in a while, probably needs some updates.

1 Like

Hey, I just wrote a CLI tool to do this:

I’m learning Crystal from Python background and this also what I’m looking for,
so I decided to make it my first project in Crystal.

The tool is just functioning today,
next step is porting it to crystal. (and use new name crdoc)

Feedback is welcome.