An anchor reference for ipython to bind a cell directly from the outside

I am writing documentation for a laptop-based platform. If I turn to important cells in a demo laptop, can I point to a specific cell using some kind of anchor?

For example, if I have a demo notepad at 127.0.0.1/mydemo, can I refer to the input cell In [10] with some anchor tag, for example 127.0.0.1/mydemo#In10

+6
source share
3 answers

Not for stable, but only for the header cell (1-6) on the host device. Just click on the header cell and it will put the correct anchor in the url string, usually #header_title_sanitized Using the invitation number is not a good idea, as this may change. It will also be supported on nbviewer, we are working on it.

+3
source

Creating internal links in Markdown works pretty well for me in practice. For example, you can create a table of contents by making a list in the markdown cell at the top of the page.

 *[jump to code cell 2](#cell2) *[jump to code cell 3](#cell3) *[jump to code cell 4](#cell4) 

Then you simply insert the markdown cell directly above the code cell to which you want to bind (for example, code cell 2). Just add one line of code:

 <a id="cell2"></a> 

See this guide for more details: http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/tutorials/table_of_contents_ipython.ipynb

+6
source

I like to use headers to organize my laptops, for example

 #My title 

in the markdown cell. Elsewhere, I can access this cell using

 [Link to my title](#My-title) 

in markdown (it looks like you should replace the spaces with a hyphen).

I got this from a more complete answer here .

+2
source

Source: https://habr.com/ru/post/945342/


All Articles