@graphql-markdown/docusaurus 1.33.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 +2 -11
- package/dist/mdx/category.d.ts +1 -1
- package/dist/mdx/category.d.ts.map +1 -1
- package/dist/mdx/category.js +1 -1
- package/dist/mdx/components.d.ts.map +1 -1
- package/dist/mdx/components.js +0 -20
- package/dist/mdx/index.d.ts +2 -76
- package/dist/mdx/index.d.ts.map +1 -1
- package/dist/mdx/index.js +14 -127
- package/package.json +21 -9
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
|
@@ -24,15 +24,6 @@ async function pluginGraphQLDocGenerator(_, options) {
|
|
|
24
24
|
await (0, logger_1.default)(LOGGER_MODULE);
|
|
25
25
|
return {
|
|
26
26
|
name: NAME,
|
|
27
|
-
/**
|
|
28
|
-
* @experimental
|
|
29
|
-
*/
|
|
30
|
-
async loadContent() {
|
|
31
|
-
if (options.runOnBuild !== true) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
await (0, cli_1.runGraphQLMarkdown)(options, {}, LOGGER_MODULE);
|
|
35
|
-
},
|
|
36
27
|
/**
|
|
37
28
|
* Extends Docusaurus CLI with GraphQL Documentation generator command.
|
|
38
29
|
* This method adds a custom command to generate GraphQL documentation
|
|
@@ -49,9 +40,9 @@ async function pluginGraphQLDocGenerator(_, options) {
|
|
|
49
40
|
generatorFrameworkVersion: utils_1.DOCUSAURUS_VERSION,
|
|
50
41
|
...options.docOptions,
|
|
51
42
|
},
|
|
52
|
-
}, LOGGER_MODULE, options.mdxParser ?? MDX_PACKAGE));
|
|
43
|
+
}, LOGGER_MODULE, options.formatter ?? options.mdxParser ?? MDX_PACKAGE));
|
|
53
44
|
},
|
|
54
45
|
};
|
|
55
46
|
}
|
|
56
|
-
|
|
47
|
+
var mdx_1 = require("./mdx");
|
|
57
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/category.js
CHANGED
|
@@ -40,7 +40,7 @@ const beforeGenerateIndexMetafileHook = async (event) => {
|
|
|
40
40
|
const position = typeof options?.sidebarPosition === "number"
|
|
41
41
|
? options.sidebarPosition
|
|
42
42
|
: SidebarPosition.FIRST;
|
|
43
|
-
const content = `label: ${label}\nposition: ${position}\n${className}link: ${link}\ncollapsible: ${options?.collapsible ?? true}\ncollapsed: ${options?.collapsed ?? true}\n`;
|
|
43
|
+
const content = `label: ${label}\nposition: ${position}\n${className}link: ${link}\ncollapsible: ${Boolean(options?.collapsible ?? true)}\ncollapsed: ${Boolean(options?.collapsed ?? true)}\n`;
|
|
44
44
|
await (0, utils_1.ensureDir)(dirPath);
|
|
45
45
|
await (0, utils_1.saveFile)(filePath, content);
|
|
46
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/mdx/components.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD;;;;;;GAMG;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/mdx/components.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD;;;;;;GAMG;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,SAQf,CAAC"}
|
package/dist/mdx/components.js
CHANGED
|
@@ -23,25 +23,5 @@ export const SpecifiedBy = (props) => <>Specification<a className="link" style={
|
|
|
23
23
|
|
|
24
24
|
export const Badge = (props) => <><span className={props.class}>{props.text}</span></>
|
|
25
25
|
|
|
26
|
-
import { useState } from 'react';
|
|
27
|
-
|
|
28
|
-
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
|
|
29
|
-
const [open, setOpen] = useState(startOpen);
|
|
30
|
-
return (
|
|
31
|
-
<details {...(open ? { open: true } : {})} className="details" style={{ border:'none', boxShadow:'none', background:'var(--ifm-background-color)' }}>
|
|
32
|
-
<summary
|
|
33
|
-
onClick={(e) => {
|
|
34
|
-
e.preventDefault();
|
|
35
|
-
setOpen((open) => !open);
|
|
36
|
-
}}
|
|
37
|
-
style={{ listStyle:'none' }}
|
|
38
|
-
>
|
|
39
|
-
{open ? dataOpen : dataClose}
|
|
40
|
-
</summary>
|
|
41
|
-
{open && children}
|
|
42
|
-
</details>
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
26
|
|
|
47
27
|
`;
|
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 React component-based markup compatible
|
|
69
|
-
* with Docusaurus MDX rendering. It uses components like `<Badge>`,
|
|
70
|
-
* `<Bullet>`, `<Details>`, and `<SpecifiedBy>`.
|
|
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,136 +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
|
-
return `${utils_1.MARKDOWN_EOP}<Details dataOpen="Hide ${dataOpen}" dataClose="Show ${dataClose}">${utils_1.MARKDOWN_EOP}\r${utils_1.MARKDOWN_EOP}</Details>${utils_1.MARKDOWN_EOP}`;
|
|
61
|
-
};
|
|
62
|
-
exports.formatMDXDetails = formatMDXDetails;
|
|
63
|
-
/**
|
|
64
|
-
* Creates a link to the specification documentation
|
|
65
|
-
* @param url - The URL to the specification
|
|
66
|
-
* @returns Formatted MDX string for the specification link
|
|
67
|
-
*/
|
|
68
|
-
const formatMDXSpecifiedByLink = (url) => {
|
|
69
|
-
return `<SpecifiedBy url="${url}"/>`;
|
|
70
|
-
};
|
|
71
|
-
exports.formatMDXSpecifiedByLink = formatMDXSpecifiedByLink;
|
|
72
|
-
/**
|
|
73
|
-
* Formats a name entity with optional parent type
|
|
74
|
-
* @param name - The name to format
|
|
75
|
-
* @param parentType - Optional parent type to prefix the name
|
|
76
|
-
* @returns Formatted MDX string for the name entity
|
|
77
|
-
*/
|
|
78
|
-
const formatMDXNameEntity = (name, parentType) => {
|
|
79
|
-
const parentName = parentType ? `${parentType}.` : "";
|
|
80
|
-
return `<code style={{ fontWeight: 'normal' }}>${(0, utils_1.escapeMDX)(parentName)}<b>${(0, utils_1.escapeMDX)(name)}</b></code>`;
|
|
81
|
-
};
|
|
82
|
-
exports.formatMDXNameEntity = formatMDXNameEntity;
|
|
83
|
-
/**
|
|
84
|
-
* Formats a link in MDX format
|
|
85
|
-
* @param param - The link configuration object
|
|
86
|
-
* @returns Formatted MDX link object
|
|
87
|
-
*/
|
|
88
|
-
const formatMDXLink = ({ text, url }) => {
|
|
89
|
-
return {
|
|
90
|
-
text,
|
|
91
|
-
url: `${url}${LINK_MDX_EXTENSION}`,
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
exports.formatMDXLink = formatMDXLink;
|
|
95
|
-
/**
|
|
96
|
-
* Default frontmatter formatter for MDX.
|
|
97
|
-
*
|
|
98
|
-
* @param _props - The front matter options (unused)
|
|
99
|
-
* @param formatted - The formatted front matter as an array of strings
|
|
100
|
-
* @returns Formatted MDX string for the front matter
|
|
101
|
-
*/
|
|
102
|
-
const formatMDXFrontmatter = (_props, formatted) => {
|
|
103
|
-
return formatted
|
|
104
|
-
? [utils_1.FRONT_MATTER_DELIMITER, ...formatted, utils_1.FRONT_MATTER_DELIMITER].join(utils_1.MARKDOWN_EOL)
|
|
105
|
-
: "";
|
|
106
|
-
};
|
|
107
|
-
exports.formatMDXFrontmatter = formatMDXFrontmatter;
|
|
108
|
-
/**
|
|
109
|
-
* Creates an MDX formatter for Docusaurus documentation.
|
|
110
|
-
*
|
|
111
|
-
* The MDX formatter produces React component-based markup compatible
|
|
112
|
-
* with Docusaurus MDX rendering. It uses components like `<Badge>`,
|
|
113
|
-
* `<Bullet>`, `<Details>`, and `<SpecifiedBy>`.
|
|
114
|
-
*
|
|
115
|
-
* @param meta - Optional metadata for framework-specific formatting
|
|
116
|
-
* @returns A complete Formatter implementation for MDX output
|
|
117
|
-
*
|
|
118
|
-
* @example
|
|
119
|
-
* ```typescript
|
|
120
|
-
* import { createMDXFormatter } from '@graphql-markdown/docusaurus';
|
|
121
|
-
*
|
|
122
|
-
* const formatter = createMDXFormatter({ generatorFrameworkName: 'docusaurus' });
|
|
123
|
-
* const badge = formatter.formatMDXBadge({ text: 'Required' });
|
|
124
|
-
* // '<Badge class="badge badge--secondary " text="Required"/>'
|
|
125
|
-
* ```
|
|
126
|
-
*/
|
|
127
|
-
const createMDXFormatter = (meta) => ({
|
|
128
|
-
formatMDXBadge: exports.formatMDXBadge,
|
|
129
|
-
formatMDXAdmonition: (admonition, _meta) => (0, exports.formatMDXAdmonition)(admonition, meta ?? _meta),
|
|
130
|
-
formatMDXBullet: exports.formatMDXBullet,
|
|
131
|
-
formatMDXDetails: exports.formatMDXDetails,
|
|
132
|
-
formatMDXFrontmatter: exports.formatMDXFrontmatter,
|
|
133
|
-
formatMDXLink: exports.formatMDXLink,
|
|
134
|
-
formatMDXNameEntity: exports.formatMDXNameEntity,
|
|
135
|
-
formatMDXSpecifiedByLink: exports.formatMDXSpecifiedByLink,
|
|
136
|
-
});
|
|
137
|
-
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",
|
|
@@ -60,18 +60,30 @@
|
|
|
60
60
|
"scripts": {
|
|
61
61
|
"stryker": "stryker run",
|
|
62
62
|
"clean": "tsgo --build --clean && rm -rf ./dist",
|
|
63
|
-
"docs": "typedoc",
|
|
64
|
-
"build": "tsgo --build"
|
|
63
|
+
"docs": "typedoc --options typedoc.config.mjs",
|
|
64
|
+
"build": "tsgo --build",
|
|
65
|
+
"lint": "eslint --config ../../packages/tooling-config/eslint/config.ts \"{src,tests}/**/*.{ts,js,json,gql}\"",
|
|
66
|
+
"lint:fix": "eslint --config ../../packages/tooling-config/eslint/config.ts \"{src,tests}/**/*.{ts,js,json,gql}\" --fix",
|
|
67
|
+
"prettier": "prettier \"{src,tests,assets}/**/*.{ts,js,json,md,gql}\" --check",
|
|
68
|
+
"prettier:fix": "prettier \"{src,tests,assets}/**/*.{ts,js,json,md,gql}\" --write",
|
|
69
|
+
"ts:check": "tsgo --noEmit",
|
|
70
|
+
"test": "jest",
|
|
71
|
+
"test:unit": "jest --passWithNoTests --testPathPatterns=tests/unit",
|
|
72
|
+
"test:integration": "jest --passWithNoTests --testPathPatterns=tests/integration",
|
|
73
|
+
"test:ci": "jest --passWithNoTests --ci --silent --randomize --runInBand",
|
|
74
|
+
"test:watch": "jest --watch"
|
|
65
75
|
},
|
|
66
76
|
"dependencies": {
|
|
67
|
-
"@graphql-markdown/cli": "^0.
|
|
68
|
-
"@graphql-markdown/
|
|
69
|
-
"@graphql-markdown/
|
|
70
|
-
"@
|
|
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"
|
|
71
83
|
},
|
|
72
84
|
"devDependencies": {
|
|
73
|
-
"@docusaurus/types": "
|
|
74
|
-
"@graphql-markdown/
|
|
85
|
+
"@docusaurus/types": "3.10.1",
|
|
86
|
+
"@graphql-markdown/tooling-config": "^1.0.0"
|
|
75
87
|
},
|
|
76
88
|
"peerDependencies": {
|
|
77
89
|
"@docusaurus/logger": "*"
|