External Links in Jupyter Notebooks Not Opening in New Tabs #2229
-
I'm using the al-folio theme for my GitHub Pages website, which includes a blog section. Some of my blog posts are Jupyter notebooks that have been converted to HTML. I've noticed that external links within these notebooks do not open in new tabs when clicked, but instead are opened directly within my webpage. I would like these links to open in new tabs to improve user experience. Has anyone an idea how to do that? See for example here: Thank you very much! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
For this you'll have to modify all the links inside the converted notebook to include In that code we retrieve the |
Beta Was this translation helpful? Give feedback.
For this you'll have to modify all the links inside the converted notebook to include
target="_blank"
. You can base this code on the code responsible for changing the jupyter notebook theme to dark/light.In that code we retrieve the
body
element from the notebook html code. From that point on you should be able to retrieve all the<a>
elements and modify them. If you manage to solve this, would you mind sending a PR?