Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intra-doc links do not work in markdown files #77974

Open
jyn514 opened this issue Oct 15, 2020 · 1 comment
Open

Intra-doc links do not work in markdown files #77974

jyn514 opened this issue Oct 15, 2020 · 1 comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name A-markdown-parsing Area: Markdown parsing for doc-comments C-feature-request Category: A feature request, i.e: not implemented / a PR. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jyn514
Copy link
Member

jyn514 commented Oct 15, 2020

I tried this code:

# Hello

Link to [std::process::Command]

I expected to see this happen: Rustdoc generates a link to https://doc.rust-lang.org/std/process/struct.Command.html

Instead, this happened: Rustdoc writes the literal text [std::process::Command]

This might be a little tricky because there is no scope to resolve in. I think ideally this would have the same scope as an empty crate with only the std injects (extern crate std; use std::prelude::v1::*;).

Noticed this in #77971.

Meta

rustdoc --version:

rustdoc 1.49.0-nightly (91a79fb29 2020-10-07)
@jyn514 jyn514 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-feature-request Category: A feature request, i.e: not implemented / a PR. A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name labels Oct 15, 2020
jyn514 added a commit to jyn514/book that referenced this issue Oct 15, 2020
Intra-doc links do not yet work in markdown files; see
rust-lang/rust#77974.
bors bot added a commit to rust-embedded/book that referenced this issue Oct 15, 2020
271: Fix broken link to std::process::Command r=therealprof a=jyn514

Intra-doc links do not yet work in markdown files; see rust-lang/rust#77974.

Part of rust-lang/rust#77971.

Co-authored-by: Joshua Nelson <[email protected]>
@jyn514 jyn514 added the A-markdown-parsing Area: Markdown parsing for doc-comments label Nov 12, 2020
@jyn514
Copy link
Member Author

jyn514 commented Jul 19, 2022

#99466 came up with a fascinating solution: Add -L target/debug/deps so that rustdoc can still load the crates even when running doctests.

That doesn't actually work for intra-doc links because rustdoc runs in a different mode (that doesn't run the compiler internally) but I think it should be feasible to start loading crates when rendering markdown files :) which would make this exactly parallel to how rust source code works.

@jyn514 jyn514 added the E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. label Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name A-markdown-parsing Area: Markdown parsing for doc-comments C-feature-request Category: A feature request, i.e: not implemented / a PR. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants