rust-lang / rust-lang/cargo

Issues with `cargo doc --open`

Open
#8,428 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug Command-doc O-linux S-blocked-external
Dominant language
Rust
Stars
15.5k
Forks
3k
Avg merge
23h 30m
Merged PRs (30d)
51

Description

Hey all,

I am trying to understand how to use cargo doc locally and not sure if I am encountering a bug or just using it wrong.

When is run cargo doc --open my browser opens to some file store in /run/user/1000/doc/. However that folder only contains an index.html and nothing else.
As a result, I can look at the initial page of the documentation but all links it contains are broken and the style sheet does not seem to load properly either. See the image below:

image

Cargo version is 1.46.0-nightly (c26576f9a 2020-06-23) but I have experienced this with older versions as well.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing cargo doc --open with the reported Cargo version and inspect the generated documentation directory. Done means the browser opens a complete documentation site, with internal links and stylesheets loading instead of only index.html.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.