Skip to content

Commit

Permalink
docs cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Oct 13, 2023
1 parent 5c764a3 commit 4f9047c
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions website/docs/api/plugin-methods/static-methods.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,6 @@ export function validateOptions({options, validate}) {
// highlight-end
```

In TypeScript, you can also choose to export this as a separate named export.

```ts title="my-plugin/src/index.ts"
export default function (context, options) {
return {
name: 'docusaurus-plugin',
// rest of methods
};
}

// highlight-start
export function validateOptions({options, validate}) {
const validatedOptions = validate(myValidationSchema, options);
return validatedOptions;
}
// highlight-end
```

## `validateThemeConfig({themeConfig, validate})` {#validateThemeConfig}

Return validated and normalized configuration for the theme.
Expand Down Expand Up @@ -99,21 +81,3 @@ export function validateThemeConfig({themeConfig, validate}) {
}
// highlight-end
```

In TypeScript, you can also choose to export this as a separate named export.

```ts title="my-theme/src/index.ts"
export default function (context, options) {
return {
name: 'docusaurus-plugin',
// rest of methods
};
}

// highlight-start
export function validateThemeConfig({themeConfig, validate}) {
const validatedThemeConfig = validate(myValidationSchema, options);
return validatedThemeConfig;
}
// highlight-end
```

0 comments on commit 4f9047c

Please sign in to comment.