Skip to content

Present docs with local server #2151

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

Open
black-puppydog opened this issue Dec 10, 2019 · 3 comments
Open

Present docs with local server #2151

black-puppydog opened this issue Dec 10, 2019 · 3 comments

Comments

@black-puppydog
Copy link

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
Copy link
Contributor

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
Copy link
Author

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 (rust-lang/rust-by-example#1105) so there shouldn't really be much of a difference if settings are preserved.

@GuillaumeGomez
Copy link
Member

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. :)

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

No branches or pull requests

3 participants