Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do internal links in Google Colab

I would like to make a reference list with the sections of my Colab notebook. The notebook is saved in my Google Drive.

I am trying HTML and Markdown hyperlinks, which work fine if the link is to an HTTP URL, but it is not working for internal Sections in the notebook.

For example, in a text cell I set the outline:

1. [Section 1](#s1)
2. [Section 2](#s2)

and in the destination section:

<a id='s1'></a>
#Section 1

.....

<a id='s2'></a>
#Section 2

The hyperlink in the list of the outline it is showed as a hyperlink but when I click on it or it does not do anything, or it opens a new tab in the browser with an error message:

enter image description here

Colab creates its own Content list using the markdown sections and subsections but internal links from one section to another are not possible.

like image 323
user1993416 Avatar asked Nov 18 '25 22:11

user1993416


1 Answers

With Colab you have to insert an <a name="id"></a> tag in the cell you want to link to.

The link works like normal:

[Link Text](#cell-id)

And the destination cell with the tag would be:

<a name="cell-id"></a>
# Heading
This is the cell I'm linking to
like image 134
alexalex Avatar answered Nov 22 '25 03:11

alexalex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!