rust-lang / rust-lang/docs.rs

Support relative links between crates?

Open
#204 9 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-builds C-enhancement E-hard
Dominant language
Rust
Stars
1.2k
Forks
232
Avg merge
11h 35m
Merged PRs (30d)
60

Description

Example: Rand has multiple crates in the same repo.

We have been using relative links between the crates, e.g.:

[`BlockRng`]: ../../../rand_core/block/struct.BlockRng.html

If we build doc with cargo doc --all, these links work fine locally. They do not work on docs.rs (e.g. block BlockRng here).

Is there a good solution for this? We'd prefer not to use absolute links to docs.rs. We have documentation here which resolves the cross-linking just fine.

Contributor guide

No contributing guide indexed for this repository

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 the relative-link behavior with cargo doc --all for a project containing multiple crates, then compare the generated links with the failing example on docs.rs. The work is complete when cross-crate relative links such as the BlockRng reference resolve on docs.rs without requiring absolute docs.rs URLs.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.