Commit graph

33 commits

Author SHA1 Message Date
Joshua Chen
0838884f67
chore: enable import/order rule (#7418) 2022-05-14 23:39:50 +08:00
Joshua Chen
6e2eb44964
refactor: unify how validateOptions is handled (#6961)
* refactor: unify how validateOptions is handled

* fix types

* fix again
2022-03-22 19:40:56 +08: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
aa446b7a9c
chore: clean up ESLint config, enable a few rules (#6514)
* chore: clean up ESLint config, enable a few rules

* enable max-len for comments

* fix build
2022-01-31 10:31:24 +08:00
Joshua Chen
cf265c051e
refactor: move exported type definitions to declaration file (#6300)
* refactor: move exported type definitions to declaration file

* fix

* fix
2022-01-09 22:02:31 +08:00
Joshua Chen
770418f8d2
refactor: unify log format with new logger utility (#5994)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
2021-12-20 17:24:59 +01:00
Joshua Chen
fd966b5395
refactor: add blank lines below all copyright headers (#6071) 2021-12-09 11:53:46 +08:00
Alexey Pyltsyn
f96a051fbe
refactor: remove deprecated docs homePageId option (#6065) 2021-12-07 19:48:30 +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
8d92e9bcf5
refactor(content-docs): refactor sidebars, Joi validation, generator rework, expose config types (#5678) 2021-10-14 14:38:26 +02:00
Alexey Pyltsyn
29e06d0677
feat: make tags route path configurable (#5545) 2021-09-21 19:19:18 +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
Joshua Chen
24156efcfb
feat: docs plugin options sidebarCollapsible + sidebarCollapsed (#5203)
* Add prop

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Add `collapsible` option to sidebar item

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Add eslint-ignore

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Move new page

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Allow in autogenerated

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Fix tests

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Move config options to plugin-docs

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Make non-collapsible items always expanded

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* docs versioning cli should receive a single options object

* Update cli.test.ts

* revert validateCategoryMetadataFile change

* remove theme usage of themeConfig.sidebarCollapsible

* better handling of sidebar item category inconsistencies + add warning message

* Update snapshot

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Handle plugin option inconsistencies

* improve doc for new sidebarCollapsible doc options

* remove warning in fixSidebarItemInconsistencies as it will be annoyed for versioned sites, as "collapsed" is already persisted in sidebar json files

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-07-23 14:24:36 +02:00
Sébastien Lorber
8bdb3da233
feat(v2): generalize usage of _ prefix convention to exclude content files/folders (#5173)
* create a swizzleWarning partial for shared text

* Generalize usage of _ prefix convention to exclude content files/folders

* add api doc

* MDX loader should not expect metadata/frontmatter on MDX partial files
2021-07-15 13:21:41 +02:00
Sébastien Lorber
05c85c7be7
refactor(v2): remove deprecated docs option excludeNextVersionDocs (#5053) 2021-06-24 18:41:13 +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
Nam Hoang Le
1ab8aa0af8
fix(v2): improve dx sidebar config, ability to have no sidebars file (#4775)
* Improve sidebar config

* Edit message

* fix some little issues in the way undefined/false sidebars are handled

* remove old error message as it has been moved to a better place

Co-authored-by: Nam Hoang Le <nam.hoang.le@mgm-tp.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-05-18 18:27:46 +02:00
Sébastien Lorber
c04e613ffe
feat(v2): docs, make numberPrefixParser configurable, better defaults, minor breaking-changes (#4655)
* make number prefix parsing logic configurable

* Make numberPrefixParser configurable + rename frontmatter + avoid parsing date/version patterns by default

* add more tests

* more test cases
2021-04-21 12:06:06 +02:00
kazk
5088a1e48f
fix(v2): fix validation rejecting admonitions false (#4629)
Prevents disabling default admonitions as documented under
https://docusaurus.io/docs/presets#official-presets
2021-04-19 10:49:58 +02:00
Sébastien Lorber
db79d462ab
feat(v2): auto-generated sidebars, frontmatter-less sites (#4582)
* POC of autogenerated sidebars

* use combine-promises utility lib

* autogenerated sidebar poc working

* Revert "autogenerated sidebar poc working"

This reverts commit c81da980

* POC of auto-generated sidebars for community docs

* update tests

* add initial test suite for autogenerated sidebars + fix some edge cases

* Improve autogen sidebars: strip more number prefixes in folder breadcrumb + slugs

* fix typo!

* Add tests for partially generated sidebars + fix edge cases + extract sidebar generation code

* Ability to read category metadatas file from a file in the category

* fix tests

* change position of API

* ability to extract number prefix

* stable system to enable position frontmatter

* fix tests for autogen sidebar position

* renamings

* restore community sidebars

* rename frontmatter position -> sidebar_position

* make sidebarItemsGenerator fn configurable

* minor changes

* rename dirPath => dirName

* Make the init template use autogenerated sidebars

* fix options

* fix docusaurus site: remove test docs

* add _category_ file to docs pathsToWatch

* add _category_ file to docs pathsToWatch

* tutorial: use sidebar_position instead of file number prefixes

* Adapt Docusaurus tutorial for autogenerated sidebars

* remove slug: /

* polish the homepage template

* rename _category_ sidebar_position to just "position"

* test for custom sidebarItemsGenerator fn

* fix category metadata + add link to report tutorial issues

* fix absolute path breaking tests

* fix absolute path breaking tests

* Add test for floating number sidebar_position

* add sidebarItemsGenerator unit tests

* add processSidebars unit tests

* Fix init template broken links

* windows test

* increase code translations test timeout

* cleanup mockCategoryMetadataFiles after windows test fixed

* update init template positions

* fix windows tests

* fix comment

* Add autogenerated sidebar items documentation + rewrite the full sidebars page doc

* add useful comment

* fix code block title
2021-04-15 16:20:11 +02:00
Sébastien Lorber
60d189a91c
fix(v2): Export Joi from validation-utils package (#4459) 2021-03-18 19:27:51 +01:00
Armano
abae86f283
refactor(v2): use correct plugin types (#4418) 2021-03-15 19:08:44 +01:00
Sébastien Lorber
be7b5dca78
feat(v2): editUrl function for advanced use-cases (#4121)
* EditUrl function

* normalize blog/docs regarding the editUrl feature + editUrl function

* editUrl fn => always inject posix style relative paths, make tests more reliable
(see also https://github.com/facebook/docusaurus/issues/4124)

* fix editUrl on windows
2021-01-29 15:35:25 +01:00
Sébastien Lorber
b5c46bd1d9
feat(v2): new docs edit options: editCurrentVersion + editLocalizedDocs (#3949)
* editCurrentVersion initial poc

* ensure edit url allows to edit localized docs

* Add editLocalizedDocs option

* keep editing current version in dev (more convenient)
2020-12-28 10:25:47 +01:00
Alexey Pyltsyn
69bf68ae57
chore(v2): migrate hapi/joi to joi (#3638) 2020-10-26 15:18:51 +01:00
Rémi Doreau
d3a01458a3
feat(v2): add beforeDefaultRemarkPlugins/beforeDefaultRehypePlugins options to all md content plugins (#3467)
* fix(plugin-content-docs): add beforeDefaultRemarkPlugins + beforeDefaultRehypePlugins options

* fix(plugin-content-blog): add beforeDefaultRemarkPlugins + beforeDefaultRehypePlugins options

* fix(plugin-content-pages): add beforeDefaultRemarkPlugins + beforeDefaultRehypePlugins options

* feat(website-docs): overriding remark-rehype plugins

* fix(plugin-content): update beforeDefaultRehypePlugins/beforeDefaultRemarkPlugins types

* fix(plugin-content-docs): fix tests
2020-09-29 14:48:34 +02:00
Sébastien Lorber
1eb6e13fb7
fix(v2): reject routeBasePath: '' (#3377)
* routeBasePath: '' should be forbidden

* routeBasePath: '' should be forbidden

* commit

* try to trigger cla bot
2020-08-31 19:59:27 +02:00
Sébastien Lorber
d8cfabb66a
feat(v2): docs options.onlyIncludeVersions (#3373)
* docs options.onlyIncludeVersions

* adapt docsVersionDropdown if we render a single version

* fix bad error message

* fix netlify deploy when versioning is disabled
2020-08-31 17:08:24 +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
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
Renamed from packages/docusaurus-plugin-content-docs/src/pluginOptionSchema.ts (Browse further)