question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add anchors to filepath?

See original GitHub issue

Is it possible to, when using filepath= to open a specific file, specify a section/anchor to jump to? For example, if I have this in my file myfile.ipynb:

<a id='section2'></a>

I’d love to be able to use filepath=myfile.ipynb#section2 to open that file to that anchor.

It looks like something currently sees # in filepath and redirects me to a prompt to enter a token or password. I’ve tried various things with urlpath as well.

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
bitnikcommented, May 28, 2019

BinderHub uses a token to access to the notebook server for each launch (for each temporary user). Just before redirecting to user server, it logs “server running at …/tree?token=xyz”. But in your case server url becomes “/tree/myfile.ipynb#section2?token=xyz” and because token parameter is behing #, it is ignored and you are redirected to login page. So I think it is now not possible to have a file path with anchor.

To have it working the server url must be generated as “/tree/myfile.ipynb?token=xyz#section2” and I think this can be achived by updating here: https://github.com/jupyterhub/binderhub/blob/5544f704cb0dd9b8d3d67442a0c744e1ddcb6089/binderhub/static/js/src/image.js#L37-L58

0reactions
manicscommented, Sep 20, 2021

Hi 👋 I think this is something that has to be handled by the application (JupyterLab or notebook), not BinderHub. If you have more questions please use the Jupyter community forum https://discourse.jupyter.org/.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I enter file paths into a link? (Both local and UNC ...
How do I enter file paths into a link? (Both local and UNC Names). The "correct" link format is file:/// followed by the...
Read more >
The Anchor Tag, Relative and Absolute URLs - UC Homepages
The Anchor Tag, Relative and Absolute URLs ... Virtual directory: a directory that follows the / after plantplaces.com. This is usually mapped to...
Read more >
HTML Anchors: Here's How To Create Links For Fast ...
Learn how to create HTML hyperlinks. This guide covers the anchor element and all of it's attributes.
Read more >
how to give link to a file to the folder within the subfolder using ...
I want to link the aspx files using the anchor tag. i tried like this. <a href="/Home.aspx">Home</ ...
Read more >
Linking - Adobe Support
Link files and documents, update, change, and test links in Dreamweaver. ... Type the path and filename of the document in the Link...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found