@docusaurus/plugin-content-pages 2.0.0-beta.20 → 2.0.0-beta.21
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 +1 -1
- package/lib/index.js +1 -1
- package/lib/markdownLoader.js +1 -1
- package/lib/options.d.ts +1 -1
- package/package.json +9 -9
- package/src/index.ts +3 -3
- package/src/markdownLoader.ts +1 -1
- package/src/options.ts +2 -2
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):
|
|
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
|
-
|
|
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],
|
package/lib/markdownLoader.js
CHANGED
|
@@ -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
|
|
14
|
+
return callback(null, fileString);
|
|
15
15
|
}
|
|
16
16
|
exports.default = markdownLoader;
|
package/lib/options.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import type { PluginOptions, Options } from '@docusaurus/plugin-content-pages';
|
|
8
7
|
import type { OptionValidationContext } from '@docusaurus/types';
|
|
8
|
+
import type { PluginOptions, Options } from '@docusaurus/plugin-content-pages';
|
|
9
9
|
export declare const DEFAULT_OPTIONS: PluginOptions;
|
|
10
10
|
export declare function validateOptions({ validate, options, }: OptionValidationContext<Options, PluginOptions>): PluginOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-content-pages",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.21",
|
|
4
4
|
"description": "Pages plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-content-pages.d.ts",
|
|
@@ -18,24 +18,24 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/core": "2.0.0-beta.
|
|
22
|
-
"@docusaurus/mdx-loader": "2.0.0-beta.
|
|
23
|
-
"@docusaurus/utils": "2.0.0-beta.
|
|
24
|
-
"@docusaurus/utils-validation": "2.0.0-beta.
|
|
21
|
+
"@docusaurus/core": "2.0.0-beta.21",
|
|
22
|
+
"@docusaurus/mdx-loader": "2.0.0-beta.21",
|
|
23
|
+
"@docusaurus/utils": "2.0.0-beta.21",
|
|
24
|
+
"@docusaurus/utils-validation": "2.0.0-beta.21",
|
|
25
25
|
"fs-extra": "^10.1.0",
|
|
26
26
|
"remark-admonitions": "^1.2.1",
|
|
27
27
|
"tslib": "^2.4.0",
|
|
28
|
-
"webpack": "^5.72.
|
|
28
|
+
"webpack": "^5.72.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@docusaurus/types": "2.0.0-beta.
|
|
31
|
+
"@docusaurus/types": "2.0.0-beta.21"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": "^16.8.4 || ^17.0.0",
|
|
35
35
|
"react-dom": "^16.8.4 || ^17.0.0"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
|
-
"node": ">=14"
|
|
38
|
+
"node": ">=16.14"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "69ac49fc6909517f13615ee40290c4bd00c39df4"
|
|
41
41
|
}
|
package/src/index.ts
CHANGED
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
DEFAULT_PLUGIN_ID,
|
|
22
22
|
parseMarkdownString,
|
|
23
23
|
} from '@docusaurus/utils';
|
|
24
|
-
import type {LoadContext, Plugin} from '@docusaurus/types';
|
|
25
24
|
import admonitions from 'remark-admonitions';
|
|
26
25
|
import {validatePageFrontMatter} from './frontMatter';
|
|
27
26
|
|
|
27
|
+
import type {LoadContext, Plugin} from '@docusaurus/types';
|
|
28
28
|
import type {PagesContentPaths} from './types';
|
|
29
29
|
import type {
|
|
30
30
|
PluginOptions,
|
|
@@ -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
|
|
42
|
+
export default function pluginContentPages(
|
|
43
43
|
context: LoadContext,
|
|
44
44
|
options: PluginOptions,
|
|
45
|
-
):
|
|
45
|
+
): Plugin<LoadedContent | null> {
|
|
46
46
|
if (options.admonitions) {
|
|
47
47
|
options.remarkPlugins = options.remarkPlugins.concat([
|
|
48
48
|
[admonitions, options.admonitions],
|
package/src/markdownLoader.ts
CHANGED
package/src/options.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type {PluginOptions, Options} from '@docusaurus/plugin-content-pages';
|
|
9
8
|
import {
|
|
10
9
|
Joi,
|
|
11
10
|
RemarkPluginsSchema,
|
|
@@ -14,6 +13,7 @@ import {
|
|
|
14
13
|
} from '@docusaurus/utils-validation';
|
|
15
14
|
import {GlobExcludeDefault} from '@docusaurus/utils';
|
|
16
15
|
import type {OptionValidationContext} from '@docusaurus/types';
|
|
16
|
+
import type {PluginOptions, Options} from '@docusaurus/plugin-content-pages';
|
|
17
17
|
|
|
18
18
|
export const DEFAULT_OPTIONS: PluginOptions = {
|
|
19
19
|
path: 'src/pages', // Path to data on filesystem, relative to site dir.
|
|
@@ -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),
|