Skip to content
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

Zeal cannot display math formulas in PyTorch docsets #1302

Closed
ikyope opened this issue Dec 15, 2020 · 3 comments
Closed

Zeal cannot display math formulas in PyTorch docsets #1302

ikyope opened this issue Dec 15, 2020 · 3 comments

Comments

@ikyope
Copy link

ikyope commented Dec 15, 2020

The PyTorch docsets I use is from https://zealusercontributions.now.sh. I also tried generating PyTorch docsets myself from https://github.com/pytorch/pytorch/tree/master/docs. Zeral cannot display math formulas in both cases.

Following is an example: torch.ceil
Screenshot_20201215_140703
The line under "Returns a new tensor with the ..." should be a math formula:
Screenshot_20201215_141101

archlinux kde plasma desktop 5.20.4

@ikyope ikyope changed the title Zeal cannot display math formulas in pytorch docset Zeal cannot display math formulas in PyTorch docsets. Dec 15, 2020
@ikyope ikyope changed the title Zeal cannot display math formulas in PyTorch docsets. Zeal cannot display math formulas in PyTorch docsets Dec 15, 2020
@trollixx
Copy link
Member

trollixx commented Jan 28, 2021

This is happening because the docset doesn't bundle katex library.

Details
zeal.browser.urlrequestinterceptor: Blocked request: GET 'https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Math-Italic.woff2' (resource_type=5, navigation_type=0).
zeal.browser.urlrequestinterceptor: Blocked request: GET 'https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Main-Regular.woff2' (resource_type=5, navigation_type=0).
zeal.browser.urlrequestinterceptor: Blocked request: GET 'https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Main-Bold.woff2' (resource_type=5, navigation_type=0).
zeal.browser.urlrequestinterceptor: Blocked request: GET 'https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Size1-Regular.woff2' (resource_type=5, navigation_type=0).
zeal.browser.urlrequestinterceptor: Blocked request: GET 'https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Size4-Regular.woff2' (resource_type=5, navigation_type=0).
zeal.browser.urlrequestinterceptor: Blocked request: GET 'https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Size2-Regular.woff2' (resource_type=5, navigation_type=0).
zeal.browser.urlrequestinterceptor: Blocked request: GET 'https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Size3-Regular.woff2' (resource_type=5, navigation_type=0).
zeal.browser.urlrequestinterceptor: Blocked request: GET 'https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Caligraphic-Regular.woff2' (resource_type=5, navigation_type=0).
zeal.browser.urlrequestinterceptor: Blocked request: GET 'https://cdn.jsdelivr.net/npm/katex@0.10.0-beta/dist/katex.min.css' (resource_type=2, navigation_type=0).
zeal.browser.urlrequestinterceptor: Blocked request: GET 'https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css' (resource_type=2, navigation_type=0).
zeal.browser.urlrequestinterceptor: Blocked request: GET 'https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js' (resource_type=3, navigation_type=0).
zeal.browser.urlrequestinterceptor: Blocked request: GET 'https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js' (resource_type=3, navigation_type=0).

Docset generation needs to be fixed to include files fetched from cdn.jsdelivr.net.

@lf-
Copy link

lf- commented Feb 7, 2021

@trollixx I believe nobody is shipping this docset, so it would have to have been generated manually. How do I include such files with doc2dash? I've added -j which seems to add a javascript enable setting in the manifest of the docset, but it does not seem to resolve this problem.

Edit: I have also tried a bunch of app.add_javascript, which doesn't seem to resolve it either :(

@trollixx
Copy link
Member

PyTorch docset is generated from the official repository. It needs a fix to bundle katex library with the docset. Or maybe it's an issue with doc2dash, I am not sure. I would suggest reporting this issue to the PyTorch docset maintainers.

The current logic in Zeal prevents local pages from loading resources from the Internet. I'd argue referring to online resources defies the purpose of having offline documentation, and I don't want to change the default.

I believe Dash does allow online resources by default, and then offers DashDocSetBlocksOnlineResources property to explicitly block online access. Zeal does not support this property, but I think adding reverse logic would make more sense. If implemented, it would allow docset maintainers to override default blocking logic regardless of what I think is the right way of doing things. I created #1538 to track further work on this.

@trollixx trollixx closed this as not planned Won't fix, can't repro, duplicate, stale Sep 17, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants