-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
feat(v2): inline table-of-contents + refactor TOC #3904
Conversation
✔️ Deploy preview for docusaurus-2 ready! 🔨 Explore the source changes: 2127893 🔍 Inspect the deploy logs: https://app.netlify.com/sites/docusaurus-2/deploys/5fd38cb5a7cc8100086daa56 😎 Browse the preview: https://deploy-preview-3904--docusaurus-2.netlify.app |
Size Change: +15 B (0%) Total Size: 154 kB ℹ️ View Unchanged
|
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-3904--docusaurus-2.netlify.app/classic/ |
Is it possible to add additional indentation levels beyond H3? |
Not currently but please open an issue and we'll add support for this later
Le sam. 12 déc. 2020 à 07:52, Mitch <notifications@github.com> a écrit :
… Is it possible to add additional indentation levels beyond H3?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#3904 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFW6PQL4FAVU2HKWZDX7RTSUMHJLANCNFSM4UWW4ZEQ>
.
|
Docusaurus v1 had a feature to add table of contents directly to the body of a document.
https://docusaurus.io/docs/en/doc-markdown#generating-table-of-contents
Put a
<AUTOGENERATED_TABLE_OF_CONTENTS>
somewhere in a md doc, and it renders an inline TOC.This is used on Jest, and required for the v2 migration.
This is actually pretty easy to implement with MDX, as the TOC tree is already exposed to each md doc thanks to the mdx loader.
It can also display a partial TOC derived from the original TOC, and gives flexibility to the user:
Related to: #1549
Doc: https://deploy-preview-3904--docusaurus-2.netlify.app/classic/docs/markdown-features#inline-table-of-contents
Breaking changes
rightToc
renamed to justtoc
(as the position of the toc depends on the theme, not always on the rightheadings
totoc
.<TOC headings={rightToc}/>
becomes<TOC toc={toc}/>