-
Notifications
You must be signed in to change notification settings - Fork 84
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
Create unique url's / anchors for each code cell #310
Comments
This is a cool idea - I'm not sure where the best place would be to implement this, since we'd be bottlenecked on how Sphinx itself handles cross-refs (I think that you must put a label just before a header title, for example). But would be cool to experiment with and implement. |
Oh its already in my thinking for myst-nb: I've already implemented a similar thing previously for ipypublish: https://ipypublish.readthedocs.io/en/latest/code_cells.html#plots-with-matplotlib |
Nice - shall we move this to myst-nb then? |
Yep sounds good 👍 |
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
Anchors for cell based on cell IDs have been implemented in JupyterLab (jupyterlab/jupyterlab#13285) and nbconvert (jupyter/nbconvert#1897). There is also a related issue open on Jupyter Book repo jupyter-book/jupyter-book#1812. |
Could the Edit: I mean having a function similar to existing |
@chrisjsewell would you agree that the above proposal of exposing |
#519 is ready for review; I will need help over there - despite many attempts the slugs do not get embedded as identifiers in the cells. It seems like the target processing code does not get invoked but I cannot narrow it down why. |
Is your feature request related to a problem? Please describe.
Very often, once I have created a resource on JB, I find myself wanting to link to specific code cells to illustrate a solution for questions from students, for example.
Describe the solution you'd like
I know it is possible to create unique links with the
(<id>)=
pattern but this'd require to manually hardcode it on to every code cell just in case/for when some of them will be required.Ideally, in a similar way to how there is a button that appears on the cell to copy the code, there'd be another one that provides a unique and direct URL to that code cell (it could perhaps be related to the cell number/position in the underlying notebook?).
Describe alternatives you've considered
Currently I default to link to the closest section on which that cell belongs to, and mostly works; or create manual links if I know I'll need them.
The text was updated successfully, but these errors were encountered: