Commit graph

23 commits

Author SHA1 Message Date
Joshua Chen
1156be3f20
refactor(content-{blog,docs}): unify handling of tags (#7117) 2022-04-07 15:58:21 +02:00
Joshua Chen
2bcac29cd4
refactor(content-docs): deduplicate types, JSDoc for some APIs (#7027)
* refactor(content-docs): deduplicate types, JSDoc for some APIs

* little refactor
2022-03-27 12:57:15 +08:00
Joshua Chen
ea6ceaa371
refactor: ensure lodash is default-imported (#6716) 2022-02-19 18:15:02 +08:00
TheCatLady
665d164351
feat(content-docs): add custom props front matter (#6619)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
2022-02-09 17:04:07 +01: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
2f7d6fea1e
refactor(content-docs): move isCategoriesShorthand to utils (#5962) 2021-11-18 08:25:07 +08:00
Joshua Chen
d1308a8736
refactor: improve setup of type declaration files (#5914) 2021-11-12 17:47:27 +01:00
Joshua Chen
8d92e9bcf5
refactor(content-docs): refactor sidebars, Joi validation, generator rework, expose config types (#5678) 2021-10-14 14:38:26 +02:00
Joshua Chen
eaacb0e98a
feat(theme-classic, plugin-docs): sidebar item level-specific className + allow customization (#5642)
* Initial work

* Complete function

* Avoid duplication

* More dedupe

* Make everything constants

* Change casing & docs
2021-10-07 16:59:02 +02:00
Sébastien Lorber
42e70e6d42
feat: new docs options: versions.{badge,className} (#5454)
* docs: add versions.{badge,className} options

* remove badge option test
2021-08-31 15:40:37 +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
Alexey Pyltsyn
9536ef900d
feat(v2): redesign mobile UX: inline TOC + doc sidebar in main menu (#4273)
* feat(v2): mobile TOC

* Bug fixes and various improvements

* Redesign

* extract TOCCollapsible component

* TS improvements

* Assign sidebar name directly to the doc route => no need for either permalinkToSidebar or GlobalData

* revert changes to useWindowSize, fix FOUC issues

* extract DocSidebarDesktop component

* remove now useless menu infima classes

* TOCHeadings => rename + remove unused onClick prop

* Extract DocSidebarItem

* minor renaming

* replace GlobalData usage by a React teleport system to render in the navbar mobile sidebar menu directly from the DocPage component

* useWindowSize => simulate SSR size in dev to make FOUC issues more obvious

* fix remaining sidebar layout shift

* update docs snapshots

* remove unused code translations

* remove unused code translations

* fix minor update-code-translations bug

* Add more build-size paths to watch

* Restyle back button

* Add  missing`menu` class

* extract useShallowMemoizedObject

* fix routes tests + better routes formatting

* use Translate api for labels

* use Translate api for labels

* Update translations

* Improve dark mode support for back button

* Merge branch 'master' into lex111/inline-color-code

# Conflicts:
#	packages/core/dist/css/default-dark/default-dark-rtl.min.css
#	packages/core/dist/css/default-dark/default-dark.min.css
#	packages/core/dist/css/default/default-rtl.min.css
#	packages/core/dist/css/default/default.min.css

* replace useCollapse by new useCollapsible

* Cleanup and use clean-btn for TOCCollapsible button

* Make TOC links clickable over full width

* Cleanup

* fix uncollapsible sidebar that can be collapsed + create <Collapsible> component

* dependency array typo

* rollback sidebars community commit typo

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-07-09 16:50:38 +02:00
Sébastien Lorber
364051f232
feat(v2): docs version banner configuration option (#5052)
* refactor DocVersionBanner => versionMetadata prop should be forwarded instead of using "useActiveVersion" + global data

* docs version banner configuration

* add doc for versions.banner

* fix tests

* improve docs plugin option api doc
2021-06-24 18:04:16 +02:00
Alexey Pyltsyn
41d9288e3d
refactor(v2): cleanup console output (#4979)
* refactor(v2): cleanup console output

* fix jest issue

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-06-16 11:37:28 +02:00
Alexey Pyltsyn
d72f760e4d
refactor(v2): remove sidebar_label filed from doc metadata file (#4863) 2021-06-02 16:52:41 +02:00
besemuna
9715048f79
feat(v2): provide doc sidebar_label through sidebars.js (#4500)
* feat : update SidebarItemDoc type

* feat : update assertIsDoc

* feat : allow configuring title from sidebar.js

* feat : add docs

* docs : refactor i18n docs to use label in sidebar.js

* test : add test

* Update website/docs/guides/docs/sidebar.md

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>

* docs : remove backported docs

Co-authored-by: Lisa Chandra <52909743+lisa761@users.noreply.github.com>
Co-authored-by: Javid <singularity.javid@gmail.com>
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2021-03-26 15:11:21 +01:00
Sam Zhou
5e73c72f26
chore(v2): Fix linter warnings (#4442)
* chore(v2): Fix linter warnings

223 warnings to 145 warnings

* Remove explicit type annotations

* Do not prefetch when targetLink == null
2021-03-17 17:28:42 +01:00
Oliver Ullman
b11c24b752
feat(v2): add custom props for consumption by swizzled sidebar (#3888) 2020-12-10 19:49:21 +01:00
Sébastien Lorber
21264f5ed0
feat(v2): contextual search, dynamic Algolia facetFilters (#3550)
* POC of contextual search dynamic filters

* fix useSearchTags bugs

* contextual search should use preferred version  (persisted in storage)

* Contextual search: make system decoupled from algolia + wire proper meta tags and facet filters

* rework doc tag + minor refactorings

* update snapshots

* polish contextual search

* add Algolia validateThemeConfig tests
2020-10-15 12:16:30 +02:00
Sébastien Lorber
9c34f68a7a
fix(v2): DocSearch should keep working after a new release (#3393)
* We should create an alias for searching last version of docs on DocSearch/Algolia, so that on new version publish, search still works even if new version is not already indexed (https://github.com/facebook/docusaurus/issues/3391)

* commit missing snapshot

* update after algolia changes

* put back facetFilters: [`version:${versions[0]}`] until latest facet is indexed
2020-09-03 14:35:46 +02:00
Sébastien Lorber
ae877f2990
feat(v2): docs version configuration: lastVersion, version.{path,label} (#3357)
* add new docs versioning options

* Add some tests for new versioning options

* Add some docs for version configurations

* try to fix broken link detection after /docs/ root paths have been removed on deploy previews

* improve dev/deploypreview versioning configurations

* disable custom current version path, as it produces broken links

* readVersionDocs should not be order sensitive

* fix versions page according to versioning config

* fix versions page according to versioning config
2020-08-28 18:37:49 +02:00
Sam Zhou
d299b99631
feat(v2): Provide docs plugin typing (#3328) 2020-08-27 11:40:14 +02:00
Sébastien Lorber
a4c8a7f55b
refactor(v2): docs plugin refactor (#3245)
* safe refactorings

* safe refactors

* add code to read versions more generically

* refactor docs plugin

* refactors

* stable docs refactor

* progress on refactor

* stable docs refactor

* stable docs refactor

* stable docs refactor

* attempt to fix admonition :(

* configureWebpack docs: better typing

* more refactors

* rename cli

* refactor docs metadata processing => move to pure function

* stable docs refactor

* stable docs refactor

* named exports

* basic sidebars refactor

* add getElementsAround utils

* refactor sidebar + ordering/navigation logic

* stable retrocompatible refactor

* add proper versions metadata tests

* fix docs metadata tests

* fix docs tests

* fix test due to absolute path

* fix webpack tests

* refactor linkify + add broken markdown links warning

* fix DOM warning due to forwarding legacy prop to div element

* add todo
2020-08-17 17:50:22 +02:00