@graphql-markdown/docusaurus 1.34.0 → 1.35.0
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/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -46
- package/dist/mdx/category.d.ts +1 -1
- package/dist/mdx/category.d.ts.map +1 -1
- package/dist/mdx/index.d.ts +2 -76
- package/dist/mdx/index.d.ts.map +1 -1
- package/dist/mdx/index.js +14 -133
- package/package.json +8 -7
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAWzE;;;;;;;;GAQG;AACH,wBAA8B,yBAAyB,CACrD,CAAC,EAAE,WAAW,EACd,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,aAAa,CAAC,GAC1D,OAAO,CAAC,MAAM,CAAC,CA+BjB;AAED,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,43 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
35
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
6
|
exports.createMDXFormatter = void 0;
|
|
37
7
|
exports.default = pluginGraphQLDocGenerator;
|
|
38
8
|
const utils_1 = require("@docusaurus/utils");
|
|
39
9
|
const cli_1 = require("@graphql-markdown/cli");
|
|
40
|
-
const logger_1 =
|
|
10
|
+
const logger_1 = __importDefault(require("@graphql-markdown/logger"));
|
|
41
11
|
const NAME = "docusaurus-graphql-doc-generator";
|
|
42
12
|
const LOGGER_MODULE = "@docusaurus/logger";
|
|
43
13
|
const MDX_PACKAGE = "@graphql-markdown/docusaurus/mdx";
|
|
@@ -54,16 +24,6 @@ async function pluginGraphQLDocGenerator(_, options) {
|
|
|
54
24
|
await (0, logger_1.default)(LOGGER_MODULE);
|
|
55
25
|
return {
|
|
56
26
|
name: NAME,
|
|
57
|
-
/**
|
|
58
|
-
* @experimental
|
|
59
|
-
*/
|
|
60
|
-
async loadContent() {
|
|
61
|
-
if (options.runOnBuild !== true) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
(0, logger_1.log)("`runOnBuild` option is deprecated and will be removed in a future release. Use the `graphql-to-doc` CLI command instead.", logger_1.LogLevel.warn);
|
|
65
|
-
await (0, cli_1.runGraphQLMarkdown)(options, {}, LOGGER_MODULE);
|
|
66
|
-
},
|
|
67
27
|
/**
|
|
68
28
|
* Extends Docusaurus CLI with GraphQL Documentation generator command.
|
|
69
29
|
* This method adds a custom command to generate GraphQL documentation
|
|
@@ -80,9 +40,9 @@ async function pluginGraphQLDocGenerator(_, options) {
|
|
|
80
40
|
generatorFrameworkVersion: utils_1.DOCUSAURUS_VERSION,
|
|
81
41
|
...options.docOptions,
|
|
82
42
|
},
|
|
83
|
-
}, LOGGER_MODULE, options.mdxParser ?? MDX_PACKAGE));
|
|
43
|
+
}, LOGGER_MODULE, options.formatter ?? options.mdxParser ?? MDX_PACKAGE));
|
|
84
44
|
},
|
|
85
45
|
};
|
|
86
46
|
}
|
|
87
|
-
|
|
47
|
+
var mdx_1 = require("./mdx");
|
|
88
48
|
Object.defineProperty(exports, "createMDXFormatter", { enumerable: true, get: function () { return mdx_1.createMDXFormatter; } });
|
package/dist/mdx/category.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare const beforeGenerateIndexMetafileHook: (event: {
|
|
|
15
15
|
data: {
|
|
16
16
|
dirPath: string;
|
|
17
17
|
category: string;
|
|
18
|
-
options?: Record<string, unknown
|
|
18
|
+
options?: Record<string, unknown>;
|
|
19
19
|
};
|
|
20
20
|
}) => Promise<void>;
|
|
21
21
|
//# sourceMappingURL=category.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category.d.ts","sourceRoot":"","sources":["../../src/mdx/category.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkBH;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B
|
|
1
|
+
{"version":3,"file":"category.d.ts","sourceRoot":"","sources":["../../src/mdx/category.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkBH;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,UAAiB;IAC3D,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,CAAC;CACH,KAAG,OAAO,CAAC,IAAI,CA2Bf,CAAC"}
|
package/dist/mdx/index.d.ts
CHANGED
|
@@ -1,85 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module mdx
|
|
3
3
|
* This module provides utilities for generating MDX content in Docusaurus format.
|
|
4
|
-
*
|
|
5
|
-
* specification links, and other MDX-specific formatting for GraphQL documentation.
|
|
4
|
+
* Formatter implementation lives in \@graphql-markdown/formatters/docusaurus.
|
|
6
5
|
*
|
|
7
6
|
* @primaryExport
|
|
8
7
|
* @packageDocumentation
|
|
9
8
|
*/
|
|
10
|
-
|
|
11
|
-
export { mdxDeclaration } from "./components";
|
|
9
|
+
export { createMDXFormatter, formatMDXAdmonition, formatMDXBadge, formatMDXBullet, formatMDXDetails, formatMDXFrontmatter, formatMDXLink, formatMDXNameEntity, formatMDXSpecifiedByLink, mdxDeclaration, } from "@graphql-markdown/formatters/docusaurus";
|
|
12
10
|
export { beforeGenerateIndexMetafileHook } from "./category";
|
|
13
|
-
/**
|
|
14
|
-
* Formats a Badge inline-block in MDX format
|
|
15
|
-
* @param param - The badge configuration object
|
|
16
|
-
* @returns Formatted MDX string for the badge
|
|
17
|
-
*/
|
|
18
|
-
export declare const formatMDXBadge: ({ text, classname }: Badge) => MDXString;
|
|
19
|
-
/**
|
|
20
|
-
* Formats an admonition block in MDX format
|
|
21
|
-
* @param param - The admonition configuration object
|
|
22
|
-
* @param meta - Optional metadata for generator configuration
|
|
23
|
-
* @returns Formatted MDX string for the admonition
|
|
24
|
-
*/
|
|
25
|
-
export declare const formatMDXAdmonition: ({ text, title, type }: AdmonitionType, meta: Maybe<MetaInfo>) => MDXString;
|
|
26
|
-
/**
|
|
27
|
-
* Creates a bullet point element in MDX format
|
|
28
|
-
* @param text - Optional text to append after the bullet point
|
|
29
|
-
* @returns Formatted MDX string for the bullet point
|
|
30
|
-
*/
|
|
31
|
-
export declare const formatMDXBullet: (text?: string) => MDXString;
|
|
32
|
-
/**
|
|
33
|
-
* Creates a collapsible details section in MDX format
|
|
34
|
-
* @param param - The collapsible section configuration
|
|
35
|
-
* @returns Formatted MDX string for the collapsible section
|
|
36
|
-
*/
|
|
37
|
-
export declare const formatMDXDetails: ({ dataOpen, dataClose, }: CollapsibleOption) => MDXString;
|
|
38
|
-
/**
|
|
39
|
-
* Creates a link to the specification documentation
|
|
40
|
-
* @param url - The URL to the specification
|
|
41
|
-
* @returns Formatted MDX string for the specification link
|
|
42
|
-
*/
|
|
43
|
-
export declare const formatMDXSpecifiedByLink: (url: string) => MDXString;
|
|
44
|
-
/**
|
|
45
|
-
* Formats a name entity with optional parent type
|
|
46
|
-
* @param name - The name to format
|
|
47
|
-
* @param parentType - Optional parent type to prefix the name
|
|
48
|
-
* @returns Formatted MDX string for the name entity
|
|
49
|
-
*/
|
|
50
|
-
export declare const formatMDXNameEntity: (name: string, parentType?: Maybe<string>) => MDXString;
|
|
51
|
-
/**
|
|
52
|
-
* Formats a link in MDX format
|
|
53
|
-
* @param param - The link configuration object
|
|
54
|
-
* @returns Formatted MDX link object
|
|
55
|
-
*/
|
|
56
|
-
export declare const formatMDXLink: ({ text, url }: TypeLink) => TypeLink;
|
|
57
|
-
/**
|
|
58
|
-
* Default frontmatter formatter for MDX.
|
|
59
|
-
*
|
|
60
|
-
* @param _props - The front matter options (unused)
|
|
61
|
-
* @param formatted - The formatted front matter as an array of strings
|
|
62
|
-
* @returns Formatted MDX string for the front matter
|
|
63
|
-
*/
|
|
64
|
-
export declare const formatMDXFrontmatter: (_props: Maybe<FrontMatterOptions>, formatted: Maybe<string[]>) => MDXString;
|
|
65
|
-
/**
|
|
66
|
-
* Creates an MDX formatter for Docusaurus documentation.
|
|
67
|
-
*
|
|
68
|
-
* The MDX formatter produces MDX/HTML markup compatible with Docusaurus.
|
|
69
|
-
* It uses helper components like `<Badge>`, `<Bullet>`, and `<SpecifiedBy>`,
|
|
70
|
-
* and emits native `<details>/<summary>` blocks for collapsible sections.
|
|
71
|
-
*
|
|
72
|
-
* @param meta - Optional metadata for framework-specific formatting
|
|
73
|
-
* @returns A complete Formatter implementation for MDX output
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* ```typescript
|
|
77
|
-
* import { createMDXFormatter } from '@graphql-markdown/docusaurus';
|
|
78
|
-
*
|
|
79
|
-
* const formatter = createMDXFormatter({ generatorFrameworkName: 'docusaurus' });
|
|
80
|
-
* const badge = formatter.formatMDXBadge({ text: 'Required' });
|
|
81
|
-
* // '<Badge class="badge badge--secondary " text="Required"/>'
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
|
-
export declare const createMDXFormatter: (meta?: Maybe<MetaInfo>) => Formatter;
|
|
85
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/mdx/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mdx/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mdx/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,GACf,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/mdx/index.js
CHANGED
|
@@ -2,142 +2,23 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @module mdx
|
|
4
4
|
* This module provides utilities for generating MDX content in Docusaurus format.
|
|
5
|
-
*
|
|
6
|
-
* specification links, and other MDX-specific formatting for GraphQL documentation.
|
|
5
|
+
* Formatter implementation lives in \@graphql-markdown/formatters/docusaurus.
|
|
7
6
|
*
|
|
8
7
|
* @primaryExport
|
|
9
8
|
* @packageDocumentation
|
|
10
9
|
*/
|
|
11
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Object.defineProperty(exports, "
|
|
18
|
-
|
|
11
|
+
exports.beforeGenerateIndexMetafileHook = exports.mdxDeclaration = exports.formatMDXSpecifiedByLink = exports.formatMDXNameEntity = exports.formatMDXLink = exports.formatMDXFrontmatter = exports.formatMDXDetails = exports.formatMDXBullet = exports.formatMDXBadge = exports.formatMDXAdmonition = exports.createMDXFormatter = void 0;
|
|
12
|
+
var docusaurus_1 = require("@graphql-markdown/formatters/docusaurus");
|
|
13
|
+
Object.defineProperty(exports, "createMDXFormatter", { enumerable: true, get: function () { return docusaurus_1.createMDXFormatter; } });
|
|
14
|
+
Object.defineProperty(exports, "formatMDXAdmonition", { enumerable: true, get: function () { return docusaurus_1.formatMDXAdmonition; } });
|
|
15
|
+
Object.defineProperty(exports, "formatMDXBadge", { enumerable: true, get: function () { return docusaurus_1.formatMDXBadge; } });
|
|
16
|
+
Object.defineProperty(exports, "formatMDXBullet", { enumerable: true, get: function () { return docusaurus_1.formatMDXBullet; } });
|
|
17
|
+
Object.defineProperty(exports, "formatMDXDetails", { enumerable: true, get: function () { return docusaurus_1.formatMDXDetails; } });
|
|
18
|
+
Object.defineProperty(exports, "formatMDXFrontmatter", { enumerable: true, get: function () { return docusaurus_1.formatMDXFrontmatter; } });
|
|
19
|
+
Object.defineProperty(exports, "formatMDXLink", { enumerable: true, get: function () { return docusaurus_1.formatMDXLink; } });
|
|
20
|
+
Object.defineProperty(exports, "formatMDXNameEntity", { enumerable: true, get: function () { return docusaurus_1.formatMDXNameEntity; } });
|
|
21
|
+
Object.defineProperty(exports, "formatMDXSpecifiedByLink", { enumerable: true, get: function () { return docusaurus_1.formatMDXSpecifiedByLink; } });
|
|
22
|
+
Object.defineProperty(exports, "mdxDeclaration", { enumerable: true, get: function () { return docusaurus_1.mdxDeclaration; } });
|
|
23
|
+
var category_1 = require("./category");
|
|
19
24
|
Object.defineProperty(exports, "beforeGenerateIndexMetafileHook", { enumerable: true, get: function () { return category_1.beforeGenerateIndexMetafileHook; } });
|
|
20
|
-
/**
|
|
21
|
-
* Formats a Badge inline-block in MDX format
|
|
22
|
-
* @param param - The badge configuration object
|
|
23
|
-
* @returns Formatted MDX string for the badge
|
|
24
|
-
*/
|
|
25
|
-
const formatMDXBadge = ({ text, classname }) => {
|
|
26
|
-
const style = typeof classname === "string" ? `badge--${classname.toLowerCase()}` : "";
|
|
27
|
-
return `<Badge class="badge ${DEFAULT_CSS_CLASSNAME} ${style}" text="${text}"/>`;
|
|
28
|
-
};
|
|
29
|
-
exports.formatMDXBadge = formatMDXBadge;
|
|
30
|
-
/**
|
|
31
|
-
* Formats an admonition block in MDX format
|
|
32
|
-
* @param param - The admonition configuration object
|
|
33
|
-
* @param meta - Optional metadata for generator configuration
|
|
34
|
-
* @returns Formatted MDX string for the admonition
|
|
35
|
-
*/
|
|
36
|
-
const formatMDXAdmonition = ({ text, title, type }, meta) => {
|
|
37
|
-
const isDocusaurus = meta?.generatorFrameworkName === "docusaurus";
|
|
38
|
-
if (isDocusaurus && meta.generatorFrameworkVersion?.startsWith("2")) {
|
|
39
|
-
const oldType = type === "warning" ? "caution" : type;
|
|
40
|
-
return `${utils_1.MARKDOWN_EOP}:::${oldType} ${title}${text}:::`;
|
|
41
|
-
}
|
|
42
|
-
return `${utils_1.MARKDOWN_EOP}:::${type}[${title}]${text}:::`;
|
|
43
|
-
};
|
|
44
|
-
exports.formatMDXAdmonition = formatMDXAdmonition;
|
|
45
|
-
/**
|
|
46
|
-
* Creates a bullet point element in MDX format
|
|
47
|
-
* @param text - Optional text to append after the bullet point
|
|
48
|
-
* @returns Formatted MDX string for the bullet point
|
|
49
|
-
*/
|
|
50
|
-
const formatMDXBullet = (text = "") => {
|
|
51
|
-
return `<Bullet />${text}`;
|
|
52
|
-
};
|
|
53
|
-
exports.formatMDXBullet = formatMDXBullet;
|
|
54
|
-
/**
|
|
55
|
-
* Creates a collapsible details section in MDX format
|
|
56
|
-
* @param param - The collapsible section configuration
|
|
57
|
-
* @returns Formatted MDX string for the collapsible section
|
|
58
|
-
*/
|
|
59
|
-
const formatMDXDetails = ({ dataOpen, dataClose, }) => {
|
|
60
|
-
const openLabel = (0, utils_1.escapeMDX)(`Hide ${dataOpen}`);
|
|
61
|
-
const closeLabel = (0, utils_1.escapeMDX)(`Show ${dataClose}`);
|
|
62
|
-
return `${utils_1.MARKDOWN_EOP}<details class="graphql-markdown-details">${utils_1.MARKDOWN_EOL}<summary>${utils_1.MARKDOWN_EOL}<span class="graphql-markdown-details-label-closed">${closeLabel}</span>${utils_1.MARKDOWN_EOL}<span class="graphql-markdown-details-label-open">${openLabel}</span>${utils_1.MARKDOWN_EOL}</summary>${utils_1.MARKDOWN_EOP}\r${utils_1.MARKDOWN_EOP}</details>${utils_1.MARKDOWN_EOP}`;
|
|
63
|
-
};
|
|
64
|
-
exports.formatMDXDetails = formatMDXDetails;
|
|
65
|
-
/**
|
|
66
|
-
* Creates a link to the specification documentation
|
|
67
|
-
* @param url - The URL to the specification
|
|
68
|
-
* @returns Formatted MDX string for the specification link
|
|
69
|
-
*/
|
|
70
|
-
const formatMDXSpecifiedByLink = (url) => {
|
|
71
|
-
return `<SpecifiedBy url="${url}"/>`;
|
|
72
|
-
};
|
|
73
|
-
exports.formatMDXSpecifiedByLink = formatMDXSpecifiedByLink;
|
|
74
|
-
/**
|
|
75
|
-
* Formats a name entity with optional parent type
|
|
76
|
-
* @param name - The name to format
|
|
77
|
-
* @param parentType - Optional parent type to prefix the name
|
|
78
|
-
* @returns Formatted MDX string for the name entity
|
|
79
|
-
*/
|
|
80
|
-
const formatMDXNameEntity = (name, parentType) => {
|
|
81
|
-
const parentName = parentType ? `${parentType}.` : "";
|
|
82
|
-
return `<code style={{ fontWeight: 'normal' }}>${(0, utils_1.escapeMDX)(parentName)}<b>${(0, utils_1.escapeMDX)(name)}</b></code>`;
|
|
83
|
-
};
|
|
84
|
-
exports.formatMDXNameEntity = formatMDXNameEntity;
|
|
85
|
-
/**
|
|
86
|
-
* Formats a link in MDX format
|
|
87
|
-
* @param param - The link configuration object
|
|
88
|
-
* @returns Formatted MDX link object
|
|
89
|
-
*/
|
|
90
|
-
const formatMDXLink = ({ text, url }) => {
|
|
91
|
-
return {
|
|
92
|
-
text,
|
|
93
|
-
url: `${url}${LINK_MDX_EXTENSION}`,
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
exports.formatMDXLink = formatMDXLink;
|
|
97
|
-
/**
|
|
98
|
-
* Default frontmatter formatter for MDX.
|
|
99
|
-
*
|
|
100
|
-
* @param _props - The front matter options (unused)
|
|
101
|
-
* @param formatted - The formatted front matter as an array of strings
|
|
102
|
-
* @returns Formatted MDX string for the front matter
|
|
103
|
-
*/
|
|
104
|
-
const formatMDXFrontmatter = (_props, formatted) => {
|
|
105
|
-
return formatted
|
|
106
|
-
? [utils_1.FRONT_MATTER_DELIMITER, ...formatted, utils_1.FRONT_MATTER_DELIMITER].join(utils_1.MARKDOWN_EOL)
|
|
107
|
-
: "";
|
|
108
|
-
};
|
|
109
|
-
exports.formatMDXFrontmatter = formatMDXFrontmatter;
|
|
110
|
-
/**
|
|
111
|
-
* Creates an MDX formatter for Docusaurus documentation.
|
|
112
|
-
*
|
|
113
|
-
* The MDX formatter produces MDX/HTML markup compatible with Docusaurus.
|
|
114
|
-
* It uses helper components like `<Badge>`, `<Bullet>`, and `<SpecifiedBy>`,
|
|
115
|
-
* and emits native `<details>/<summary>` blocks for collapsible sections.
|
|
116
|
-
*
|
|
117
|
-
* @param meta - Optional metadata for framework-specific formatting
|
|
118
|
-
* @returns A complete Formatter implementation for MDX output
|
|
119
|
-
*
|
|
120
|
-
* @example
|
|
121
|
-
* ```typescript
|
|
122
|
-
* import { createMDXFormatter } from '@graphql-markdown/docusaurus';
|
|
123
|
-
*
|
|
124
|
-
* const formatter = createMDXFormatter({ generatorFrameworkName: 'docusaurus' });
|
|
125
|
-
* const badge = formatter.formatMDXBadge({ text: 'Required' });
|
|
126
|
-
* // '<Badge class="badge badge--secondary " text="Required"/>'
|
|
127
|
-
* ```
|
|
128
|
-
*/
|
|
129
|
-
const createMDXFormatter = (meta) => {
|
|
130
|
-
return {
|
|
131
|
-
formatMDXBadge: exports.formatMDXBadge,
|
|
132
|
-
formatMDXAdmonition: (admonition, _meta) => {
|
|
133
|
-
return (0, exports.formatMDXAdmonition)(admonition, meta ?? _meta);
|
|
134
|
-
},
|
|
135
|
-
formatMDXBullet: exports.formatMDXBullet,
|
|
136
|
-
formatMDXDetails: exports.formatMDXDetails,
|
|
137
|
-
formatMDXFrontmatter: exports.formatMDXFrontmatter,
|
|
138
|
-
formatMDXLink: exports.formatMDXLink,
|
|
139
|
-
formatMDXNameEntity: exports.formatMDXNameEntity,
|
|
140
|
-
formatMDXSpecifiedByLink: exports.formatMDXSpecifiedByLink,
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
|
-
exports.createMDXFormatter = createMDXFormatter;
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/graphql-markdown/graphql-markdown/issues"
|
|
7
7
|
},
|
|
8
|
-
"version": "1.
|
|
8
|
+
"version": "1.35.0",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -74,14 +74,15 @@
|
|
|
74
74
|
"test:watch": "jest --watch"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@graphql-markdown/cli": "^0.
|
|
78
|
-
"@graphql-markdown/
|
|
79
|
-
"@graphql-markdown/
|
|
80
|
-
"@graphql-markdown/
|
|
81
|
-
"@
|
|
77
|
+
"@graphql-markdown/cli": "^1.0.0",
|
|
78
|
+
"@graphql-markdown/formatters": "^1.0.0",
|
|
79
|
+
"@graphql-markdown/logger": "^1.0.7",
|
|
80
|
+
"@graphql-markdown/types": "^1.13.0",
|
|
81
|
+
"@graphql-markdown/utils": "^1.12.0",
|
|
82
|
+
"@docusaurus/utils": "3.10.1"
|
|
82
83
|
},
|
|
83
84
|
"devDependencies": {
|
|
84
|
-
"@docusaurus/types": "
|
|
85
|
+
"@docusaurus/types": "3.10.1",
|
|
85
86
|
"@graphql-markdown/tooling-config": "^1.0.0"
|
|
86
87
|
},
|
|
87
88
|
"peerDependencies": {
|