docusaurus/website/docs/guides/markdown-features
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
..
_markdown-partial-example.mdx feat: details/summary theme / MDX component (#5216) 2021-07-27 18:45:12 +02:00
markdown-features-admonitions.mdx docs(website): document npm2yarn plugin + use new Tabs API everywhere (#5590) 2021-09-22 12:25:21 +02:00
markdown-features-assets.mdx docs(v2): Rewrite markdown images section (#5064) 2021-06-30 15:27:44 +02:00
markdown-features-code-blocks.mdx docs(website): document npm2yarn plugin + use new Tabs API everywhere (#5590) 2021-09-22 12:25:21 +02:00
markdown-features-head-metadatas.mdx feat: Markdown page-specific head metadatas (#5330) 2021-08-11 11:39:01 +02:00
markdown-features-headings.mdx docs(v2): fix markdown headings level 4 (#4526) 2021-03-29 17:23:20 +02:00
markdown-features-inline-toc.mdx feat(v2): allow specifying TOC max depth (themeConfig + frontMatter) (#5578) 2021-09-29 11:19:11 +02:00
markdown-features-intro.mdx refactor: improve styles of Details component (#5402) 2021-08-26 16:46:35 +02:00
markdown-features-math-equations.mdx docs(v2): replace diff codeblocks with line highlight (#4973) 2021-06-16 10:29:05 +02:00
markdown-features-plugins.mdx docs(v2): use explicit heading IDs (#4460) 2021-03-19 11:00:41 +01:00
markdown-features-react.mdx docs: clarify MDX version used (#5575) 2021-09-17 21:27:00 +03:00
markdown-features-tabs.mdx docs(website): document npm2yarn plugin + use new Tabs API everywhere (#5590) 2021-09-22 12:25:21 +02:00