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

Preserve .css files in target/doc #294

Closed
japaric opened this issue Feb 10, 2019 · 3 comments · Fixed by #1312 or #1340
Closed

Preserve .css files in target/doc #294

japaric opened this issue Feb 10, 2019 · 3 comments · Fixed by #1312 or #1340
Labels
A-builds Area: Building the documentation for a crate

Comments

@japaric
Copy link
Member

japaric commented Feb 10, 2019

Background / use case

For the cortex-m-rtfm crate I ship an mdbook with the API
documentation
and host both on GH pages. This setup works OK for now but
I'll start having problems once I release a new minor version: people looking at
older minor versions (e.g. on docs.rs) will be directed to the latest version of
the book on GH pages and get confused.

Ideally, I'd like to move away from GH pages and host both the API docs and the
mdbook on docs.rs. That way people will get the right version of the mdbook
regardless of the minor version of the crate they are looking at.


I experimented a bit with getting an mdbook rendered on docs.rs and managed to
place the mdbook output in the target/doc directory using build scripts. You can
see the results at
https://docs.rs/cautious-octo-funicular/0.1.3/cautious_octo_funicular/ -- the
mdbook is there but the layout is all wrong. According to @QuietMisdreavus the
mdbook CSS files are not being preserved and that's why the mdbook shows
unstyled.

This issue is to request that .css files placed in target/doc are preserved to
support the above use case.

@jyn514
Copy link
Member

jyn514 commented Feb 1, 2020

Hmm, I would like to support this, but I also don't want to copy .css files generated by rustdoc, since that would result in a lot of duplicated files for every crate.

@jyn514 jyn514 added the wishlist label Feb 1, 2020
@jyn514 jyn514 added S-needs-design Status: There's a problem here, but no obvious solution; or the solution raises other questions and removed wishlist labels Jun 27, 2020
@jyn514 jyn514 added the A-builds Area: Building the documentation for a crate label Jul 6, 2020
@jyn514
Copy link
Member

jyn514 commented Mar 27, 2021

This change was reverted because it broke search: #1329. I hope rust-lang/rust#83478 would allow relanding the change.

@jyn514
Copy link
Member

jyn514 commented Apr 4, 2021

I experimented a bit with getting an mdbook rendered on docs.rs and managed to
place the mdbook output in the target/doc directory using build scripts.

FYI we are hoping to add first-class support for mdbook at some point: #1293

@jyn514 jyn514 removed the S-needs-design Status: There's a problem here, but no obvious solution; or the solution raises other questions label Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-builds Area: Building the documentation for a crate
Projects
None yet
2 participants