rust-lang / rustup

The Rust toolchain installer
https://rust-lang.github.io/rustup/
Apache License 2.0
6.15k stars 883 forks source link

Present docs with local server #2151

Open black-puppydog opened 4 years ago

black-puppydog commented 4 years ago

When issuing rustup docs settings like the color scheme don't survive any link clicks (at least in my Firefox) and I think that is because they are being served as file:/// urls.

When compiling e.g. rust-by-example from source, the instructions are to run mdbook serve, which seems to spin up a local minimal server and open that via http:// instead. So I propose to either make this sort of behaviour default or a flag for the docs command.

Sorry if this has been proposed before, I couldn't find an appropriate issue.

P.S. I'm veryvery happy with the rust documentation. Jumping between Rust by Example and "The Book" in a problem-driven way is a lot of fun and gives me a good balance between learning modes. I love it, thanks all! :)

kinnison commented 4 years ago

There are a number of issues here which might prevent us doing a good job on this, but your desired functionality goal is absolutely worth trying to persue.

I would first like to ask @guillaumegomez if he knows why the colour scheme etc don't survive in Firefox and if there's anything we might do in rustdoc to improve that, though that won't solve the mdbook issues I imagine.

black-puppydog commented 4 years ago

Personally, if the color scheme was preserved, I'd have not bothered to make an issue. :P The rust-by-example playpen code doesn't seem to work offline anyhow (https://github.com/rust-lang/rust-by-example/issues/1105) so there shouldn't really be much of a difference if settings are preserved.

GuillaumeGomez commented 4 years ago

It's not just the colors but also the local storage: firefox consider each file as being its own website and therefore, it's unique to each file... Maybe it's worth looking if there's a way around by setting a root path or something along the line. I'll let someone open an issue. :)