-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore: bump docusaurus, use docusaurus/preset-classic #4960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
if (typeof window !== 'undefined') { | ||
import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment'; | ||
|
||
if (ExecutionEnvironment.canUseDOM) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ha, I remember bumping into this discussion! Glad it's resolved 🙂 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Except that It's now officially made its way to the docs, now that client modules are finalized and published: https://docusaurus.io/docs/advanced/client#:~:text=remember%20to%20check%20the%20execution%20environment |
||
require('konamimojisplosion').initializeKonamimojisplosion(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ html:root { | |
--code-editor-bg: #ffffff; | ||
|
||
--docsearch-muted-color: #666; | ||
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
html[data-theme='dark']:root { | ||
|
@@ -60,17 +61,7 @@ html[data-theme='dark']:root { | |
scrollbar-color: #454a4d #202324; | ||
|
||
--docsearch-muted-color: #aaa; | ||
} | ||
|
||
.docusaurus-highlight-code-line { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a breaking change: the class name has been removed in Docusaurus. We are using CSS vars instead. But AFAIK it won't impact us because it seems we are not using code line highlighting. |
||
background-color: rgba(0, 0, 0, 0.1); | ||
display: block; | ||
margin: 0 calc(-1 * var(--ifm-pre-padding)); | ||
padding: 0 var(--ifm-pre-padding); | ||
} | ||
|
||
html[data-theme='dark'] .docusaurus-highlight-code-line { | ||
background-color: rgba(0, 0, 0, 0.3); | ||
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); | ||
} | ||
|
||
.header-github-link:hover { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,10 +56,10 @@ html[data-theme='dark'] { | |
--token-color-highlight: rgba(247, 235, 198, 0.2); | ||
} | ||
|
||
div[class*='codeBlockContainer'], | ||
div[class*='codeBlockContainer'] pre { | ||
color: var(--token-color); | ||
background-color: var(--token-background); | ||
.theme-code-block, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a more stable class name and is recommended. |
||
.theme-code-block pre { | ||
color: var(--token-color) !important; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is to work around a Docusaurus bug: facebook/docusaurus#3678 I'd still recommend to use the |
||
background-color: var(--token-background) !important; | ||
--ifm-color-emphasis-300: var(--token-border); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,16 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment'; | ||
import siteConfig from '@generated/docusaurus.config'; | ||
|
||
const prismIncludeLanguages = PrismObject => { | ||
if (ExecutionEnvironment.canUseDOM) { | ||
const { | ||
themeConfig: { prism = {} }, | ||
} = siteConfig; | ||
const { additionalLanguages = [] } = prism; | ||
window.Prism = PrismObject; | ||
export default function prismIncludeLanguages(PrismObject) { | ||
const { | ||
themeConfig: { prism }, | ||
} = siteConfig; | ||
const { additionalLanguages } = prism; | ||
globalThis.Prism = PrismObject; | ||
|
||
additionalLanguages.forEach(lang => { | ||
require(`prismjs/components/prism-${lang}`); // eslint-disable-line | ||
}); | ||
additionalLanguages.forEach(lang => { | ||
require(`prismjs/components/prism-${lang}`); // eslint-disable-line | ||
}); | ||
|
||
require(`../prism/language/jsonc`); | ||
delete window.Prism; | ||
} | ||
}; | ||
|
||
export default prismIncludeLanguages; | ||
require(`../prism/language/jsonc`); | ||
delete globalThis.Prism; | ||
} | ||
Comment on lines
+3
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Backporting changes from upstream. By using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSDoc only works if you wrap the object literal with brackets. In the latest version, we've added actual JSDoc documentation to all APIs, so it's good if we can do it properly.