googlecolab / colabtools

Python libraries for Google Colaboratory
Apache License 2.0
2.18k stars 709 forks source link

Internal Links in Table of Contents Not Working in Google Colab #4880

Open ChathuryaKodipaka opened 2 hours ago

ChathuryaKodipaka commented 2 hours ago

Describe the current behavior Hello, I am encountering an issue with internal linking in Google Colab. Specifically, the markdown and HTML links I create in the Table of Contents to navigate to different sections within the notebook are not working as expected.

I created a Table of Contents using markdown with links to various sections of my notebook

Table of Contents

  1. EDA Overview
  2. EDA Detailed Analysis

EDA Overview

This section covers the overview of the dataset.

EDA Detailed Analysis

This section includes more detailed analysis and visualizations. I also tried using raw HTML for internal linking:

Table of Contents

  1. EDA Overview
  2. EDA Detailed Analysis

EDA Overview

This is the overview section.

EDA Detailed Analysis

This is the detailed analysis section.

In both cases, when I click the links, the notebook does not scroll to the intended sections as expected

Expected Behavior: Clicking on the links in the Table of Contents should navigate to the corresponding section in the notebook, allowing for smooth scrolling to different parts of the document.

Actual Behavior: When I click the links in the Table of Contents, nothing happens. The notebook does not navigate to the linked sections.

I’ve tried clearing cache, switching browsers, using incognito mode, but the issue persists. Additional Information: The same markdown and HTML linking approach works in Jupyter Notebooks but seems to fail in Google Colab. If there’s a specific workaround for this issue or if I’m missing something, please advise. Thank you for looking into this!

katlyn-edwards commented 2 hours ago

You might want to try Colab's built in Table of Contents (on the left side of the page, it's the icon that sort of looks like a bulleted list).

We also have the ability to insert a table of contents cell -- if you open the command palette and type in "Table of contents" that should be one of the options.

Otherwise, if you want help with your markdown, can you include a repro notebook?