mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 16:47:26 +02:00
chore: minor typo cleanup (#6324)
* chore: minor typo cleanup * fix tests Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
parent
217b62682d
commit
02a233a221
19 changed files with 26 additions and 26 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
This is a Netlify deployment to handle the Docusaurus playgrounds shortcuts:
|
||||
|
||||
- [docusaurus.new](https://docusaurus.new) (main one, as of today domain is owned by StackBlitz but may be transfered to FB)
|
||||
- [docusaurus.new](https://docusaurus.new) (main one, as of today domain is owned by StackBlitz but may be transferred to FB)
|
||||
- [new.docusaurus.io](https://new.docusaurus.io) (legacy one)
|
||||
|
||||
See also the [Playground doc page](https://docusaurus.io/docs/playground)
|
||||
|
|
|
@ -67,7 +67,7 @@ async function generateTemplateExample(template) {
|
|||
);
|
||||
|
||||
// create sandbox.config.json file at the root of template
|
||||
const codeSanboxConfig = {
|
||||
const codeSandboxConfig = {
|
||||
infiniteLoopProtection: true,
|
||||
hardReloadOnChange: true,
|
||||
view: 'browser',
|
||||
|
@ -79,7 +79,7 @@ async function generateTemplateExample(template) {
|
|||
};
|
||||
await fs.writeFile(
|
||||
`./examples/${template}/sandbox.config.json`,
|
||||
`${JSON.stringify(codeSanboxConfig, null, 2)}\n`,
|
||||
`${JSON.stringify(codeSandboxConfig, null, 2)}\n`,
|
||||
);
|
||||
|
||||
const stackBlitzConfig = {
|
||||
|
@ -185,7 +185,7 @@ console.log(`Will generate examples for templates: ${templates.join(',')}`);
|
|||
for (const template of templates) {
|
||||
await generateTemplateExample(template);
|
||||
}
|
||||
console.log('Commiting changes');
|
||||
console.log('Committing changes');
|
||||
shell.exec('git add examples');
|
||||
shell.exec("git commit -am 'update examples' --allow-empty");
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ export default function search(node: Node): TOCItem[] {
|
|||
});
|
||||
});
|
||||
|
||||
// Keep track of which previous index would be the current heading's direcy parent.
|
||||
// Keep track of which previous index would be the current heading's direct parent.
|
||||
// Each entry <i> is the last index of the `headings` array at heading level <i>.
|
||||
// We will modify these indices as we iterate through all headings.
|
||||
// e.g. if an ### H3 was last seen at index 2, then prevIndexForLevel[3] === 2
|
||||
|
|
|
@ -143,7 +143,7 @@ function doCollectRedirects(pluginContext: PluginContext): RedirectMetadata[] {
|
|||
function createRedirectsOptionRedirects(
|
||||
redirectsOption: PluginOptions['redirects'],
|
||||
): RedirectMetadata[] {
|
||||
// For conveniency, user can use a string or a string[]
|
||||
// For convenience, user can use a string or a string[]
|
||||
function optionToRedirects(option: RedirectOption): RedirectMetadata[] {
|
||||
if (typeof option.from === 'string') {
|
||||
return [{from: option.from, to: option.to}];
|
||||
|
|
|
@ -52,13 +52,13 @@ export function translateContent(
|
|||
content: BlogContent,
|
||||
translationFiles: TranslationFiles,
|
||||
): BlogContent {
|
||||
const [{content: optonsTranslations}] = translationFiles;
|
||||
const [{content: optionsTranslations}] = translationFiles;
|
||||
return {
|
||||
...content,
|
||||
blogSidebarTitle: optonsTranslations['sidebar.title'].message,
|
||||
blogSidebarTitle: optionsTranslations['sidebar.title'].message,
|
||||
blogListPaginated: translateListPage(
|
||||
content.blogListPaginated,
|
||||
optonsTranslations,
|
||||
optionsTranslations,
|
||||
),
|
||||
};
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ export default function markdownLoader(
|
|||
|
||||
// const options = this.getOptions();
|
||||
|
||||
// TODO provide additinal md processing here? like interlinking pages?
|
||||
// TODO provide additional md processing here? like interlinking pages?
|
||||
// fileString = linkify(fileString)
|
||||
|
||||
return callback && callback(null, fileString);
|
||||
|
|
|
@ -71,7 +71,7 @@ import TabItem from '@theme/TabItem';
|
|||
"
|
||||
`;
|
||||
|
||||
exports[`npm2yarn plugin test: language was not setted 1`] = `
|
||||
exports[`npm2yarn plugin test: language was not set 1`] = `
|
||||
"\`\`\`npm2yarn
|
||||
npm install --save docusaurus-plugin-name
|
||||
\`\`\`
|
||||
|
|
|
@ -37,7 +37,7 @@ describe('npm2yarn plugin', () => {
|
|||
expect(result).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('test: language was not setted', async () => {
|
||||
test('test: language was not set', async () => {
|
||||
const result = await processFixture('syntax-not-properly-set');
|
||||
|
||||
expect(result).toMatchSnapshot();
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
module.exports = {
|
||||
env: {
|
||||
// USED FOR NODE/RUNTIME
|
||||
// maybe we should differenciate both cases because
|
||||
// maybe we should differentiate both cases because
|
||||
// we mostly need to transpile some features so that node does not crash...
|
||||
lib: {
|
||||
presets: [
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
CSS variables, meant to be overriden by final theme
|
||||
CSS variables, meant to be overridden by final theme
|
||||
*/
|
||||
.details {
|
||||
--docusaurus-details-summary-arrow-size: 0.38rem;
|
||||
|
|
|
@ -232,8 +232,8 @@ describe('Encoded link', () => {
|
|||
'./some%20other%20doc',
|
||||
// good - valid file with percent-20 in its name
|
||||
'./weird%20file%20name',
|
||||
// bad - non-existant file with spaces in name
|
||||
'./some%20other%20non-existant%20doc',
|
||||
// bad - non-existent file with spaces in name
|
||||
'./some%20other%20non-existent%20doc',
|
||||
// evil - trying to use ../../ but '/' won't get decoded
|
||||
'./break%2F..%2F..%2Fout',
|
||||
],
|
||||
|
@ -242,8 +242,8 @@ describe('Encoded link', () => {
|
|||
const expectedBrokenLinks = {
|
||||
'/docs/some doc': [
|
||||
{
|
||||
link: './some%20other%20non-existant%20doc',
|
||||
resolvedLink: '/docs/some%20other%20non-existant%20doc',
|
||||
link: './some%20other%20non-existent%20doc',
|
||||
resolvedLink: '/docs/some%20other%20non-existent%20doc',
|
||||
},
|
||||
{
|
||||
link: './break%2F..%2F..%2Fout',
|
||||
|
|
|
@ -259,7 +259,7 @@ The [@hello](hello.md#paginate) document is great!
|
|||
See the [Tutorial](../getting-started/tutorial.md) for more info.
|
||||
```
|
||||
|
||||
### Global or versioned colocated assets {#global-or-versioned-colocated-assets}
|
||||
### Global or versioned collocated assets {#global-or-versioned-collocated-assets}
|
||||
|
||||
You should decide if assets like images and files are per-version or shared between versions.
|
||||
|
||||
|
|
|
@ -1587,7 +1587,7 @@ const Users: User[] = [
|
|||
},
|
||||
{
|
||||
title: 'Unleash',
|
||||
description: 'A feature managment solution.',
|
||||
description: 'A feature management solution.',
|
||||
preview: require('./showcase/unleash.png'),
|
||||
website: 'https://docs.getunleash.io/',
|
||||
source: 'https://github.com/Unleash/unleash/',
|
||||
|
|
|
@ -111,7 +111,7 @@ module.exports = {
|
|||
```
|
||||
|
||||
- `label`: the label to use for this locale
|
||||
- `direction`: `ltr` (default) or `rtl` (for [right-to-left languages](https://developer.mozilla.org/en-US/docs/Glossary/rtl) like Araric, Hebrew, etc.)
|
||||
- `direction`: `ltr` (default) or `rtl` (for [right-to-left languages](https://developer.mozilla.org/en-US/docs/Glossary/rtl) like Arabic, Hebrew, etc.)
|
||||
|
||||
### `noIndex` {#noindex}
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ Don't use relative paths import within the docs. Because when we cut a version t
|
|||
+ import Foo from '@site/src/components/Foo';
|
||||
```
|
||||
|
||||
### Global or versioned colocated assets {#global-or-versioned-colocated-assets}
|
||||
### Global or versioned collocated assets {#global-or-versioned-collocated-assets}
|
||||
|
||||
You should decide if assets like images and files are per version or shared between versions
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ Sometimes, you may want to extend or tweak your Markdown syntax. For example:
|
|||
And the answer is: create an MDX plugin! MDX has a built-in [plugin system](https://mdxjs.com/advanced/plugins/) that can be used to customize how the Markdown files will be parsed and transformed to JSX. There are three typical use-cases of MDX plugins:
|
||||
|
||||
- Using existing [remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins) or [rehype plugins](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins);
|
||||
- Creating remark/rehype plugins to tranform the elements generated by existing MDX syntax;
|
||||
- Creating remark/rehype plugins to transform the elements generated by existing MDX syntax;
|
||||
- Creating remark/rehype plugins to introduce new syntaxes to MDX.
|
||||
|
||||
If you play with the [MDX playground](https://mdx-git-renovate-babel-monorepo-mdx.vercel.app/playground), you would notice that the MDX transpilation has two intermediate steps: Markdown AST (MDAST), and Hypertext AST (HAST), before arriving at the final JSX output. MDX plugins also come in two forms:
|
||||
|
|
|
@ -111,7 +111,7 @@ module.exports = {
|
|||
```
|
||||
|
||||
- `label`: the label to use for this locale
|
||||
- `direction`: `ltr` (default) or `rtl` (for [right-to-left languages](https://developer.mozilla.org/en-US/docs/Glossary/rtl) like Araric, Hebrew, etc.)
|
||||
- `direction`: `ltr` (default) or `rtl` (for [right-to-left languages](https://developer.mozilla.org/en-US/docs/Glossary/rtl) like Arabic, Hebrew, etc.)
|
||||
|
||||
### `noIndex` {#noindex}
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ Don't use relative paths import within the docs. Because when we cut a version t
|
|||
+ import Foo from '@site/src/components/Foo';
|
||||
```
|
||||
|
||||
### Global or versioned colocated assets {#global-or-versioned-colocated-assets}
|
||||
### Global or versioned collocated assets {#global-or-versioned-collocated-assets}
|
||||
|
||||
You should decide if assets like images and files are per version or shared between versions
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ Sometimes, you may want to extend or tweak your Markdown syntax. For example:
|
|||
And the answer is: create an MDX plugin! MDX has a built-in [plugin system](https://mdxjs.com/advanced/plugins/) that can be used to customize how the Markdown files will be parsed and transformed to JSX. There are three typical use-cases of MDX plugins:
|
||||
|
||||
- Using existing [remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins) or [rehype plugins](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins);
|
||||
- Creating remark/rehype plugins to tranform the elements generated by existing MDX syntax;
|
||||
- Creating remark/rehype plugins to transform the elements generated by existing MDX syntax;
|
||||
- Creating remark/rehype plugins to introduce new syntaxes to MDX.
|
||||
|
||||
If you play with the [MDX playground](https://mdx-git-renovate-babel-monorepo-mdx.vercel.app/playground), you would notice that the MDX transpilation has two intermediate steps: Markdown AST (MDAST), and Hypertext AST (HAST), before arriving at the final JSX output. MDX plugins also come in two forms:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue