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

docs: Add new tableOfContent script #6667

Merged
merged 4 commits into from
Nov 18, 2024
Merged

docs: Add new tableOfContent script #6667

merged 4 commits into from
Nov 18, 2024

Conversation

huguestennier
Copy link
Collaborator

@huguestennier huguestennier commented Nov 17, 2024

Replace hexo toc helper with our own tableOfContent to fix page rendering when the heading levels are in the wrong order (e.g. h3 before h2)

Testing

These page should render normally now:

https://deploy-preview-6667--label-studio-docs-new-theme.netlify.app/tags/timeseries
https://deploy-preview-6667--label-studio-docs-new-theme.netlify.app/templates/generative-pairwise-human-preference

Also fixed where the toc wasn’t showing if there was no <h2>:

https://deploy-preview-6667--label-studio-docs-new-theme.netlify.app/tags/table

Other pages should show the toc same as before:

https://deploy-preview-6667--label-studio-docs-new-theme.netlify.app/guide/storedata

Copy link

netlify bot commented Nov 17, 2024

Deploy Preview for label-studio-docs-new-theme ready!

Name Link
🔨 Latest commit 2d33194
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-docs-new-theme/deploys/673b5da4fed2760009fb642f
😎 Deploy Preview https://deploy-preview-6667--label-studio-docs-new-theme.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.

Copy link

netlify bot commented Nov 17, 2024

Deploy Preview for heartex-docs ready!

Name Link
🔨 Latest commit 2d33194
🔍 Latest deploy log https://app.netlify.com/sites/heartex-docs/deploys/673b5da4c50d050008778c0d
😎 Deploy Preview https://deploy-preview-6667--heartex-docs.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.

@huguestennier huguestennier changed the title Add new tableOfContent script docs: Add new tableOfContent script Nov 17, 2024
@caitlinwheeless
Copy link
Contributor

Can we remove the empty TOC box if there are no headings? e.g. https://deploy-preview-6667--label-studio-docs-new-theme.netlify.app/guide/glossary

@huguestennier
Copy link
Collaborator Author

Can we remove the empty TOC box if there are no headings? e.g. https://deploy-preview-6667--label-studio-docs-new-theme.netlify.app/guide/glossary

GAH! Yes, updated. Hadn’t see that use case - thank you

@huguestennier huguestennier merged commit 979d8b8 into develop Nov 18, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants