docusaurus/packages
Erick Zhao c86dfbda61
feat(v2): allow specifying TOC max depth (themeConfig + frontMatter) (#5578)
* feat: add all TOC levels to MDX loader

* feat: add theme-level config for heading depth

* test: add remark MDX loader test

* fix: limit maxDepth validation to H2 - H6

* refactor: set default `maxDepth` using `joi`

* refactor: `maxDepth` -> `maxHeadingLevel

* refactor: invert underlying TOC depth API

* refactor: make TOC algorithm level-aware

* feat: add support for per-doc TOC heading levels

* feat: support document-level heading levels for blog

* fix: correct validation for toc level frontmatter

* fix: ensure TOC doesn't generate redundant DOM

* perf: simpler TOC heading search alg

* docs: document heading level props for `TOCInline`

* Update website/docs/guides/markdown-features/markdown-features-inline-toc.mdx

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* docs: fix docs (again)

* create dedicated  test file for heading searching logic: exhaustive tests will be simpler to write

* toc search: add real-world test

* fix test

* add dogfooding tests for toc min/max

* add test for min/max toc frontmatter

* reverse min/max order

* add theme minHeadingLevel + tests

* simpler TOC rendering logic

* simplify TOC implementation (temp, WIP)

* reverse unnatural order for minHeadingLevel/maxHeadingLevel

* add TOC dogfooding tests to all content plugins

* expose toc min/max heading level frontmatter to all 3 content plugins

* refactor blogLayout: accept toc ReactElement directly

* move toc utils to theme-common

* add tests for filterTOC

* create new generic TOCItems component

* useless css file copied

* fix toc highlighting className conflicts

* update doc

* fix types

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-09-29 11:19:11 +02:00
..
docusaurus chore: upgrade dependencies (#5608) 2021-09-24 16:36:41 +02:00
docusaurus-cssnano-preset chore: upgrade dependencies (#5608) 2021-09-24 16:36:41 +02:00
docusaurus-init chore: upgrade dependencies (#5608) 2021-09-24 16:36:41 +02:00
docusaurus-mdx-loader feat(v2): allow specifying TOC max depth (themeConfig + frontMatter) (#5578) 2021-09-29 11:19:11 +02:00
docusaurus-migrate chore: upgrade dependencies (#5608) 2021-09-24 16:36:41 +02:00
docusaurus-module-type-aliases fix(module-type-aliases): move @type packages to dependencies (#5601) 2021-09-22 14:49:25 +02:00
docusaurus-plugin-client-redirects chore: upgrade dependencies (#5608) 2021-09-24 16:36:41 +02:00
docusaurus-plugin-content-blog feat(v2): allow specifying TOC max depth (themeConfig + frontMatter) (#5578) 2021-09-29 11:19:11 +02:00
docusaurus-plugin-content-docs feat(v2): allow specifying TOC max depth (themeConfig + frontMatter) (#5578) 2021-09-29 11:19:11 +02:00
docusaurus-plugin-content-pages feat(v2): allow specifying TOC max depth (themeConfig + frontMatter) (#5578) 2021-09-29 11:19:11 +02:00
docusaurus-plugin-debug chore: upgrade dependencies (#5608) 2021-09-24 16:36:41 +02:00
docusaurus-plugin-google-analytics refactor(plugin-google-gtag, plugin-google-analytics): migrate packages to TS (#5561) 2021-09-22 11:36:04 +02:00
docusaurus-plugin-google-gtag refactor(plugin-google-gtag, plugin-google-analytics): migrate packages to TS (#5561) 2021-09-22 11:36:04 +02:00
docusaurus-plugin-ideal-image chore: upgrade dependencies (#5608) 2021-09-24 16:36:41 +02:00
docusaurus-plugin-pwa chore: upgrade dependencies (#5608) 2021-09-24 16:36:41 +02:00
docusaurus-plugin-sitemap chore: upgrade dependencies (#5608) 2021-09-24 16:36:41 +02:00
docusaurus-preset-bootstrap chore(v2): prepare v2.0.0-beta.6 release (#5473) 2021-09-02 18:31:42 +02:00
docusaurus-preset-classic fix(preset-classic): fix TS build issue (#5603) 2021-09-22 12:15:39 +02:00
docusaurus-remark-plugin-npm2yarn polish: remove unused eslint-disable (#5560) 2021-09-21 18:07:54 +02:00
docusaurus-theme-bootstrap polish: remove unused eslint-disable (#5560) 2021-09-21 18:07:54 +02:00
docusaurus-theme-classic feat(v2): allow specifying TOC max depth (themeConfig + frontMatter) (#5578) 2021-09-29 11:19:11 +02:00
docusaurus-theme-common feat(v2): allow specifying TOC max depth (themeConfig + frontMatter) (#5578) 2021-09-29 11:19:11 +02:00
docusaurus-theme-live-codeblock chore: upgrade dependencies (#5608) 2021-09-24 16:36:41 +02:00
docusaurus-theme-search-algolia chore: upgrade dependencies (#5608) 2021-09-24 16:36:41 +02:00
docusaurus-types feat(v2): allow specifying TOC max depth (themeConfig + frontMatter) (#5578) 2021-09-29 11:19:11 +02:00
docusaurus-utils chore: upgrade dependencies (#5608) 2021-09-24 16:36:41 +02:00
docusaurus-utils-common chore: upgrade dependencies (#5608) 2021-09-24 16:36:41 +02:00
docusaurus-utils-validation feat(v2): allow specifying TOC max depth (themeConfig + frontMatter) (#5578) 2021-09-29 11:19:11 +02:00
lqip-loader chore: upgrade dependencies (#5608) 2021-09-24 16:36:41 +02:00
stylelint-copyright chore(v2): prepare v2.0.0-beta.6 release (#5473) 2021-09-02 18:31:42 +02:00