Prabhat Ratnala
Prabhat Ratnala

Reputation: 705

Databricks link to cells using markdown

From Databricks documentation, I understand that we can link to other notebooks from a notebook as below:

%md
<a href="$./myNotebook">Link to notebook in same folder as current notebook</a>
<a href="$../myFolder">Link to folder in parent folder of current notebook</a>
<a href="$./myFolder2/myNotebook2">Link to nested notebook</a>

How can I link to a cell in the same notebook?

Upvotes: 7

Views: 3378

Answers (1)

Kombajn zbożowy
Kombajn zbożowy

Reputation: 10703

When in cell, note the URL - it has the form like:

https://<url>/?o=147804121238830#notebook/128991821126784/command/252704521328130
                                                                  ^^^^^^^^^^^^^^^
                                                                  this is cell id

When you change the cell that id will change correspondingly. So you can link to a cell using this:

%md

Go to <a href="#notebook/128991821126784/command/252704521328130">this cell</a>

Note that we're using HTML here, because standard Markdown links ([this cell](#notebook/...)) would be rendered with target="_blank" and open in new tab.

Upvotes: 5

Related Questions