Command line tool for viewing documentation


#1

Hi, new Rustacean here, so please bear with me :slight_smile: Is there an equivalent of “go doc” command line utility for Rust ? I had a look at the awesome-rust list too, but couldn’t find a similar utility for Rust. Thanks in advance!


#2

Hi,

If you want to show documentation for a specific crate you do cargo doc --open and it will generate and show the documentation for you.

I’m not sure if that is what you are asking for or the general Rust documentation?


#3

godoc prints documentation as plain text to stdout.

I’m not aware of any analogous tool in the Rust ecosystem.


#4

Hi @emoon, i checked “cargo doc --open”. But as @BurntSushi said, i’m trying to view documentation about a specific Crate/Module/Function in the console screen. For instance:

go doc bufio

In the “Go land”, the above command prints the documentation for functions/structs/interfaces in “bufio” package to standard output.

I’m still exploring the standard library and common crates. A similar utility for Rust would be very useful for newcomers like me. Thanks.


#5

I see.

I use a third-party tool for that purpose https://kapeli.com/dash that includes the Rust documentation (and many other langs/APIs) and I have a key combo in my editor to lookup something. This isn’t likely exactly what you are looking for though.


#6

Thanks @emoon. I just came across this project on github:

oxidoc

Looks like it’s in alpha state, but might be useful for console users in the future.


#7

Docs are generated from source code. You might want to jump to definition to read docs.