Skip to content

Preserve .css files in target/doc #294

@japaric

Description

@japaric
Member

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.

Activity

jyn514

jyn514 commented on Feb 1, 2020

@jyn514
Member

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.

added
S-needs-designStatus: There's a problem here, but no obvious solution; or the solution raises other questions
and removed on Jun 27, 2020
added
A-buildsArea: Building the documentation for a crate
on Jul 6, 2020
jyn514

jyn514 commented on Mar 27, 2021

@jyn514
Member

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

reopened this on Mar 27, 2021
jyn514

jyn514 commented on Apr 4, 2021

@jyn514
Member

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

removed
S-needs-designStatus: There's a problem here, but no obvious solution; or the solution raises other questions
on Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-buildsArea: Building the documentation for a crate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @japaric@jyn514

      Issue actions

        Preserve .css files in target/doc · Issue #294 · rust-lang/docs.rs