0

I want to remove the top-level section from an auto-generated table of contents. I'm using VS Code Extension Markdown All In One.

Given this example

# My Header

## First Section

hello

## Second Section

goodbye

Using Markdown All In One in VS Code, I select command Markdown All In One: Update Table Of Contents. It generates the following table of contents

- [My Header](#my-header)
  - [First Section](#first-section)
  - [Second Section](#second-section)

I want the following table of contents

- [First Section](#first-section)
- [Second Section](#second-section)

1 Answer 1

0

Append the header with a special comment <!-- omit in toc -->.

So the example markdown becomes

# My Header <!-- omit in toc -->

## First Section

hello

## Second Section

goodbye

then the generated table of contents will be

- [First Section](#first-section)
- [Second Section](#second-section)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.