@docusaurus/plugin-content-pages 0.0.0-5044 → 0.0.0-5049

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -8,5 +8,5 @@ import type { LoadContext, Plugin } from '@docusaurus/types';
8
8
  import type { PagesContentPaths } from './types';
9
9
  import type { PluginOptions, LoadedContent } from '@docusaurus/plugin-content-pages';
10
10
  export declare function getContentPathList(contentPaths: PagesContentPaths): string[];
11
- export default function pluginContentPages(context: LoadContext, options: PluginOptions): Promise<Plugin<LoadedContent | null>>;
11
+ export default function pluginContentPages(context: LoadContext, options: PluginOptions): Plugin<LoadedContent | null>;
12
12
  export { validateOptions } from './options';
package/lib/index.js CHANGED
@@ -18,7 +18,7 @@ function getContentPathList(contentPaths) {
18
18
  }
19
19
  exports.getContentPathList = getContentPathList;
20
20
  const isMarkdownSource = (source) => source.endsWith('.md') || source.endsWith('.mdx');
21
- async function pluginContentPages(context, options) {
21
+ function pluginContentPages(context, options) {
22
22
  if (options.admonitions) {
23
23
  options.remarkPlugins = options.remarkPlugins.concat([
24
24
  [remark_admonitions_1.default, options.admonitions],
@@ -11,6 +11,6 @@ function markdownLoader(fileString) {
11
11
  // const options = this.getOptions();
12
12
  // TODO provide additional md processing here? like interlinking pages?
13
13
  // fileString = linkify(fileString)
14
- return callback?.(null, fileString);
14
+ return callback(null, fileString);
15
15
  }
16
16
  exports.default = markdownLoader;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/plugin-content-pages",
3
- "version": "0.0.0-5044",
3
+ "version": "0.0.0-5049",
4
4
  "description": "Pages plugin for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/plugin-content-pages.d.ts",
@@ -18,17 +18,17 @@
18
18
  },
19
19
  "license": "MIT",
20
20
  "dependencies": {
21
- "@docusaurus/core": "0.0.0-5044",
22
- "@docusaurus/mdx-loader": "0.0.0-5044",
23
- "@docusaurus/utils": "0.0.0-5044",
24
- "@docusaurus/utils-validation": "0.0.0-5044",
21
+ "@docusaurus/core": "0.0.0-5049",
22
+ "@docusaurus/mdx-loader": "0.0.0-5049",
23
+ "@docusaurus/utils": "0.0.0-5049",
24
+ "@docusaurus/utils-validation": "0.0.0-5049",
25
25
  "fs-extra": "^10.1.0",
26
26
  "remark-admonitions": "^1.2.1",
27
27
  "tslib": "^2.4.0",
28
28
  "webpack": "^5.72.1"
29
29
  },
30
30
  "devDependencies": {
31
- "@docusaurus/types": "0.0.0-5044"
31
+ "@docusaurus/types": "0.0.0-5049"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": "^16.8.4 || ^17.0.0",
@@ -37,5 +37,5 @@
37
37
  "engines": {
38
38
  "node": ">=14"
39
39
  },
40
- "gitHead": "9ffd6ca265dc2af7ed5b96daf5ebf32708e899cf"
40
+ "gitHead": "527b2a01c46b67483327a1a6873fccf81bc19e2c"
41
41
  }
package/src/index.ts CHANGED
@@ -39,10 +39,10 @@ export function getContentPathList(contentPaths: PagesContentPaths): string[] {
39
39
  const isMarkdownSource = (source: string) =>
40
40
  source.endsWith('.md') || source.endsWith('.mdx');
41
41
 
42
- export default async function pluginContentPages(
42
+ export default function pluginContentPages(
43
43
  context: LoadContext,
44
44
  options: PluginOptions,
45
- ): Promise<Plugin<LoadedContent | null>> {
45
+ ): Plugin<LoadedContent | null> {
46
46
  if (options.admonitions) {
47
47
  options.remarkPlugins = options.remarkPlugins.concat([
48
48
  [admonitions, options.admonitions],
@@ -18,5 +18,5 @@ export default function markdownLoader(
18
18
  // TODO provide additional md processing here? like interlinking pages?
19
19
  // fileString = linkify(fileString)
20
20
 
21
- return callback?.(null, fileString);
21
+ return callback(null, fileString);
22
22
  }
package/src/options.ts CHANGED
@@ -28,7 +28,7 @@ export const DEFAULT_OPTIONS: PluginOptions = {
28
28
  admonitions: {},
29
29
  };
30
30
 
31
- const PluginOptionSchema = Joi.object({
31
+ const PluginOptionSchema = Joi.object<PluginOptions>({
32
32
  path: Joi.string().default(DEFAULT_OPTIONS.path),
33
33
  routeBasePath: Joi.string().default(DEFAULT_OPTIONS.routeBasePath),
34
34
  include: Joi.array().items(Joi.string()).default(DEFAULT_OPTIONS.include),