Skip to content

Fix sidebar header tree creation - #3021

Merged
Jake Bailey (jakebailey) merged 1 commit into
microsoft:v2from
oddmj:laranhee-patch-1
Jun 5, 2024
Merged

Fix sidebar header tree creation#3021
Jake Bailey (jakebailey) merged 1 commit into
microsoft:v2from
oddmj:laranhee-patch-1

Conversation

@oddmj

Copy link
Copy Markdown
Contributor

I don't think the depth structure of the document's sidebar represents the depth of the headers in the document very well.

This makes it a little difficult to understand the content.

For example, for "Narrowing" in the handbook, the header in the document looks like this

## `typeof` type guards
# Truthiness narrowing
## Equality narrowing
## The `in` operator narrowing
## `instanceof` narrowing
## Assignments
## Control flow analysis
## Using type predicates
## Assertion functions
# Discriminated unions
# The `never` type
# Exhaustiveness checking

In the sidebar on the current page, it looks like this

image

I think this makes more sense. because I think all the h1s should be 1-depth, and the first h2 should be 1-depth.

image

I've also found cases like this with "template-literal-types", "conditional-types", etc.

@oddmj

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@jakebailey Jake Bailey (jakebailey) added the deploy-preview Enables automatic deployments to preview environments on a PR label Jun 5, 2024
@github-actions

github-actions Bot commented Jun 5, 2024

Copy link
Copy Markdown
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-plant-05c166c10-3021.centralus.5.azurestaticapps.net

@jakebailey Jake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this definitely looks better.

@jakebailey
Jake Bailey (jakebailey) merged commit ed73d81 into microsoft:v2 Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy-preview Enables automatic deployments to preview environments on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants