chocolatey / chocolatey/docs

Headings inside components are not in the table of contents

Open
#1,235 0 comments 0 reactions 0 assignees View on GitHub
0 - Backlog Enhancement
Dominant language
MDX
Stars
223
Forks
248
Avg merge
1d 26m
Merged PRs (30d)
4

Description

### What You Are Seeing?

If a heading is inside of a component and imported into an .mdx file, that heading does not appear in the table of contents for the page.

### What is Expected?

Unfortunately, this is working as designed. Astro does not natively support this. Thinking about this issue more, headings should _not_ be inside of components at all. A big reason for this is that the heading level may be different based on the content of the page. Using the wrong heading level will hurt accessibility.

It has been decided that instead of placing headings inside of components, all heading should be in the original .mdx file, and only the content be pulled into a component. This will give us:

1. Control over the heading levels.
2. It will automatically be added to the TOC like other headings.

### How Did You Get This To Happen? (Steps to Reproduce)

1. Go to https://docs.chocolatey.org/en-us/licensed-extension/compatibility/
2. Notice the heading "Chocolatey Component Package Dependencies" is not in the right side TOC.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.