DEV Community

Boris Jamot ✊ /
Boris Jamot ✊ /

Posted on Edited on

How to Manage the TOC of Articles on dev.to?

I know there is no current standard in Markdown to write Table Of Content, but does anyone knows a trick to do it on dev.to?
Could it work by using HTML anchors?
But how can I know the future URL of the article I'm currently writing?

Any help would be welcome :)

Top comments (7)

✨ อัปเดตล่าสุด: biros/help how to manage the toc of articles on devto bp - Kapook Update 2025
 
rhymes profile image
rhymes •

You can use inline anchors with Markdown:

## TOC
  * [Chapter 1](#chapter-1)
  * [Chapter 2](#chapter-2)
  * [Chapter 3](#chapter-3)

### Chapter 1 <a name="chapter-1"></a>
✨ อัปเดตล่าสุด: biros/help how to manage the toc of articles on devto bp - Kapook Update 2025 ✨ อัปเดตล่าสุด: biros/help how to manage the toc of articles on devto bp - Kapook Update 2025

This way you don't need to know the final URL

✨ อัปเดตล่าสุด: biros/help how to manage the toc of articles on devto bp - Kapook Update 2025
 
shostarsson profile image
Rémi Lavedrine •

Thanks for the question and the answer.
I didn't know that trick and I am going to try it in my next post.

✨ อัปเดตล่าสุด: biros/help how to manage the toc of articles on devto bp - Kapook Update 2025
 
helenanders26 profile image
Helen Anderson •

Thank you! This is just what I’ve been looking for.

✨ อัปเดตล่าสุด: biros/help how to manage the toc of articles on devto bp - Kapook Update 2025
 
bennycode profile image
Benny Code •

The Editor Guide is also a nice resource to find out what's possible on dev.to: dev.to/p/editor_guide#markdown-links

✨ อัปเดตล่าสุด: biros/help how to manage the toc of articles on devto bp - Kapook Update 2025 Thread
 
iamtodor profile image
iamtodor •

I faced the issue when dev.to does not rended a few levels of table of content:

- [first](#first)
  * [second](#second)
    + [third](#third)

## first

first blah

### second 

second blah 

#### third

third blah
✨ อัปเดตล่าสุด: biros/help how to manage the toc of articles on devto bp - Kapook Update 2025 ✨ อัปเดตล่าสุด: biros/help how to manage the toc of articles on devto bp - Kapook Update 2025

While markdown is rendering it as three level of content dev.to renders it only as two. What is the best way to tackle this problem?

Image description

✨ อัปเดตล่าสุด: biros/help how to manage the toc of articles on devto bp - Kapook Update 2025 Thread
 
sfiquet profile image
Sylvie Fiquet •

I managed to get a third level by using a 5 space indent:

- level 1
  - level 2
     - level 3
✨ อัปเดตล่าสุด: biros/help how to manage the toc of articles on devto bp - Kapook Update 2025 ✨ อัปเดตล่าสุด: biros/help how to manage the toc of articles on devto bp - Kapook Update 2025
  • level 1
    • level 2
      • level 3

Not sure why a 4 space indent doesn't work, possibly because it's interpreted as code.

✨ อัปเดตล่าสุด: biros/help how to manage the toc of articles on devto bp - Kapook Update 2025
 
derlin profile image
Lucy Linder •

Most solutions I found on dev.to are so tedious, I created a tool to do it for you: derlin.github.io/bitdowntoc/ (choose the dev.to preset ;))

To know more, see my article: