Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: update "on this page" to only show headers up until level 3 and indent #180

Merged
merged 5 commits into from
Feb 22, 2024

Conversation

IgnaceMaes
Copy link
Member

@IgnaceMaes IgnaceMaes commented Feb 19, 2024

Implements #179

Before After

To be fair, this example doesn't properly showcase the real difference, and a real content page would be better suited to test.

EDIT: test using the Template Tag Format content:

Before After

Copy link

netlify bot commented Feb 19, 2024

Deploy Preview for guidemaker-ember-template ready!

Name Link
🔨 Latest commit e21f032
🔍 Latest deploy log https://app.netlify.com/sites/guidemaker-ember-template/deploys/65d7050a6f1ee70008393177
😎 Deploy Preview https://deploy-preview-180--guidemaker-ember-template.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@IgnaceMaes IgnaceMaes marked this pull request as ready for review February 19, 2024 21:18
<li>
<a href="#{{toc.id}}">{{toc.text}}</a>
</li>
{{#if (or (eq toc.depth '1') (eq toc.depth '2') (eq toc.depth '3'))}}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is pretty verbose, but keeps the component a TOC. Depth is passed as string, and changing that to a number would have a bigger impact and be outside of scope of this repo?

Copy link
Member

Choose a reason for hiding this comment

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

I'm happy with it as it is 👍 if you wanted to make this a helper like (should-show-toc-depth) then you could absorb the string/number issue there, but that's not necessary 👍

@IgnaceMaes IgnaceMaes changed the title feat: update "on this page" to only show headers up until level 3 and indent style: update "on this page" to only show headers up until level 3 and indent Feb 19, 2024
@IgnaceMaes IgnaceMaes added the enhancement New feature or request label Feb 21, 2024
Copy link
Member

@mansona mansona left a comment

Choose a reason for hiding this comment

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

Looks amazing 😍

@mansona mansona merged commit 7f29459 into ember-learn:main Feb 22, 2024
13 of 17 checks passed
@github-actions github-actions bot mentioned this pull request Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants