HumanSignal / label-studio

Label Studio is a multi-type data labeling and annotation tool with standardized output format
https://labelstud.io
Apache License 2.0
19.44k stars 2.42k forks source link

docs: Add new tableOfContent script #6667

Closed huguestennier closed 3 days ago

huguestennier commented 5 days ago

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

netlify[bot] commented 5 days ago

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

Name Link
Latest commit 2d331949e9e3b43c112cbbe42c7dda7fc7c77b8c
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.

netlify[bot] commented 5 days ago

Deploy Preview for heartex-docs ready!

Name Link
Latest commit 2d331949e9e3b43c112cbbe42c7dda7fc7c77b8c
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.

caitlinwheeless commented 4 days ago

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 commented 4 days ago

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