@docusaurus/plugin-content-pages 0.0.0-5091 → 0.0.0-5094
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.js +2 -7
- package/lib/options.js +1 -1
- package/package.json +7 -8
- package/src/index.ts +2 -6
- package/src/options.ts +1 -1
- package/src/plugin-content-pages.d.ts +0 -1
- package/src/deps.d.ts +0 -13
package/lib/index.js
CHANGED
|
@@ -11,7 +11,6 @@ const tslib_1 = require("tslib");
|
|
|
11
11
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
12
12
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
13
13
|
const utils_1 = require("@docusaurus/utils");
|
|
14
|
-
const remark_admonitions_1 = tslib_1.__importDefault(require("remark-admonitions"));
|
|
15
14
|
const frontMatter_1 = require("./frontMatter");
|
|
16
15
|
function getContentPathList(contentPaths) {
|
|
17
16
|
return [contentPaths.contentPathLocalized, contentPaths.contentPath];
|
|
@@ -19,11 +18,6 @@ function getContentPathList(contentPaths) {
|
|
|
19
18
|
exports.getContentPathList = getContentPathList;
|
|
20
19
|
const isMarkdownSource = (source) => source.endsWith('.md') || source.endsWith('.mdx');
|
|
21
20
|
function pluginContentPages(context, options) {
|
|
22
|
-
if (options.admonitions) {
|
|
23
|
-
options.remarkPlugins = options.remarkPlugins.concat([
|
|
24
|
-
[remark_admonitions_1.default, options.admonitions],
|
|
25
|
-
]);
|
|
26
|
-
}
|
|
27
21
|
const { siteConfig, siteDir, generatedFilesDir, localizationDir } = context;
|
|
28
22
|
const contentPaths = {
|
|
29
23
|
contentPath: path_1.default.resolve(siteDir, options.path),
|
|
@@ -116,7 +110,7 @@ function pluginContentPages(context, options) {
|
|
|
116
110
|
}));
|
|
117
111
|
},
|
|
118
112
|
configureWebpack(config, isServer, { getJSLoader }) {
|
|
119
|
-
const { rehypePlugins, remarkPlugins, beforeDefaultRehypePlugins, beforeDefaultRemarkPlugins, } = options;
|
|
113
|
+
const { admonitions, rehypePlugins, remarkPlugins, beforeDefaultRehypePlugins, beforeDefaultRemarkPlugins, } = options;
|
|
120
114
|
const contentDirs = getContentPathList(contentPaths);
|
|
121
115
|
return {
|
|
122
116
|
resolve: {
|
|
@@ -136,6 +130,7 @@ function pluginContentPages(context, options) {
|
|
|
136
130
|
{
|
|
137
131
|
loader: require.resolve('@docusaurus/mdx-loader'),
|
|
138
132
|
options: {
|
|
133
|
+
admonitions,
|
|
139
134
|
remarkPlugins,
|
|
140
135
|
rehypePlugins,
|
|
141
136
|
beforeDefaultRehypePlugins,
|
package/lib/options.js
CHANGED
|
@@ -19,7 +19,7 @@ exports.DEFAULT_OPTIONS = {
|
|
|
19
19
|
rehypePlugins: [],
|
|
20
20
|
beforeDefaultRehypePlugins: [],
|
|
21
21
|
beforeDefaultRemarkPlugins: [],
|
|
22
|
-
admonitions:
|
|
22
|
+
admonitions: true,
|
|
23
23
|
};
|
|
24
24
|
const PluginOptionSchema = utils_validation_1.Joi.object({
|
|
25
25
|
path: utils_validation_1.Joi.string().default(exports.DEFAULT_OPTIONS.path),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-content-pages",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-5094",
|
|
4
4
|
"description": "Pages plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-content-pages.d.ts",
|
|
@@ -18,13 +18,12 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/core": "0.0.0-
|
|
22
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
23
|
-
"@docusaurus/types": "0.0.0-
|
|
24
|
-
"@docusaurus/utils": "0.0.0-
|
|
25
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
21
|
+
"@docusaurus/core": "0.0.0-5094",
|
|
22
|
+
"@docusaurus/mdx-loader": "0.0.0-5094",
|
|
23
|
+
"@docusaurus/types": "0.0.0-5094",
|
|
24
|
+
"@docusaurus/utils": "0.0.0-5094",
|
|
25
|
+
"@docusaurus/utils-validation": "0.0.0-5094",
|
|
26
26
|
"fs-extra": "^10.1.0",
|
|
27
|
-
"remark-admonitions": "^1.2.1",
|
|
28
27
|
"tslib": "^2.4.0",
|
|
29
28
|
"webpack": "^5.72.1"
|
|
30
29
|
},
|
|
@@ -38,5 +37,5 @@
|
|
|
38
37
|
"engines": {
|
|
39
38
|
"node": ">=16.14"
|
|
40
39
|
},
|
|
41
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "5ed0ed8f0a5918441c8b83093fd1975bfe7e0cfd"
|
|
42
41
|
}
|
package/src/index.ts
CHANGED
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
DEFAULT_PLUGIN_ID,
|
|
22
22
|
parseMarkdownString,
|
|
23
23
|
} from '@docusaurus/utils';
|
|
24
|
-
import admonitions from 'remark-admonitions';
|
|
25
24
|
import {validatePageFrontMatter} from './frontMatter';
|
|
26
25
|
|
|
27
26
|
import type {LoadContext, Plugin} from '@docusaurus/types';
|
|
@@ -43,11 +42,6 @@ export default function pluginContentPages(
|
|
|
43
42
|
context: LoadContext,
|
|
44
43
|
options: PluginOptions,
|
|
45
44
|
): Plugin<LoadedContent | null> {
|
|
46
|
-
if (options.admonitions) {
|
|
47
|
-
options.remarkPlugins = options.remarkPlugins.concat([
|
|
48
|
-
[admonitions, options.admonitions],
|
|
49
|
-
]);
|
|
50
|
-
}
|
|
51
45
|
const {siteConfig, siteDir, generatedFilesDir, localizationDir} = context;
|
|
52
46
|
|
|
53
47
|
const contentPaths: PagesContentPaths = {
|
|
@@ -170,6 +164,7 @@ export default function pluginContentPages(
|
|
|
170
164
|
|
|
171
165
|
configureWebpack(config, isServer, {getJSLoader}) {
|
|
172
166
|
const {
|
|
167
|
+
admonitions,
|
|
173
168
|
rehypePlugins,
|
|
174
169
|
remarkPlugins,
|
|
175
170
|
beforeDefaultRehypePlugins,
|
|
@@ -194,6 +189,7 @@ export default function pluginContentPages(
|
|
|
194
189
|
{
|
|
195
190
|
loader: require.resolve('@docusaurus/mdx-loader'),
|
|
196
191
|
options: {
|
|
192
|
+
admonitions,
|
|
197
193
|
remarkPlugins,
|
|
198
194
|
rehypePlugins,
|
|
199
195
|
beforeDefaultRehypePlugins,
|
package/src/options.ts
CHANGED
package/src/deps.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
declare module 'remark-admonitions' {
|
|
9
|
-
type Options = {[key: string]: unknown};
|
|
10
|
-
|
|
11
|
-
const plugin: (options?: Options) => void;
|
|
12
|
-
export = plugin;
|
|
13
|
-
}
|