roc -- cli rust documentation that rocks
go doc
style command line searching through documentation for rust crates.
roc
piggybacks off of the HTML documentation generated by rustdoc, so you will
need to run cargo doc
before using roc if you want to look at anything other
that the standard library. roc
only aims to provide a quick interface to track
down documentation summaries: most top level details will be shown but you
should pass the -o
flag to your query if you need to read the full
documentation. This will open the local doc page using your default web browser.
Some caveats
- This is very much a work in progress! There are multiple features that need implementing (grepping for partial matches, bash/zsh completion scripts, hoogle style searching by signature etc) and several known bugs, mostly in output formatting. If you have a use case that is not currenly covered or a ideas for functionality that could be added, please raise an issue on the GitHub repo or a PR if you are happy to implement the features yourself.
roc
assumes that you are using rustup and that you have stdlib docs downloaded. If not, you will be unable to search the docs of anything instd
.roc
requires that you build any dependency crate docs before they can be found. The simplest workflow is to runcargo doc
whenever you update yourCargo.toml
in order to ensure that your local generated docs are up to date.
Example usage
# show summary comment for the Eq trait from stdlib
)
# generate the documentation for roc itself
&&
# list out all of the known crates that we can find from this directory
# show top level summary details for the roc crate
# show specific information about the Locator struct
)
& ) & )
Curent flags
-l, --list list out modules under the current path
-o, --open open the selected doc page in the browser (local copy)
Local file system doc locations
std::* -> $(rustc --print sysroot)/share/doc/rust/html/std
* -> $(dirname Cargo.toml)/target/doc