mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 02:08:55 +02:00
chore: add cSpell for spell checking (#6456)
* chore: Add cSpell for spell checking * chore: exclude map files and remove dups * chore: exclude more binary files * chore: remove MD headings * Update .cspell.json * fix a few spellings * fix more * fix Signed-off-by: Joshua Chen <sidachen2003@gmail.com> * fix a few * oops Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
parent
a41a5c328c
commit
521eb119a7
64 changed files with 852 additions and 142 deletions
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
custom_edit_url: https://github.com/customUrl/docs/lorem.md
|
||||
unrelated_frontmatter: won't be part of metadata
|
||||
unrelated_front_matter: won't be part of metadata
|
||||
---
|
||||
|
||||
Lorem ipsum.
|
||||
|
|
|
@ -529,7 +529,7 @@ Object {
|
|||
\\"version\\": \\"current\\",
|
||||
\\"frontMatter\\": {
|
||||
\\"custom_edit_url\\": \\"https://github.com/customUrl/docs/lorem.md\\",
|
||||
\\"unrelated_frontmatter\\": \\"won't be part of metadata\\"
|
||||
\\"unrelated_front_matter\\": \\"won't be part of metadata\\"
|
||||
}
|
||||
}",
|
||||
"site-docs-root-absolute-slug-md-db5.json": "{
|
||||
|
|
|
@ -44,7 +44,7 @@ function testField(params: {
|
|||
// eslint-disable-next-line jest/no-jasmine-globals
|
||||
fail(
|
||||
new Error(
|
||||
`Doc frontmatter is expected to be rejected, but was accepted successfully:\n ${JSON.stringify(
|
||||
`Doc front matter is expected to be rejected, but was accepted successfully:\n ${JSON.stringify(
|
||||
frontMatter,
|
||||
null,
|
||||
2,
|
||||
|
|
|
@ -37,15 +37,15 @@ const fixtureDir = path.join(__dirname, '__fixtures__');
|
|||
|
||||
const createFakeDocFile = ({
|
||||
source,
|
||||
frontmatter = {},
|
||||
frontMatter = {},
|
||||
markdown = 'some markdown content',
|
||||
}: {
|
||||
source: string;
|
||||
frontmatter?: Record<string, string>;
|
||||
frontMatter?: Record<string, string>;
|
||||
markdown?: string;
|
||||
}): DocFile => {
|
||||
const content = `---
|
||||
${Object.entries(frontmatter)
|
||||
${Object.entries(frontMatter)
|
||||
.map(([key, value]) => `${key}: ${value}`)
|
||||
.join('\n')}
|
||||
---
|
||||
|
@ -313,7 +313,7 @@ describe('simple site', () => {
|
|||
});
|
||||
});
|
||||
|
||||
test('docs with custom editUrl & unrelated frontmatter', async () => {
|
||||
test('docs with custom editUrl & unrelated frontMatter', async () => {
|
||||
const {defaultTestUtils} = await loadSite();
|
||||
|
||||
await defaultTestUtils.testMeta('lorem.md', {
|
||||
|
@ -328,7 +328,7 @@ describe('simple site', () => {
|
|||
description: 'Lorem ipsum.',
|
||||
frontMatter: {
|
||||
custom_edit_url: 'https://github.com/customUrl/docs/lorem.md',
|
||||
unrelated_frontmatter: "won't be part of metadata",
|
||||
unrelated_front_matter: "won't be part of metadata",
|
||||
},
|
||||
tags: [],
|
||||
});
|
||||
|
@ -422,7 +422,7 @@ describe('simple site', () => {
|
|||
description: 'Lorem ipsum.',
|
||||
frontMatter: {
|
||||
custom_edit_url: 'https://github.com/customUrl/docs/lorem.md',
|
||||
unrelated_frontmatter: "won't be part of metadata",
|
||||
unrelated_front_matter: "won't be part of metadata",
|
||||
},
|
||||
lastUpdatedAt: 1539502055,
|
||||
formattedLastUpdatedAt: '10/14/2018',
|
||||
|
@ -475,7 +475,7 @@ describe('simple site', () => {
|
|||
defaultTestUtils.processDocFile(
|
||||
createFakeDocFile({
|
||||
source: 'some/fake/path',
|
||||
frontmatter: {
|
||||
frontMatter: {
|
||||
id: 'Hello/world',
|
||||
},
|
||||
}),
|
||||
|
@ -499,7 +499,7 @@ describe('simple site', () => {
|
|||
docs.push(
|
||||
createFakeDocFile({
|
||||
source: 'hehe',
|
||||
frontmatter: {pagination_prev: 'nonexistent'},
|
||||
frontMatter: {pagination_prev: 'nonexistent'},
|
||||
}),
|
||||
);
|
||||
await expect(
|
||||
|
|
|
@ -70,13 +70,13 @@ describe('getSlug', () => {
|
|||
).toEqual('/dir/subdir/');
|
||||
});
|
||||
|
||||
test('should ignore conventional doc index when explicit slug frontmatter is provided', () => {
|
||||
test('should ignore conventional doc index when explicit slug front matter is provided', () => {
|
||||
expect(
|
||||
getSlug({
|
||||
baseID: 'doc',
|
||||
source: '@site/docs/dir/subdir/index.md',
|
||||
sourceDirName: '/dir/subdir',
|
||||
frontmatterSlug: '/my/frontMatterSlug',
|
||||
frontMatterSlug: '/my/frontMatterSlug',
|
||||
}),
|
||||
).toEqual('/my/frontMatterSlug');
|
||||
});
|
||||
|
@ -120,13 +120,13 @@ describe('getSlug', () => {
|
|||
).toEqual('/doc');
|
||||
});
|
||||
|
||||
test('should resolve absolute slug frontmatter', () => {
|
||||
test('should resolve absolute slug front matter', () => {
|
||||
expect(
|
||||
getSlug({
|
||||
baseID: 'any',
|
||||
source: '@site/docs/doc.md',
|
||||
sourceDirName: '.',
|
||||
frontmatterSlug: '/abc/def',
|
||||
frontMatterSlug: '/abc/def',
|
||||
}),
|
||||
).toEqual('/abc/def');
|
||||
expect(
|
||||
|
@ -134,7 +134,7 @@ describe('getSlug', () => {
|
|||
baseID: 'any',
|
||||
source: '@site/docs/any/doc.md',
|
||||
sourceDirName: './any',
|
||||
frontmatterSlug: '/abc/def',
|
||||
frontMatterSlug: '/abc/def',
|
||||
}),
|
||||
).toEqual('/abc/def');
|
||||
expect(
|
||||
|
@ -142,18 +142,18 @@ describe('getSlug', () => {
|
|||
baseID: 'any',
|
||||
source: '@site/docs/any/any/doc.md',
|
||||
sourceDirName: './any/any',
|
||||
frontmatterSlug: '/abc/def',
|
||||
frontMatterSlug: '/abc/def',
|
||||
}),
|
||||
).toEqual('/abc/def');
|
||||
});
|
||||
|
||||
test('should resolve relative slug frontmatter', () => {
|
||||
test('should resolve relative slug front matter', () => {
|
||||
expect(
|
||||
getSlug({
|
||||
baseID: 'any',
|
||||
source: '@site/docs/doc.md',
|
||||
sourceDirName: '.',
|
||||
frontmatterSlug: 'abc/def',
|
||||
frontMatterSlug: 'abc/def',
|
||||
}),
|
||||
).toEqual('/abc/def');
|
||||
expect(
|
||||
|
@ -161,7 +161,7 @@ describe('getSlug', () => {
|
|||
baseID: 'any',
|
||||
source: '@site/docs/dir/doc.md',
|
||||
sourceDirName: '/dir',
|
||||
frontmatterSlug: 'abc/def',
|
||||
frontMatterSlug: 'abc/def',
|
||||
}),
|
||||
).toEqual('/dir/abc/def');
|
||||
expect(
|
||||
|
@ -169,7 +169,7 @@ describe('getSlug', () => {
|
|||
baseID: 'any',
|
||||
source: '@site/docs/unslashedDir/doc.md',
|
||||
sourceDirName: 'unslashedDir',
|
||||
frontmatterSlug: 'abc/def',
|
||||
frontMatterSlug: 'abc/def',
|
||||
}),
|
||||
).toEqual('/unslashedDir/abc/def');
|
||||
expect(
|
||||
|
@ -177,7 +177,7 @@ describe('getSlug', () => {
|
|||
baseID: 'any',
|
||||
source: '@site/docs/dir/subdir/doc.md',
|
||||
sourceDirName: 'dir/subdir',
|
||||
frontmatterSlug: 'abc/def',
|
||||
frontMatterSlug: 'abc/def',
|
||||
}),
|
||||
).toEqual('/dir/subdir/abc/def');
|
||||
expect(
|
||||
|
@ -185,7 +185,7 @@ describe('getSlug', () => {
|
|||
baseID: 'any',
|
||||
source: '@site/docs/dir/doc.md',
|
||||
sourceDirName: '/dir',
|
||||
frontmatterSlug: './abc/def',
|
||||
frontMatterSlug: './abc/def',
|
||||
}),
|
||||
).toEqual('/dir/abc/def');
|
||||
expect(
|
||||
|
@ -193,7 +193,7 @@ describe('getSlug', () => {
|
|||
baseID: 'any',
|
||||
source: '@site/docs/dir/doc.md',
|
||||
sourceDirName: '/dir',
|
||||
frontmatterSlug: './abc/../def',
|
||||
frontMatterSlug: './abc/../def',
|
||||
}),
|
||||
).toEqual('/dir/def');
|
||||
expect(
|
||||
|
@ -201,7 +201,7 @@ describe('getSlug', () => {
|
|||
baseID: 'any',
|
||||
source: '@site/docs/dir/subdir/doc.md',
|
||||
sourceDirName: '/dir/subdir',
|
||||
frontmatterSlug: '../abc/def',
|
||||
frontMatterSlug: '../abc/def',
|
||||
}),
|
||||
).toEqual('/dir/abc/def');
|
||||
expect(
|
||||
|
@ -209,7 +209,7 @@ describe('getSlug', () => {
|
|||
baseID: 'any',
|
||||
source: '@site/docs/dir/subdirdoc.md',
|
||||
sourceDirName: '/dir/subdir',
|
||||
frontmatterSlug: '../../../../../abc/../def',
|
||||
frontMatterSlug: '../../../../../abc/../def',
|
||||
}),
|
||||
).toEqual('/def');
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue