Commit graph

66 commits

Author SHA1 Message Date
Jody Heavener
683ba3d2a0
feat(docs,blog,pages): add support for "unlisted" front matter - hide md content in production (#8004)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
2022-11-03 14:31:41 +01:00
mturoci
aa4fa66794
fix(theme-classic): fix SkipToContent without JS , refactor, make it public theming API (#8204)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
2022-10-19 18:27:08 +02:00
Rashid
79b3f65a17
fix(live-codeblock): add error boundary to live code preview (#8015)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
2022-10-13 17:49:27 +02:00
Sébastien Lorber
6f63ffe0a3
refactor(theme): split admonitions, make swizzle easier, better retrocompatibility (#7945)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
2022-09-07 17:49:44 +02:00
Sébastien Lorber
c811d6249e
feat(theme): ability to use <DocCardList> without items prop, on any doc page (#8008) 2022-08-26 17:42:59 +02:00
Sébastien Lorber
bc0538f6fa
refactor(theme-common): move useDocsPreferredVersion() to public api (#7729) 2022-07-06 17:58:18 +02:00
Sébastien Lorber
afc08eef4f
refactor(theme): move LayoutProviders to Layout/Provider; composeProviders util (#7676)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
2022-06-24 18:36:27 +02:00
Sébastien Lorber
2c7012f706
refactor(theme-common): rename useDynamicCallback to useEvent (#7671) 2022-06-24 12:10:03 +02:00
Sébastien Lorber
9473508c33
refactor(theme-common): split package into public/internal API entrypoints (#7660)
* add theme-common/internal export

* Split @docusaurus/theme-common into public/internal apis

* fixes

* public <-> private

* public <-> private

* public <-> private

* fix

* add "removeThemeInternalReexport" CI script

* :s windows CI check not working: not that useful

* remove bad import

* refactors

* reorder

* make useBackToTopButton internal

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
2022-06-24 11:21:27 +02:00
Sébastien Lorber
fd87afd249
refactor(docs,theme): split DocItem comp, useDoc hook (#7644)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
2022-06-22 14:27:23 +02:00
Joshua Chen
710f898703
refactor(theme-classic): multiple re-arrangements (#7273)
* refactor(theme-classic): enforce collocated JSX and module CSS

* refactor
2022-04-30 12:29:54 +08:00
Sébastien Lorber
2a0f105434
refactor(theme-classic): DocPage theme refactors polish (#7268) 2022-04-29 19:34:40 +02:00
Sébastien Lorber
3bef88232f
refactor: extract useSkipToContent() (#7269) 2022-04-29 19:16:02 +02:00
Alexey Pyltsyn
4e4aa6add7
feat(theme-classic): toggle code wrap button (#7036)
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
2022-04-22 14:50:27 +02:00
Alexey Pyltsyn
ad1526aade
refactor: control base styling of code blocks via CSS vars (#7172)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
2022-04-14 18:16:39 +02:00
Alexey Pyltsyn
ee4c984bc7
feat(theme-classic): code block showLineNumbers (#7007) 2022-04-13 14:42:35 +02:00
Joshua Chen
e5bf59fd9b
refactor: mark a few client-side packages as side-effect-free (#7085)
* refactor: mark a few client-side packages as side-effect-free

* fix

* fix again

* fix...

* revert sideeffect

* revert

* fix again...

* properly fix

* fix

* properly fix
2022-04-09 09:08:18 +08:00
Joshua Chen
1156be3f20
refactor(content-{blog,docs}): unify handling of tags (#7117) 2022-04-07 15:58:21 +02:00
Joshua Chen
13e7de853e
refactor(theme-classic): extract doc-related navbar items' logic to theme-common (#7067) 2022-03-30 14:50:04 +08:00
Joshua Chen
2e79597f83
feat(theme-classic): show blog sidebar on mobile (#7012)
* feat(theme-classic): show blog sidebar on mobile

* fix

* oops

* docs

* add a little margin

* Update display.tsx

* Update content.tsx

* reformat
2022-03-30 09:15:54 +08:00
Joshua Chen
cb03764ce5
refactor(theme): extract plumbing code of BTT button into theme-common (#7021)
* refactor(theme): extract plumbing code of BTT button into theme-common

* oops
2022-03-26 21:05:48 +08:00
Joshua Chen
b456a64f61
feat(theme-common): JSDoc for all APIs (#6974)
* feat(theme-common): JSDoc for all APIs

* fix tests
2022-03-23 21:39:19 +08:00
Joshua Chen
948271a0ff
test: improve test coverage; reorder theme-common files (#6956)
* test: improve test coverage; reorder theme-common files

* no need for this
2022-03-22 15:33:55 +08:00
Sébastien Lorber
74f653dd82
refactor(theme-{classic,common}): change how site/page/search metadata is handled (#6925) 2022-03-18 18:53:00 +01:00
Sébastien Lorber
a1d333e96b
refactor(theme-{classic,common}): split navbar into smaller components + cleanup + swizzle config (#6895) 2022-03-18 16:21:53 +01:00
Alexey Pyltsyn
ecbe0b26c5
refactor(theme-{classic,common}): refactor ColorModeToggle + useColorMode() hook (#6930)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2022-03-18 15:28:35 +01:00
Sébastien Lorber
8a1421a938
feat(core,theme): useRouteContext + HtmlClassNameProvider (#6933)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
2022-03-18 10:57:32 +01:00
Joshua Chen
cc0bceab9c
chore: tighten ESLint config (#6931)
* chore: tighten ESLint config

* more refactor

* refactor push

* fix
2022-03-17 17:59:41 +08:00
Sébastien Lorber
1efc6c6091
refactor(theme-classic): split theme footer into smaller components + swizzle config (#6894)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
2022-03-11 14:55:53 +01:00
Joshua Chen
c387a177e8
refactor(theme-common): unify missing context errors (#6826)
* refactor(theme-common): unify missing context errors

* update test

* more robust
2022-03-03 22:26:56 +08:00
Sébastien Lorber
ece7399d2e
fix(theme-classic): fix breadcrumb home link bug with new useHomePageRoute() hook (#6749) 2022-02-24 11:27:16 +01:00
Joshua Chen
c3370be64d
refactor: make MDX export a flat TOC list instead of tree (#6729) 2022-02-23 15:12:04 +01:00
Jody Heavener
3629b5ab39
feat(docs,theme-classic): docs breadcrumbs (#6517)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
2022-02-16 19:02:58 +01:00
Joshua Chen
01c6f15b15
fix(theme-classic): make focused link outlined with JS disabled (#6505) 2022-02-03 18:28:10 +01:00
Joseph
8ce3cee400
feat(theme-classic): auto-collapse sibling categories in doc sidebar (#3811)
Co-authored-by: Josh-Cena <sidachen2003@gmail.com>
2022-01-20 16:38:16 +01:00
Sébastien Lorber
f87a3ead46
refactor: move @theme/hooks to @docusaurus/theme-common (#6289) 2022-01-07 19:19:35 +01:00
Christopher Klint
d987c22996
feat(theme-classic): new configuration syntax for a simple footer (#6132)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
2021-12-20 19:45:27 +01:00
Alexey Pyltsyn
58720c93e8
refactor: simplify Toggle component (#6049) 2021-12-05 09:31:57 +08:00
Sébastien Lorber
cfae5d0933
feat(content-docs): sidebar category linking to document or auto-generated index page (#5830)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Co-authored-by: Armano <armano2@users.noreply.github.com>
Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
2021-12-03 14:44:59 +01:00
Armano
425144afc7
refactor(theme-search-algolia): migrate package to TS (#5935) 2021-11-16 20:35:09 +01:00
Joshua Chen
d1308a8736
refactor: improve setup of type declaration files (#5914) 2021-11-12 17:47:27 +01:00
Joshua Chen
334470b5d4
refactor(theme-classic): move some logic of CodeBlock to theme-common (#5922) 2021-11-12 16:43:40 +01:00
Sergio Moreno
adbc02ea38
feat(search-algolia): algolia externalUrl regex to navigate with window.href (#5795) 2021-10-29 19:53:47 +02:00
Sébastien Lorber
098f210890
chore: Enable ESLint rules of hooks + fix new lint errors (#5714) 2021-10-20 16:09:52 +02:00
Joshua Chen
c8739ec28e
polish(theme-classic): guard against potential definition mistakes in Tabs (#5674) 2021-10-14 15:47:03 +02:00
Shrugsy
7868df13f1
feat: maintain page position for clicked grouped tabs (#5618)
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-10-13 19:08:00 +02:00
Bharat Middha
09550b0535
feat: properly type-check the Docusaurus config of new sites (#5589)
* fix: makes types DocusaurusConfig optional to match docs

* add UserDocusaurusConfig with required keys for user config

* convert UserDocusaurusConfig to use util type

* Docusaurus website config should be type-checked by CI + fix all existing issues

* add doc for config typechecking

* Update template configs for TS autocompletion

* fix last config typechecking bugs

* reapply prettier

* reapply prettier-docs

* Fix TS doc: add missing ()

* fix some docu plugin types

* add "const config" for simpler jsdoc annotation

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-09-30 17:49:44 +02:00
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
Sébastien Lorber
f361e89b14
feat: on back navigation, close mobile sidebar (#5462)
* On back, close mobile navbar sidebar

* more reliable code to block history pop events

* android backbutton: just close the drawer without cancellin the backward navigation
2021-09-02 16:03:17 +02:00
Isaac Philip
f9c79cbd58
feat: doc tags (same as blog tags) (#3646)
* [v2] tags to doc, same as tags to blog - [IN PROGRESS]

- Addition of plugin-content-docs

- Addition of DocTagsListPage in `docusaurus-theme-classic`

! Error exists for this commit towards the theme aspect and help required.

Commit towards #3434

* docs: make tags list page work

* temp: disable onBrokenLinks

* theme bootstrap: create DocTagsListPage

* DocTagsPage added and functionality too

- individual doc tag page added to show docs for that specific tag

* Added all Docs Tags Link

* add some shared tag utils

* move tag tests to _dogfooding

* fix type

* fix some tests

* fix blog test

* refactor blog post tags handling

* better yaml tag examples

* better dogfood md files

* refactor and factorize theme tag components

* finish DocTagDocListPage

* Extract DocItemFooter + add inline tag list

* minor fix

* better typings

* fix versions.test.ts tests

* add tests for doc tags

* fix tests

* test toTagDocListProp

* move shared theme code to tagUtils

* Add new theme translation keys

* move common theme code to tagUtils + add tests

* update-code-translations should handle theme-common

* update french translation

* revert add translation

* fix pluralization problem in theme.docs.tagDocListPageTitle

* add theme component configuration options

* add more tags tests

* add documentation for docs tagging

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-08-19 10:31:15 +02:00