-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc00018
commit 5fdab3a
Showing
9 changed files
with
348 additions
and
351 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { | ||
Options as DocsOptions, | ||
PluginOptions as DocsPluginOptions, | ||
LoadedContent as DocsLoadedContent, | ||
DocMetadata as DocsDocMetadata, | ||
} from '@docusaurus/plugin-content-docs'; | ||
import { | ||
OptionValidationContext as DocsOptionValidationContext, | ||
Validate, | ||
} from '@docusaurus/types'; | ||
|
||
export type DocMetadata = DocsDocMetadata & { | ||
bannerContent?: string; | ||
}; | ||
|
||
export type LoadedContent = DocsLoadedContent & { | ||
bannerContent?: string; | ||
}; | ||
|
||
export type PluginOptions = DocsPluginOptions & { | ||
globalSidebars: string[]; | ||
bannerPath?: string; | ||
}; | ||
|
||
export type Options = Partial<PluginOptions>; | ||
|
||
export type OptionValidationContext = { | ||
// Docusaurus does not export their schemas for us to use, | ||
// so we just pass validate function on to the docs plugin validation. | ||
validate: Validate<DocsOptions, DocsPluginOptions>; | ||
options: PluginOptions; | ||
}; | ||
|
||
declare module '@docusaurus/plugin-content-docs' { | ||
export function validateOptions( | ||
arg: DocsOptionValidationContext<DocsOptions, DocsPluginOptions>, | ||
): DocsPluginOptions; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export default function pluginTutorial(options) { | ||
return { | ||
name: '@iota-wiki/plugin-tutorial', | ||
async contentLoaded({ actions }) { | ||
actions.setGlobalData(options); | ||
}, | ||
}; | ||
} | ||
|
||
export function validateOptions({ options: userOptions }) { | ||
const id = userOptions.title.normalize().toLowerCase().replace(/\W/, '-'); | ||
|
||
const defaultOptions = { | ||
id, | ||
route: id, | ||
}; | ||
|
||
return Object.assign(defaultOptions, userOptions); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export interface Options { | ||
title: string; | ||
description: string; | ||
tags: string[]; | ||
source?: string; | ||
preview?: string; | ||
} | ||
|
||
export interface DefaultOptions { | ||
id: string; | ||
route: string; | ||
} | ||
|
||
export type UserOptions = Options & Partial<DefaultOptions>; | ||
export type NormalizedOptions = Options & DefaultOptions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.