-
Notifications
You must be signed in to change notification settings - Fork 7
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
Link to HTML/Image not rendering properly #506
Comments
Hey @erykml, thanks for the report! To be clear I expect hyperlinks to only work on supported terminals. To my knowledge, the default macOS terminal and integrated VSCode temrinal do not support hyperlinks. But iTerm2 >3.1 absolutely should (it's what I use). Regardless of what terminal you use, I am surprised that you are getting that output though. It looks like nbpreview is actually doing what I want it to do, you can see that type of pattern as the expected output in the unit tests. But, I expected your terminal to format it nicely for you. For example, this is what it looks like on my machine when I try to render a link using macOS's default terminal. There is no clickable hyperlink, but I don't get the long path text you do. So right now:
Debugging
Temporary fixThis won't fix the hyperlink problem at all, but to make it less of an eyesore for now you can pass |
Hi @paw-lu! Thanks for the very fast answer! To answer your questions in order:
Hopefully, this will help with narrowing down the issue! And thanks for the temporary fix :) |
Thanks @erykml for helping me out with debugging! New theory is that it's your pager. Are you using a custom pager (ie not VerifyTo veriy that this is a pager issue. We can prevent nbpreview by writing to your pager with % nbpreview --no-paging notebook.ipynb If the issue has to do with your pager, then you should get working hyperlinks (on iTerm2 at least). DebugWhat do you have set for % echo $PAGER
% echo $LESS New fixesDisabling pagingLike we mentioned above, you can use the Set a new pagerSet a pager that can interpret the escape codes given. Does % PAGER='less -r' nbpreview --paging notebook.ipynb |
Hi @paw-lu, No worries, happy to help! Let me answer in order.
So based on those, seems like the pager is indeed at fault. Thanks for helping me out with this issue! |
Eh, the issue is the pager, but I didn't expect you to have such a standard setup. I suspeceted you might be using some exotic pager, but your setup is what 98% of users will have. It's identical to what I have actually. I was hoping nbpreview would just work on setups like this. Regardless, to be explict—for you and future users—you can fix this problem permentantly by setting export PAGER='less -r' This will also help with other clis as well. But this is a pretty frustrating first-impression for a standard setup. Let's keep this open for now to see if we can measure how common this is. Wonder if you have an older version of |
What happened?
Hi, first of all, great job with the library!
Coming back to the issue at hand, the links to HTML outputs (DataFrames) and Images do not work.
I have tried the default MacOS terminal, iterm2, and the terminal integrated into VS Code.
All of them look like the sample provided in the output field.
It happens with all the Notebooks I have (also saved using Jupyter Notebook and not VS Code).
nbpreview version
nbpreview 0.8.1
Output
8;id=410413;file:///var/folders/jg/42cx8xxn6_s1kcdc594gmf_w0000gn/T/tmprg7rbhah.html🌐 Click to view HTML8;;
Notebook
No response
OS
macos
Terminal
terminal/vs code terminal
Python version
Python 3.8.10
The text was updated successfully, but these errors were encountered: