Skip to content

Can not view book offline #711

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

Closed
serialhex opened this issue May 20, 2017 · 4 comments
Closed

Can not view book offline #711

serialhex opened this issue May 20, 2017 · 4 comments
Labels
blocked upstream Blocked on a change that needs to happen in a different repo first Online only

Comments

@serialhex
Copy link

After downloading the source and compiling with mdbook I went into the book directory, opened up a Chromium window and... Blank page. Tried Firefox, and again, the same thing happened. I attempted to figure out the problem, and I found it! It is the following lines in all of the *.html pages:

        <link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>


        <!-- Font Awesome -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">

        <!-- MathJax -->
        <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

        <!-- Fetch JQuery from CDN but have a local fallback -->
        <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
        <script>
            if (typeof jQuery == 'undefined') {
                document.write(unescape("%3Cscript src='jquery.js'%3E%3C/script%3E"));
            }
        </script>

You see, by including these lines in the HTML, you prevent anyone who doesn't have an active internet connection from reading the book. Not only can I not get to https://doc.rust-lang.org/book/ but the copy I downloaded and built locally won't load unless it gets these files.

But, my fine sir, you may say, does not every soul have access to this wonderful tool known as the internet?

NO! I have waited days to try to file this issue, as I do not have ready access to the internet. I have to plan on what I am going to do when I get access, so I can make the best use of my time. When getting the stuff for the book I made sure that I had Rust installed, and then I installed mdbook, and I am dreading the time in the near future where the book may say "Now cargo install some-package-with-lots-of-dependencies and look at how fast it compiles!" When all I can do is just sit there and cry inside because I have to wait a few DAYS until I can get back online.

Alas, your plight hath troubled me terribly so, you respond, but you are an insignificant minority I must say, and most people have access to the glorious internet. Thus, we can not - and shall not - help you I am sorry to say.

Okay, what about...

  • People in developing countries who want to learn to program and improve themselves.
  • Those who are behind government internet blockages (the Great Firewall of China).
  • Individuals who don't quite have enough money to pay $50/month for internet, to say nothing of TV or Netflix or the like.
  • etc...

While a PDF, EPUB or other completely offline version would be nice, simply including those *.js files locally would solve the problem and keep the formatting properly. I understand that there isn't much anyone can do about cargo install some-package-with-lots-of-dependencies without Universal Internet Access, but at least making everything local will make the learning experience much better for others.

Thank you for your time, and have a blessed day.

@carols10cents
Copy link
Member

carols10cents commented May 20, 2017

I agree this is a problem. There are multiple potential workarounds and solutions, most of which are going to be in mdbook in general rather than the Rust book specifically:

@carols10cents carols10cents added the blocked upstream Blocked on a change that needs to happen in a different repo first label May 20, 2017
@hschmidt
Copy link

As a stop gap, I've used

wget -r --no-parent https://doc.rust-lang.org/book/second-edition/
open doc.rust-lang.org/book/second-edition/index.html

on my Mac to grab a copy for offline reading.

@stappersg
Copy link
Contributor

May 2020 it now possible the view the book offline with

rustup docs --book

I think that allows us to close this issue ...

@serialhex
Copy link
Author

Just able to check this, and it works like a charm! Thank you to everyone who made this happen!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked upstream Blocked on a change that needs to happen in a different repo first Online only
Projects
None yet
Development

No branches or pull requests

5 participants