6 releases (3 breaking)

0.4.0 Mar 8, 2022
0.3.1 Feb 15, 2022
0.3.0 Feb 15, 2022
0.2.0 Feb 15, 2022
0.1.1-alpha.2 Feb 15, 2022

#513 in Command-line interface

22 downloads per month

MIT license

86 lines


license Version info

Launch cargo docs from a github PR.

This tool is intended as an aid when reviewing PRs in Rust projects. It's often hard to tell what the docs will look like before rendering. It's also often hard to gain context for a PR without seeing the docs. This tool solves both of those problems with a single command.


cargo install cargo-ghdoc


From an open PR page in github, copy the URL at the top of the page. Then run the following, replacing the URL here with your open PR.

cargo ghdoc https://github.com/fulcrumgenomics/cargo-ghdoc/pull/1

This will open the Rust docs for the Rust project from a checkout of that PR.

Proceed to nit pick.

Implementation notes

This tool is just running git and cargo shell commands under the hood. As such both binaries should be findable in your path. Additionally this tool requires that you have set up SSH credentials and that they are valid for the repo in question.

Equivalent shell commands:

mkdir <tempdir>
cd <tempdir>
git clone <repo>
cd <repo>
git fetch origin pull/<PR number>/head:GHDOC
git checkout GHDOC
cargo doc --open

Since this tool is piggybacking off of git, you must have sufficient permissions to run those command.


~182K SLoC