Description
I am asking this for docs.rs.
Currently docs.rs is leveraging browser cache by serving every common css/js file ("rustdoc.css", "main.css", "main.js", "normalize.css", "*.woff"]) from root of the docs.rs. Otherwise docs.rs would serve 60k different copies of this files since rustdoc is generating them for each crate. Docs.rs is only replacing this file paths in documentations to provide a better/faster browsing experience.
But unfortunately new theme picker did break this feature and causing me some trouble to update rustc on docs.rs since it's not compatible.
I did a small talk with @GuillaumeGomez (the guy behind theme picker). He came up with an idea of adding a --replace
or --url
argument to rustdoc so this files can be served from a desired path. For example running rustdoc lib.rs --url main.css /main-1.24.css --url light.css /light-1.24.css
will replace this paths for the main.css and light.css.
This will make new theme picker compatible with docs.rs and also it will dramatically improve docs.rs by removing only necessary documentation change made by docs.rs.