Robzz / cargo-docset

Cargo subcommand to generate a Dash/Zeal docset for your Rust packages.
Apache License 2.0
100 stars 4 forks source link

Generated Docset doesn't "load" when running on stable #14

Closed mnmaraes closed 4 years ago

mnmaraes commented 4 years ago

Describe the bug After installing the created docset and visiting any page, the documentation is either missing or displays a Loading Content... indicator

To Reproduce I've tried running cargo docset --all at the root of my workspace on stable (1.40). Same thing happens if I try to generate docsets for individual projects (with cargo docset)

Expected behavior The full documentation should be displayed

Screenshots

Screen Shot 2019-12-30 at 7 10 29 PM Screen Shot 2019-12-30 at 7 12 59 PM

Desktop (please complete the following information):

Additional context Not context, just a comment: Thanks for your work on this. Let me know if I can assist in fixing

mnmaraes commented 4 years ago

Funnily enough, if I use vim to open the local html files generated by cargo doc, they're complete. So this couldn't be an issue with the page's js not running

Robzz commented 4 years ago

Thank you for the report, I will take a look at this tomorrow.

Robzz commented 4 years ago

Sorry, took a bit longer than I would have liked to get to it. I just tried rebuilding cargo-docset with the latest stable and generating a docset for tokio and opening it in Zeal, it seems to work, so we have a different behaviour between Zeal and Dash.

I had the same hunch as you did and figured it must be some javascript not running. That's where it gets weird, even when disabling all javascript it my browser, I get something more complete than that. I still think this is JS related, but... Weird.

The only idea I have is this. I haven't needed it so far, but please try removing the docset from dash, adding the line <key>isJavaScriptEnabled</key><true/> to the generated info.plist within the property dict and reinstalling the docset. If it fixes it, I'll update the generated info.plist file. If it doesn't, please post the full info.plist file you modified for me to double check.

mnmaraes commented 4 years ago

Yep. Adding the .plist entry has fixed the issue

Good catch! Thanks

Robzz commented 4 years ago

Okay, will add the entry and publish a new release shortly. Thank you :)

saskenuba commented 4 years ago

Weirdly enough I have the same issue even with the js fix applied, but on Zeal(git master). For a struct, the methods and traits sections are not rendered. And for the traits pages, there is this "Loading Content" message. But if I just right-click to open with desktop browser they fully show up.

The crate tested was: ws-rs, perhaps you can test it on your side?

Upon some investigation, I renamed rustdoc.css on <crate>.docset/contents/resources to something else, and the whole document rendered. My best guess is that the browser engine used on zeal is outdated (maybe those flexboxes classes used on the CSS?) because apparently they are having other issues related to rendering.

The rust docs available for download on zeal have the display: block at the sections I mentioned, instead of the display: flexbox.

Robzz commented 4 years ago

Sorry, I've been AWOL for a 'little' while and just noticed this. I'll try and verify this in the coming days.

Robzz commented 4 years ago

I can indeed verify this using Zeal v0.6.1, and renaming rustdoc.css indeed gets the section to render (although it mangles the document pretty bad). I'll search for a workaround.

Robzz commented 4 years ago

This seems to be fixed in Zeal master :tada: Most likely fixed by zealdocs/zeal#1125.