Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I access the API documentation from the command line on Linux?

Tags:

rust

Is there a command to access rust-lang api documentation from the linux command line?

I'm after something similar to this example for golang documentation:

godoc strings Contains

which gives the output:

PACKAGE DOCUMENTATION

package strings import "strings"

FUNCTIONS

func Contains(s, substr string) bool Contains returns true if substr is within s.

I know there is a rustdoc command, but it only generates documentation, it doesn't display it.

like image 238
Piyush Chauhan Avatar asked Jan 10 '15 09:01

Piyush Chauhan


People also ask

How do you access the command line in Linux?

If you can't find a launcher, or if you just want a faster way to bring up the terminal, most Linux systems use the same default keyboard shortcut to start it: Ctrl-Alt-T.

What is command syntax in Linux?

- [Instructor] Learning the Linux command line can be difficult, but understanding the syntax of a Linux command can help. The standard Linux command syntax is "command [options]" and then "<arguments>". The "command [options]" and "<arguments>" are separated by blank spaces.

What is command line in Linux?

A command line, or terminal, is a text based interface to the system. You are able to enter commands by typing them on the keyboard and feedback will be given to you similarly as text. The command line typically presents you with a prompt. As you type, it will be displayed after the prompt.


2 Answers

We don't have a tool like this yet, but would like one. https://github.com/rust-lang/rfcs/issues/650 is tracking this issue.

( Formerly tracked as https://github.com/rust-lang/rust/issues/6160 )

like image 176
Steve Klabnik Avatar answered Oct 04 '22 12:10

Steve Klabnik


The only solution so far would be to use command line browser like lynx and go to http://doc.rust-lang.org/std/index.html.

Or as Intermernet noted you could pipe HTML docs into grep function. If I'm not mistaken, the nightlies should come with complied docs, if you require API docs.

like image 33
Daniel Fath Avatar answered Oct 04 '22 14:10

Daniel Fath