Commit graph

3856 commits

Author SHA1 Message Date
Sébastien Lorber
dc4664b489
feat: details/summary theme / MDX component (#5216)
* Details component

* polish arrow animation

* fix text selection bug

* fix some edge cases + polish

* example of overriding baseClassName

* Move Details component to theme-common

* make component work even when JS is disabled or failed to load

* update arrow transform

* Details component: better handling of no-JS fallback mode: avoid delaying arrow navigation when JS (see review)

* prefix css vars with --docusaurus

* improve css arrow styling

* slightly change details/summary design

* better md doc + include quotes and details in doc
2021-07-27 18:45:12 +02:00
Alexey Pyltsyn
798f634007
chore(v2): update Infima to alpha 28 (#5222) 2021-07-27 16:09:20 +02:00
Alexey Pyltsyn
7e48961b3b
chore: fix iframe background color in dark mode (#5223)
* chore: fix GH button background color in dark mode

* Fix for Canny
2021-07-27 16:06:37 +02:00
Alexey Pyltsyn
938e5a906f
refactor(v2): update Russian translation (#5224)
* refactor(v2): update Russian translation

* Wording
2021-07-27 16:00:11 +02:00
Massoud Maboudi
6f366f4b45
refactor(v2): improved Farsi default translations (#5217)
* improved the Farsi translation

* removed the __description lines

* removed the __description lines

* improved the translation
2021-07-27 10:50:31 +02:00
Alexey Pyltsyn
b202fdb59f
docs(v2): remove vector.dev from showcase (#5218) 2021-07-25 16:24:41 +03:00
Sébastien Lorber
8621ae2910
fix: upgrade Docsearch to avoid layout shift (#5214)
* upgrade algolia docsearch

* alpha 39
2021-07-24 18:40:09 +02:00
Sébastien Lorber
a7a5ea3466
refactor: make code block shadows consistent with new admonitions (#5215) 2021-07-23 18:11:40 +02:00
Sébastien Lorber
083037d7a5
refactor: redesign admonitions/callouts/quotes (#5193)
* prepare admonitions redesign

* Docusaurus admonition cleanup

* cover more edge cases in Docusaurus admonitions page: interleaving code blocks and links

* cover more edge cases in Docusaurus admonitions page: interleaving code blocks and links

* update Infima with new alerts
2021-07-23 17:10:38 +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
b38c35a36d
docs: mention Link can be used for external links (#5212) 2021-07-23 12:24:03 +02:00
Pranab Das
7b2d45a439
docs(v2): Elaboration of raw-loader in markdown react component (#5210)
* docs(v2): Elaboration of raw-loader in React component

* Add prettier ignore for a blocks to avoid unintended semicolon
2021-07-23 10:31:38 +02:00
Sébastien Lorber
700a82aefe
feat: multiple playground choices (#5207)
* poc of using netlify functions for playground redirections

* push

* cleanup

* restore files

* fix netlify functions?

* fix netlify functions?

* implement serverless functions for playgrounds with persistent cookie

* move new.docusaurus.io to monorepo packages

* move new.docusaurus.io to monorepo packages

* lockfile

* push

* catch-all redirect

* Translate/Interpolate: add better error message if not used correctly

* Add /docs/playground page

* Add some additional doc
2021-07-22 21:10:36 +02:00
Sébastien Lorber
2b5fd2b490
misc: add script to keep starters branch/repos up-to-date (#5206) 2021-07-22 17:55:04 +02:00
Michel Weststrate
ddc0f46b73
fix: cli upgrade helper fail when no package.dependencies (#5204)
* Fix handling of empty `dependencies` section. 

In Flipper, https://github.com/facebook/flipper/blob/master/website/package.json,  all our dependencies live in `devDependecies` of our `package.json`. As a result `dependencies` is not set, causing a crash when running `yarn start`:

```
/Users/mweststrate/fbsource/xplat/sonar/website/node_modules/@docusaurus/core/bin/docusaurus.js:50
  const siteDocusaurusPackagesForUpdate = Object.keys(sitePkg.dependencies)
                                                 ^

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at Object.<anonymous> (/Users/mweststrate/fbsource/xplat/sonar/website/node_modules/@docusaurus/core/bin/docusaurus.js:50:50)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
    at internal/main/run_main_module.js:17:11
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```

Setting `"dependencies": {}`, works as work around, but this patch fixes the crash, and makes sure the deps are upgraded as well if they live in `devDependencies` instead of `dependencies`.

* formatting fix
2021-07-22 16:13:57 +02:00
Sébastien Lorber
4d06f26c1f
fix(v2): Fix MDX docs being considered as partials when siteDir match the _ prefix convention (#5199)
* Add _ to dogfood docs folder to cover against edge case

* Fix edge case with MDX partials when site / content dir contains a _ prefix

* add globUtils tests

* proper dogfooding folder re-organization, all content plugins being used

* refactor dogfooding folder + expose /tests page index

* fix page plugin ignoring options.routeBasePath
2021-07-21 14:13:51 +02:00
tohid nateghi
a2729128db
docs: user should restart docusaurus after adding prism additionalLanguage (#5191)
* Update markdown-features-code-blocks.mdx

if you add php language and don't restart your server, you will get an error like this

uncaught Error: Cannot find module './prism-php'

until you restart your server

* Update website/docs/guides/markdown-features/markdown-features-code-blocks.mdx

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2021-07-20 15:38:04 +02:00
Alexey Pyltsyn
12cea5eefe
refactor(v2): increase content area if blog sidebar is off (#5171)
* refactor(v2): increase content area if blog sidebar is off

* Replace render prop with children to simplicity sake

* Revert to previous layout
2021-07-20 14:11:08 +02:00
Joshua Chen
f5f39fa8e0
docs: update API docs on navbar behavior (#5175)
* Document navbar dropdown behavior

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

* Partially done API documentation

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

* Complete API documentation

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

* Add deprecation warning

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

* Address suggestions

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

* Minor fixes

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

* Update website/docs/api/themes/theme-configuration.md

* Update website/docs/api/themes/theme-configuration.md

* Update website/docs/api/themes/theme-configuration.md

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2021-07-20 14:07:09 +02:00
Alexey Pyltsyn
88de3a5106
fix(v2): wrap dropdown item to missing li element + remove extra attributes (#5179)
* fix(v2): wrap dropdown item to li element

* Remove extra attrs

* Fix types

* Exclude type/position from parent component

* Fix for positon

* Avoid cloneElement

* Update packages/docusaurus-theme-classic/src/theme/NavbarItem/index.tsx

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
2021-07-19 19:17:45 +02:00
Dan Gebhardt
966b1d18be
docs(v2): Add Orbit.js site to showcase (#5189) 2021-07-17 23:45:32 +03:00
David Barrat
6210509bbe
docs(v2): add easyjwt to users (#5177)
* docs(v2): add easyjwt to users

* Update website/src/data/users.js

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

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2021-07-16 20:31:36 +02:00
Alexey Pyltsyn
44225a3df9
fix(v2): pass all props to CodeBlock component (#5183) 2021-07-16 14:55:19 +02:00
Alexey Pyltsyn
54e4b02666
fix(v2): add base URL to content attribute of head tags PWA (#5185) 2021-07-16 11:56:00 +02:00
François Massot
cda09237cc
docs(v2): Add quickwit to user.js and png. (#5187)
* Add quickwit to user.js and png.

* Update website/src/data/users.js

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2021-07-16 11:44:32 +02:00
Lukas Bach
5e8c62a074
docs(v2): Add react-complex-tree to users.js (#5184)
* add react-complex-tree to users.js

* add react-complex-tree preview image
2021-07-16 11:25:58 +02:00
Joshua Chen
633c2f60dd
fix(v2): Fix type for navlink label (#5176)
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
2021-07-15 15:40:39 +02:00
Alexey Pyltsyn
f7b5e90390
refactor(v2): automatically add base URL to PWA head tags (#5169)
* refactor(v2): automatically add base URL to PWA head tags

* Add baseUrl only if necessary
2021-07-15 15:38:14 +02:00
Sébastien Lorber
81170a79f4
docs(v2): Update tutorial link (#5178) 2021-07-15 14:56:41 +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
0851e0e5bf
fix(v2): hide mobile collapsible doc toc if no headings (#5172) 2021-07-15 09:51:23 +02:00
Sébastien Lorber
818fb3956b
refactor(v2): mobile dropdown navbar: expand when subitem become active (#5168) 2021-07-14 19:42:47 +02:00
Joshua Chen
007e901354
feat(v2): allow any type of NavbarItem to be passed in a navbar dropdown (#5072)
* Initial work

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

* More elegant `eslint-disable`

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

* Fix typing

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

* Allow doc links in dropdown

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

* Allow more dropdowns to use linklike items

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

* Finalize

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

* Dogfood

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

* Disallow nested dropdowns

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

* Better typing

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

* Complete type fix

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

* Use flatmap

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

* Patch

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

* Test

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

* Try fix

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

* Style change

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

* Revert (to test)

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

* Hmmm

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

* I know what's wrong

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

* Does this work?

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

* Nope

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

* Wrong class name

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

* Pass prop to render dropdown item differently

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

* This looks better

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

* Tests passed

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

* Separate dropdown from default

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

* Pourquois?

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

* Better prop typing

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

* Make code simpler

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

* There's some extra className

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

* Test

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

* More test

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

* A-ha!

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

* Test again?

* Add backward compatibility

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

* Incorporate my type fix

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

* Resolve conflict

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

* minor refactor

* minor refactors

* allow usage of ES2019 in browser code

* revert NavLink rename

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-07-14 18:19:08 +02:00
Sébastien Lorber
38c6cb5faa
fix(v2): fix website PWA icon hrefs (#5167) 2021-07-14 16:42:12 +02:00
Sébastien Lorber
677e53d4db
perf(v2): lazy collapsibles, reduce html output and build times (#5136)
* Allow collapsible to be lazy

* cleanup comments

* CollapsibleLazy little bug
2021-07-14 16:18:52 +02:00
Sébastien Lorber
04bcdbd3e1
fix(v2): fix yarn clear command (#5166) 2021-07-14 16:07:56 +02:00
Arnaud Jeannin
2bd7f0d7a1
docs(v2): Update deploy with Qovery docs for V2 (#5158)
* Update deploy with Qovery docs for V2

Hello Docusaurus team,

I updated the docs for the new Qovery V2

https://www.qovery.com/blog/qovery-v2-beta-is-out

* run prettier on docs

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-07-14 11:26:42 +02:00
Sébastien Lorber
d3764f77fe
fix(v2): revert webpack.resolve.symlinks = false (#5164)
* WathcOptions should work even if Webpack does not resolve symlinks

* re-enable webpack resolve.symlinks = true

* Use symlinked folder as source
2021-07-13 20:11:08 +02:00
Sébastien Lorber
f33cd079c2
fix(v2): Fix Collapsible hydration layout shift (#5159) 2021-07-13 17:31:26 +02:00
Alexey Pyltsyn
fa9b0cd9c1
fix(v2): disable default behavior when click on collapsible item (#5161) 2021-07-13 17:13:07 +02:00
Sébastien Lorber
12faed89db
fix(v2): Fix navbar mobile sidebar secondary menu bugs + refactor navbar (#5157) 2021-07-13 13:01:06 +02:00
Alexey Pyltsyn
45a87a1479
fix(v2): improve work of useCollapsible hook with multiple clicks (#5146) 2021-07-13 10:17:50 +02:00
Pranab Das
0fdb6836ad
refactor(v2): Hindi translation for semantic doc sidebar (#5154) 2021-07-13 10:10:29 +02:00
Raz Luvaton
d1f3a3631a
Open docs(v2): Indent code example to improve readability (#5152) 2021-07-13 10:09:19 +02:00
Alexey Pyltsyn
dd035088c6
refactor(v2): use Collapsible for mobile nav items (#5145) 2021-07-13 10:00:00 +02:00
nirtamir2
bb4ce1a54b
refactor(v2): Update Hebrew translations (#5138) 2021-07-12 20:04:59 +02:00
Pranab Das
1a3557b917
refactor(v2): bn translation improvements for semantic doc sidebar (#5140) 2021-07-12 19:58:19 +02:00
Joshua Chen
be695aa0e9
feat(v2): complete Chinese code translations (#5139)
* feat(v2): complete Chinese code translations

* Complete zh-Hant translation

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
2021-07-12 19:42:03 +02:00
Nazar
f14d8d2fdd
docs(v2): GIF format is not suported (#5133)
https://github.com/facebook/docusaurus/issues/2956

Please check the issue above.
GIF format is currently is not supported
2021-07-12 19:40:42 +02:00
Forresst
3e5a832590
fix(v2): add missing french translations for mobile (#5151) 2021-07-12 19:40:07 +02:00