4

When prototyping in python using a jupyter notebook, I sometimes have to jump to a given code cell located further down my current code cell, skipping cells in between.

I know how to add hyperlinks within a notebook to jump to any markdown cell from another, but this doesn't apply to code cells and requires a mouse click on the hyperlink.

I would like to jump to a given cell by running a command in a code cell. The target code cell would be referenced by a user defined label or tag (each code cell in the notebook may already have their own individual tag - how to identify it?)

How could I do this?

I could only manage to create a hyperlink to a markdown cell from within a code cell, as follows:

%%markdown 
[Next](#proper-markdown-cell-tag)

But this still requires a mouse click to jump to a markdown cell (and not a code cell). Sure this target markdown cell can be located right above the target code cell, but this still isn't what I want.


Note: the following SO answers were considered.

This could do the job but I can't chose to which particular cell I want to jump to.

Again this SO is about skipping certain cells rather than jumping to a specific one.

This is interesting: after running a code cell, the next code cell is selected, skipping through any markdown cell. I thought I could derive what I want from the solution but I was unable to.

calocedrus
  • 2,430
  • 20
  • 25
  • Do you mean that you want to select and go to the code cell (with scrolling and all)? If that's the case, I don't think that's possible is the current simple methods. You probably need to write an extension and JS code for that.. – Qusai Alothman Feb 23 '19 at 07:05
  • I'd like to move from the end of the execution of a code cell to a code cell of my choice, and land on that target code cell either in edit or command mode. Indeed it may require writing JS code, I'm opened to that type of solution as well. – calocedrus Feb 23 '19 at 07:34

0 Answers0