Skip to content

Add a rustdoc flag to show the source code externally #67804

Open
@pietroalbini

Description

@pietroalbini

One of the features of docs.rs is to show the source code in its UI, but rustdoc provides its own view of the source as well. This duplication is both confusing for the user, but also duplicates the amount of storage docs.rs uses to store source code.

It'd be nice to have a rustdoc flag (unstable is fine) like --source-code-base, that prevents rustdoc from emitting the source pages on its own and replaces the [src] links with links to the source code base. For example, with --source-code-base ../../crate/lazy_static/1.4.0/source, the [src] for lib.rs would be ../../crate/lazy_static/1.4.0/source/src/lib.rs, and rustdoc's own src page would be missing.

cc @GuillaumeGomez @jyn514

Metadata

Metadata

Labels

C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions