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

Allow specification of the output directory for cargo doc #760

Closed
sfackler opened this issue Oct 26, 2014 · 2 comments
Closed

Allow specification of the output directory for cargo doc #760

sfackler opened this issue Oct 26, 2014 · 2 comments
Labels
A-configuration Area: cargo config files and env vars Command-doc E-easy Experience: Easy

Comments

@sfackler
Copy link
Member

I'm hosting documentation for multiple crates in the same github.io repository. Rustdoc can only properly setup the crate list, search indices, etc, if it's writing directly into the same folder for each crate. Right now I'm symlinking target/doc to the right folder in each project, but that's pretty fragile. Ideally, I'd be able to specify cargo doc --out-dir=../sfackler.github.io/doc or something.

@alexcrichton alexcrichton added the E-easy Experience: Easy label Oct 27, 2014
@alexcrichton alexcrichton added A-configuration Area: cargo config files and env vars Command-doc labels Jan 14, 2015
@alexcrichton
Copy link
Member

Closing as a dupe of #482 as it's likely how this will be solved.

@zopsicle
Copy link

zopsicle commented Jan 3, 2024

I don’t think #482 solves this properly (although it has proven very useful for other purposes), in the case where crates are built for different targets, for instance:

cargo doc --manifest-path foo/Cargo.toml --target x86_64-unknown-linux-gnu
cargo doc --manifest-path bar/Cargo.toml --target x86_64-pc-windows-msvc

The docs for foo and bar are written to target/x86_64-unknown-linux-gnu/doc and target/x86_64-pc-windows-msvc/doc, respectively. With separate crate lists and search indexes, etc.

Having an output directory option specifically for cargo doc (as suggested by OP) would therefore still be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-configuration Area: cargo config files and env vars Command-doc E-easy Experience: Easy
Projects
None yet
Development

No branches or pull requests

3 participants