chore: minor typo cleanup (#6324)

* chore: minor typo cleanup

* fix tests

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
Nick Schonning 2022-01-13 01:36:53 -05:00 committed by GitHub
parent 217b62682d
commit 02a233a221
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 26 additions and 26 deletions

View file

@ -2,7 +2,7 @@
This is a Netlify deployment to handle the Docusaurus playgrounds shortcuts: 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) - [new.docusaurus.io](https://new.docusaurus.io) (legacy one)
See also the [Playground doc page](https://docusaurus.io/docs/playground) See also the [Playground doc page](https://docusaurus.io/docs/playground)

View file

@ -67,7 +67,7 @@ async function generateTemplateExample(template) {
); );
// create sandbox.config.json file at the root of template // create sandbox.config.json file at the root of template
const codeSanboxConfig = { const codeSandboxConfig = {
infiniteLoopProtection: true, infiniteLoopProtection: true,
hardReloadOnChange: true, hardReloadOnChange: true,
view: 'browser', view: 'browser',
@ -79,7 +79,7 @@ async function generateTemplateExample(template) {
}; };
await fs.writeFile( await fs.writeFile(
`./examples/${template}/sandbox.config.json`, `./examples/${template}/sandbox.config.json`,
`${JSON.stringify(codeSanboxConfig, null, 2)}\n`, `${JSON.stringify(codeSandboxConfig, null, 2)}\n`,
); );
const stackBlitzConfig = { const stackBlitzConfig = {
@ -185,7 +185,7 @@ console.log(`Will generate examples for templates: ${templates.join(',')}`);
for (const template of templates) { for (const template of templates) {
await generateTemplateExample(template); await generateTemplateExample(template);
} }
console.log('Commiting changes'); console.log('Committing changes');
shell.exec('git add examples'); shell.exec('git add examples');
shell.exec("git commit -am 'update examples' --allow-empty"); shell.exec("git commit -am 'update examples' --allow-empty");

View file

@ -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>. // 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. // 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 // e.g. if an ### H3 was last seen at index 2, then prevIndexForLevel[3] === 2

View file

@ -143,7 +143,7 @@ function doCollectRedirects(pluginContext: PluginContext): RedirectMetadata[] {
function createRedirectsOptionRedirects( function createRedirectsOptionRedirects(
redirectsOption: PluginOptions['redirects'], redirectsOption: PluginOptions['redirects'],
): RedirectMetadata[] { ): 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[] { function optionToRedirects(option: RedirectOption): RedirectMetadata[] {
if (typeof option.from === 'string') { if (typeof option.from === 'string') {
return [{from: option.from, to: option.to}]; return [{from: option.from, to: option.to}];

View file

@ -52,13 +52,13 @@ export function translateContent(
content: BlogContent, content: BlogContent,
translationFiles: TranslationFiles, translationFiles: TranslationFiles,
): BlogContent { ): BlogContent {
const [{content: optonsTranslations}] = translationFiles; const [{content: optionsTranslations}] = translationFiles;
return { return {
...content, ...content,
blogSidebarTitle: optonsTranslations['sidebar.title'].message, blogSidebarTitle: optionsTranslations['sidebar.title'].message,
blogListPaginated: translateListPage( blogListPaginated: translateListPage(
content.blogListPaginated, content.blogListPaginated,
optonsTranslations, optionsTranslations,
), ),
}; };
} }

View file

@ -15,7 +15,7 @@ export default function markdownLoader(
// const options = this.getOptions(); // 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) // fileString = linkify(fileString)
return callback && callback(null, fileString); return callback && callback(null, fileString);

View file

@ -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 "\`\`\`npm2yarn
npm install --save docusaurus-plugin-name npm install --save docusaurus-plugin-name
\`\`\` \`\`\`

View file

@ -37,7 +37,7 @@ describe('npm2yarn plugin', () => {
expect(result).toMatchSnapshot(); 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'); const result = await processFixture('syntax-not-properly-set');
expect(result).toMatchSnapshot(); expect(result).toMatchSnapshot();

View file

@ -8,7 +8,7 @@
module.exports = { module.exports = {
env: { env: {
// USED FOR NODE/RUNTIME // 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... // we mostly need to transpile some features so that node does not crash...
lib: { lib: {
presets: [ presets: [

View file

@ -6,7 +6,7 @@
*/ */
/* /*
CSS variables, meant to be overriden by final theme CSS variables, meant to be overridden by final theme
*/ */
.details { .details {
--docusaurus-details-summary-arrow-size: 0.38rem; --docusaurus-details-summary-arrow-size: 0.38rem;

View file

@ -232,8 +232,8 @@ describe('Encoded link', () => {
'./some%20other%20doc', './some%20other%20doc',
// good - valid file with percent-20 in its name // good - valid file with percent-20 in its name
'./weird%20file%20name', './weird%20file%20name',
// bad - non-existant file with spaces in name // bad - non-existent file with spaces in name
'./some%20other%20non-existant%20doc', './some%20other%20non-existent%20doc',
// evil - trying to use ../../ but '/' won't get decoded // evil - trying to use ../../ but '/' won't get decoded
'./break%2F..%2F..%2Fout', './break%2F..%2F..%2Fout',
], ],
@ -242,8 +242,8 @@ describe('Encoded link', () => {
const expectedBrokenLinks = { const expectedBrokenLinks = {
'/docs/some doc': [ '/docs/some doc': [
{ {
link: './some%20other%20non-existant%20doc', link: './some%20other%20non-existent%20doc',
resolvedLink: '/docs/some%20other%20non-existant%20doc', resolvedLink: '/docs/some%20other%20non-existent%20doc',
}, },
{ {
link: './break%2F..%2F..%2Fout', link: './break%2F..%2F..%2Fout',

View file

@ -259,7 +259,7 @@ The [@hello](hello.md#paginate) document is great!
See the [Tutorial](../getting-started/tutorial.md) for more info. 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. You should decide if assets like images and files are per-version or shared between versions.

View file

@ -1587,7 +1587,7 @@ const Users: User[] = [
}, },
{ {
title: 'Unleash', title: 'Unleash',
description: 'A feature managment solution.', description: 'A feature management solution.',
preview: require('./showcase/unleash.png'), preview: require('./showcase/unleash.png'),
website: 'https://docs.getunleash.io/', website: 'https://docs.getunleash.io/',
source: 'https://github.com/Unleash/unleash/', source: 'https://github.com/Unleash/unleash/',

View file

@ -111,7 +111,7 @@ module.exports = {
``` ```
- `label`: the label to use for this locale - `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} ### `noIndex` {#noindex}

View file

@ -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'; + 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 You should decide if assets like images and files are per version or shared between versions

View file

@ -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: 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); - 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. - 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: 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:

View file

@ -111,7 +111,7 @@ module.exports = {
``` ```
- `label`: the label to use for this locale - `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} ### `noIndex` {#noindex}

View file

@ -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'; + 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 You should decide if assets like images and files are per version or shared between versions

View file

@ -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: 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); - 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. - 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: 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: