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

--extend-css option refers to ../static.files/theme.css but puts css in ../theme.css #2095

Closed
monkeydom opened this issue Apr 6, 2023 · 1 comment

Comments

@monkeydom
Copy link

When adding an --extend-css file, it seems that the file gets copied to the wrong location or that it is referenced incorrectly.

Steps:

> cargo new --lib ecss
     Created library `ecss` package
> cd ecss
> cat >custom.css <<<"body {background: red;}"
> RUSTDOCFLAGS="--extend-css $PWD/custom.css" cargo doc --open

Expected Results:

Red background in docs

Actual Results:

No red background

Notes:

Moving the theme.css to static.files/theme.css fixes the issue

> cp target/doc/theme.css target/doc/static.files/

Just for reference, this is the cmd line cargo generates:

rustdoc --edition=2021 --crate-type lib --crate-name ecss src/lib.rs -o /Users/dom/Data/Playground/rust/ecss/target/doc --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=115 -C metadata=b5a7f46f1030585c -L dependency=/Users/dom/Data/Playground/rust/ecss/target/debug/deps --extend-css /Users/dom/Data/Playground/rust/ecss/custom.css --crate-version 0.1.0

and the header line in the index.html

<link rel="stylesheet" href="../static.files/theme.css">

Context & Version

> rustdoc --version
rustdoc 1.68.2 (9eb3afe9e 2023-03-27)

> sw_vers
ProductName:		macOS
ProductVersion:		13.3
BuildVersion:		22E252
@monkeydom
Copy link
Author

Sorry, wrong repo. rust-lang/rust#110002

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant