steveklabnik / rustdoc

Not a real thing, see https://github.com/rust-lang/rust for rustdoc's actual source code
https://github.com/rust-lang/rust
104 stars 22 forks source link

Example has blank output #185

Open gnzlbg opened 6 years ago

gnzlbg commented 6 years ago

The readme says:

Currently, it only builds the given example. Do it as follow:

`cargo run --release -- --manifest-path=example/Cargo.toml`
Then open a web browser and open "rustdoc/example/target/doc/index.html".

When I do that, the website is completely blank. This is the output:

 Generating save analysis data: Done
  Loading save analysis data: Done
  Generating JSON: Done
  Copying Assets: Done
gnzlbg commented 6 years ago

Chrome dev-tools says:

Subresource Integrity: The resource 'file:////.../rustdoc/example/target/doc/assets/vendor-d41d8cd98f00b204e9800998ecf8427e.css' has an integrity attribute, but the resource requires the request to be CORS enabled to check the integrity, and it is not. The resource has been blocked because the integrity cannot be enforced.
gnzlbg commented 6 years ago

So I've found the culprit, it is not a static site... I need to run a webserver to open it:

$ python -m SimpleHTTPServer PORT

and then opening http://localhost:PORT did the trick.

steveklabnik commented 6 years ago

It should work without needing that. We should fix the integrity issue.

projektir commented 6 years ago

Hmm, I had it working by running npm install and npm start in the frontend folder, then it puts it on http://localhost:4200/example.

mgattozzi commented 6 years ago

You shouldn't have to run npm start is the problem. npm start starts a server like SimpleHTTPServer to serve the docs. You should just navigate to it like rustdoc today. I swear we had another issue for this but I can't seem to find it.

ehuss commented 6 years ago

I'm not sure it's possible for this to work with file urls in Chrome. Running Chrome with --allow-file-access-from-files seems to allow it to work.

steveklabnik commented 6 years ago

ah, bummer. hmmm

gnzlbg commented 6 years ago

Is this an intrinsic problem with ember ?

steveklabnik commented 6 years ago

No, with Chrome not letting you ajax in a file://.

ehuss commented 6 years ago

It's not just the XMLHttpRequest. The Subresource Integrity checks also fail, preventing any of the css/js from loading. I tried messing with setting crossorigin, but I couldn't find a way to get it to work (without command-line options).

I think it means commands like cargo doc --open would no longer work with Chrome. I'm trying to think of a good workaround, but I don't have any ideas.