@graphql-markdown/formatters 1.0.1 → 1.0.2
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/fumadocs/index.d.ts +4 -3
- package/dist/fumadocs/index.d.ts.map +1 -1
- package/dist/fumadocs/index.js +5 -8
- package/dist/starlight/index.d.ts +0 -22
- package/dist/starlight/index.d.ts.map +1 -1
- package/dist/starlight/index.js +1 -34
- package/dist/vocs/index.d.ts +3 -4
- package/dist/vocs/index.d.ts.map +1 -1
- package/dist/vocs/index.js +5 -8
- package/package.json +192 -192
- package/dist/docfx.d.ts +0 -20
- package/dist/docfx.d.ts.map +0 -1
- package/dist/docfx.js +0 -71
- package/dist/docusaurus.d.ts +0 -20
- package/dist/docusaurus.d.ts.map +0 -1
- package/dist/docusaurus.js +0 -72
- package/dist/hugo.d.ts +0 -20
- package/dist/hugo.d.ts.map +0 -1
- package/dist/hugo.js +0 -68
- package/dist/mdbook.d.ts +0 -20
- package/dist/mdbook.d.ts.map +0 -1
- package/dist/mdbook.js +0 -51
- package/dist/mkdocs.d.ts +0 -19
- package/dist/mkdocs.d.ts.map +0 -1
- package/dist/mkdocs.js +0 -65
package/dist/fumadocs/index.d.ts
CHANGED
|
@@ -27,11 +27,12 @@ export declare const formatMDXBadge: ({ text, classname }: Badge) => MDXString;
|
|
|
27
27
|
*/
|
|
28
28
|
export declare const formatMDXAdmonition: ({ text, title, type }: AdmonitionType, _meta: Maybe<MetaInfo>) => MDXString;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Returns the link unchanged — Fumadocs routes `page.mdx` to `page` so
|
|
31
|
+
* links must not include the `.mdx` extension.
|
|
31
32
|
* @param link - Link data with URL and text
|
|
32
|
-
* @returns
|
|
33
|
+
* @returns Unmodified link
|
|
33
34
|
*/
|
|
34
|
-
export declare const formatMDXLink: (
|
|
35
|
+
export declare const formatMDXLink: (link: TypeLink) => TypeLink;
|
|
35
36
|
export { formatMDXBullet, formatMDXDetails, formatMDXFrontmatter, formatMDXNameEntity, formatMDXSpecifiedByLink, } from "../defaults";
|
|
36
37
|
/**
|
|
37
38
|
* Creates a Fumadocs formatter.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fumadocs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,SAAS,EACT,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fumadocs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,SAAS,EACT,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAUjC,+CAA+C;AAC/C,eAAO,MAAM,YAAY,EAAG,MAAe,CAAC;AAE5C,sGAAsG;AACtG,eAAO,MAAM,cAAc,EAAE,SAGf,CAAC;AAEf;;;;;GAKG;AACH,eAAO,MAAM,cAAc,wBAAyB,KAAK,KAAG,SAG3D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAGF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,SAAU,QAAQ,KAAG,QAE9C,CAAC;AAEF,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAW5D,CAAC"}
|
package/dist/fumadocs/index.js
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
11
|
exports.createMDXFormatter = exports.formatMDXSpecifiedByLink = exports.formatMDXNameEntity = exports.formatMDXFrontmatter = exports.formatMDXDetails = exports.formatMDXBullet = exports.formatMDXLink = exports.formatMDXAdmonition = exports.formatMDXBadge = exports.mdxDeclaration = exports.mdxExtension = void 0;
|
|
12
|
-
const helpers_1 = require("@graphql-markdown/helpers");
|
|
13
12
|
const utils_1 = require("@graphql-markdown/utils");
|
|
14
13
|
const defaults_1 = require("../defaults");
|
|
15
14
|
/** File extension used for generated pages. */
|
|
@@ -43,15 +42,13 @@ const formatMDXAdmonition = ({ text, title, type }, _meta) => {
|
|
|
43
42
|
};
|
|
44
43
|
exports.formatMDXAdmonition = formatMDXAdmonition;
|
|
45
44
|
/**
|
|
46
|
-
*
|
|
45
|
+
* Returns the link unchanged — Fumadocs routes `page.mdx` to `page` so
|
|
46
|
+
* links must not include the `.mdx` extension.
|
|
47
47
|
* @param link - Link data with URL and text
|
|
48
|
-
* @returns
|
|
48
|
+
* @returns Unmodified link
|
|
49
49
|
*/
|
|
50
|
-
const formatMDXLink = (
|
|
51
|
-
return
|
|
52
|
-
text,
|
|
53
|
-
url: (0, helpers_1.appendLinkExtension)(url, exports.mdxExtension),
|
|
54
|
-
};
|
|
50
|
+
const formatMDXLink = (link) => {
|
|
51
|
+
return link;
|
|
55
52
|
};
|
|
56
53
|
exports.formatMDXLink = formatMDXLink;
|
|
57
54
|
var defaults_2 = require("../defaults");
|
|
@@ -35,28 +35,6 @@ export declare const formatMDXAdmonition: ({ text, title, type }: AdmonitionType
|
|
|
35
35
|
*/
|
|
36
36
|
export declare const formatMDXLink: (link: TypeLink) => TypeLink;
|
|
37
37
|
export { formatMDXBullet, formatMDXDetails, formatMDXFrontmatter, formatMDXNameEntity, formatMDXSpecifiedByLink, } from "../defaults";
|
|
38
|
-
/**
|
|
39
|
-
* Lifecycle hook that creates an `index.md` file for a category directory
|
|
40
|
-
* before Starlight indexes it. Skips creation if the file already exists.
|
|
41
|
-
* @param event - Hook payload containing the target directory and category name
|
|
42
|
-
*/
|
|
43
|
-
export declare const beforeGenerateIndexMetafileHook: (event: {
|
|
44
|
-
data: {
|
|
45
|
-
dirPath: string;
|
|
46
|
-
category: string;
|
|
47
|
-
};
|
|
48
|
-
}) => Promise<void>;
|
|
49
|
-
/**
|
|
50
|
-
* Lifecycle hook that appends a link entry to the category `index.md`
|
|
51
|
-
* after each type entity page is rendered.
|
|
52
|
-
* @param event - Hook payload containing the entity name and its output file path
|
|
53
|
-
*/
|
|
54
|
-
export declare const afterRenderTypeEntitiesHook: (event: {
|
|
55
|
-
data: {
|
|
56
|
-
name: string;
|
|
57
|
-
filePath: string;
|
|
58
|
-
};
|
|
59
|
-
}) => Promise<void>;
|
|
60
38
|
/**
|
|
61
39
|
* Creates an Astro Starlight formatter.
|
|
62
40
|
* @param _meta - Unused metadata parameter
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/starlight/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/starlight/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,SAAS,EACT,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAUjC,+CAA+C;AAC/C,eAAO,MAAM,YAAY,EAAG,MAAe,CAAC;AAE5C,+FAA+F;AAC/F,eAAO,MAAM,cAAc,EAAE,SAEf,CAAC;AAEf;;;;;GAKG;AACH,eAAO,MAAM,cAAc,wBAAyB,KAAK,KAAG,SAG3D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAGF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,SAAU,QAAQ,KAAG,QAE9C,CAAC;AAEF,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAW5D,CAAC"}
|
package/dist/starlight/index.js
CHANGED
|
@@ -9,9 +9,7 @@
|
|
|
9
9
|
* @packageDocumentation
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.createMDXFormatter = exports.
|
|
13
|
-
const node_path_1 = require("node:path");
|
|
14
|
-
const promises_1 = require("node:fs/promises");
|
|
12
|
+
exports.createMDXFormatter = exports.formatMDXSpecifiedByLink = exports.formatMDXNameEntity = exports.formatMDXFrontmatter = exports.formatMDXDetails = exports.formatMDXBullet = exports.formatMDXLink = exports.formatMDXAdmonition = exports.formatMDXBadge = exports.mdxDeclaration = exports.mdxExtension = void 0;
|
|
15
13
|
const utils_1 = require("@graphql-markdown/utils");
|
|
16
14
|
const defaults_1 = require("../defaults");
|
|
17
15
|
/** File extension used for generated pages. */
|
|
@@ -59,37 +57,6 @@ Object.defineProperty(exports, "formatMDXDetails", { enumerable: true, get: func
|
|
|
59
57
|
Object.defineProperty(exports, "formatMDXFrontmatter", { enumerable: true, get: function () { return defaults_2.formatMDXFrontmatter; } });
|
|
60
58
|
Object.defineProperty(exports, "formatMDXNameEntity", { enumerable: true, get: function () { return defaults_2.formatMDXNameEntity; } });
|
|
61
59
|
Object.defineProperty(exports, "formatMDXSpecifiedByLink", { enumerable: true, get: function () { return defaults_2.formatMDXSpecifiedByLink; } });
|
|
62
|
-
const INDEX_MD = "index.md";
|
|
63
|
-
/**
|
|
64
|
-
* Lifecycle hook that creates an `index.md` file for a category directory
|
|
65
|
-
* before Starlight indexes it. Skips creation if the file already exists.
|
|
66
|
-
* @param event - Hook payload containing the target directory and category name
|
|
67
|
-
*/
|
|
68
|
-
const beforeGenerateIndexMetafileHook = async (event) => {
|
|
69
|
-
const { dirPath, category } = event.data;
|
|
70
|
-
const filePath = (0, node_path_1.join)(dirPath, INDEX_MD);
|
|
71
|
-
if (await (0, utils_1.fileExists)(filePath)) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
const label = (0, utils_1.startCase)(category);
|
|
75
|
-
await (0, utils_1.ensureDir)(dirPath);
|
|
76
|
-
await (0, utils_1.saveFile)(filePath, `---\ntitle: ${label}\n---\n`);
|
|
77
|
-
};
|
|
78
|
-
exports.beforeGenerateIndexMetafileHook = beforeGenerateIndexMetafileHook;
|
|
79
|
-
/**
|
|
80
|
-
* Lifecycle hook that appends a link entry to the category `index.md`
|
|
81
|
-
* after each type entity page is rendered.
|
|
82
|
-
* @param event - Hook payload containing the entity name and its output file path
|
|
83
|
-
*/
|
|
84
|
-
const afterRenderTypeEntitiesHook = async (event) => {
|
|
85
|
-
const { name, filePath } = event.data;
|
|
86
|
-
const indexFilePath = (0, node_path_1.resolve)((0, node_path_1.dirname)(filePath), INDEX_MD);
|
|
87
|
-
const pageFileName = (0, node_path_1.basename)(filePath);
|
|
88
|
-
if (await (0, utils_1.fileExists)(indexFilePath)) {
|
|
89
|
-
await (0, promises_1.appendFile)(indexFilePath, `- [${name}](./${pageFileName})\n`);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
exports.afterRenderTypeEntitiesHook = afterRenderTypeEntitiesHook;
|
|
93
60
|
/**
|
|
94
61
|
* Creates an Astro Starlight formatter.
|
|
95
62
|
* @param _meta - Unused metadata parameter
|
package/dist/vocs/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Vocs formatter for GraphQL documentation output.
|
|
3
3
|
*
|
|
4
4
|
* Produces MDX compatible with Vite/Vocs using its native callout syntax
|
|
5
|
-
* and Material UI Chip components for badges.
|
|
6
5
|
*
|
|
7
6
|
* @packageDocumentation
|
|
8
7
|
*/
|
|
@@ -12,10 +11,10 @@ export declare const mdxDeclaration: MDXString;
|
|
|
12
11
|
/** File extension used for generated pages. */
|
|
13
12
|
export declare const mdxExtension: ".mdx";
|
|
14
13
|
/**
|
|
15
|
-
* Formats a badge using
|
|
16
|
-
* Maps `DEPRECATED` classname to `warning` color; all others use
|
|
14
|
+
* Formats a badge using Vocs native text directive (`:badge[...]`).
|
|
15
|
+
* Maps `DEPRECATED` classname to `warning` color; all others use default.
|
|
17
16
|
* @param badge - Badge data containing text and optional classname
|
|
18
|
-
* @returns Formatted
|
|
17
|
+
* @returns Formatted Vocs badge string
|
|
19
18
|
*/
|
|
20
19
|
export declare const formatMDXBadge: ({ text, classname }: Badge) => MDXString;
|
|
21
20
|
/**
|
package/dist/vocs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vocs/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vocs/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,SAAS,EACT,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AASjC,+FAA+F;AAC/F,eAAO,MAAM,cAAc,EAAE,SAEf,CAAC;AAEf,+CAA+C;AAC/C,eAAO,MAAM,YAAY,EAAG,MAAe,CAAC;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,cAAc,wBAAyB,KAAK,KAAG,SAG3D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAGF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,qBAAgB,SAE3C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,kBAAmB,QAAQ,KAAG,QAKvD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,SACxB,MAAM,eACC,KAAK,CAAC,MAAM,CAAC,KACzB,SAKF,CAAC;AAEF,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAW5D,CAAC"}
|
package/dist/vocs/index.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Vocs formatter for GraphQL documentation output.
|
|
4
4
|
*
|
|
5
5
|
* Produces MDX compatible with Vite/Vocs using its native callout syntax
|
|
6
|
-
* and Material UI Chip components for badges.
|
|
7
6
|
*
|
|
8
7
|
* @packageDocumentation
|
|
9
8
|
*/
|
|
@@ -14,21 +13,19 @@ const utils_1 = require("@graphql-markdown/utils");
|
|
|
14
13
|
const defaults_1 = require("../defaults");
|
|
15
14
|
/** MDX import statement and inline component definitions prepended to every generated file. */
|
|
16
15
|
exports.mdxDeclaration = `
|
|
17
|
-
import Chip from '@mui/material/Chip';
|
|
18
|
-
|
|
19
16
|
export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em' }}> ● </span></>
|
|
20
17
|
`;
|
|
21
18
|
/** File extension used for generated pages. */
|
|
22
19
|
exports.mdxExtension = ".mdx";
|
|
23
20
|
/**
|
|
24
|
-
* Formats a badge using
|
|
25
|
-
* Maps `DEPRECATED` classname to `warning` color; all others use
|
|
21
|
+
* Formats a badge using Vocs native text directive (`:badge[...]`).
|
|
22
|
+
* Maps `DEPRECATED` classname to `warning` color; all others use default.
|
|
26
23
|
* @param badge - Badge data containing text and optional classname
|
|
27
|
-
* @returns Formatted
|
|
24
|
+
* @returns Formatted Vocs badge string
|
|
28
25
|
*/
|
|
29
26
|
const formatMDXBadge = ({ text, classname }) => {
|
|
30
|
-
const
|
|
31
|
-
return
|
|
27
|
+
const badgeType = classname === "DEPRECATED" ? "{warning}" : "";
|
|
28
|
+
return `:badge[${text}]${badgeType}`;
|
|
32
29
|
};
|
|
33
30
|
exports.formatMDXBadge = formatMDXBadge;
|
|
34
31
|
/**
|
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.0.
|
|
8
|
+
"version": "1.0.2",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -35,197 +35,197 @@
|
|
|
35
35
|
"exports": {
|
|
36
36
|
".": {
|
|
37
37
|
"require": {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
"types": "./dist/index.d.ts",
|
|
39
|
+
"default": "./dist/index.js"
|
|
40
|
+
},
|
|
41
|
+
"import": {
|
|
42
|
+
"types": "./dist/index.d.ts",
|
|
43
|
+
"default": "./dist/index.js"
|
|
44
|
+
},
|
|
45
|
+
"default": {
|
|
46
|
+
"types": "./dist/index.d.ts",
|
|
47
|
+
"default": "./dist/index.js"
|
|
48
|
+
}
|
|
40
49
|
},
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
50
|
+
"./docusaurus": {
|
|
51
|
+
"require": {
|
|
52
|
+
"types": "./dist/docusaurus/index.d.ts",
|
|
53
|
+
"default": "./dist/docusaurus/index.js"
|
|
54
|
+
},
|
|
55
|
+
"import": {
|
|
56
|
+
"types": "./dist/docusaurus/index.d.ts",
|
|
57
|
+
"default": "./dist/docusaurus/index.js"
|
|
58
|
+
},
|
|
59
|
+
"default": {
|
|
60
|
+
"types": "./dist/docusaurus/index.d.ts",
|
|
61
|
+
"default": "./dist/docusaurus/index.js"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"./docfx": {
|
|
65
|
+
"require": {
|
|
66
|
+
"types": "./dist/docfx/index.d.ts",
|
|
67
|
+
"default": "./dist/docfx/index.js"
|
|
68
|
+
},
|
|
69
|
+
"import": {
|
|
70
|
+
"types": "./dist/docfx/index.d.ts",
|
|
71
|
+
"default": "./dist/docfx/index.js"
|
|
72
|
+
},
|
|
73
|
+
"default": {
|
|
74
|
+
"types": "./dist/docfx/index.d.ts",
|
|
75
|
+
"default": "./dist/docfx/index.js"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"./fumadocs": {
|
|
79
|
+
"require": {
|
|
80
|
+
"types": "./dist/fumadocs/index.d.ts",
|
|
81
|
+
"default": "./dist/fumadocs/index.js"
|
|
82
|
+
},
|
|
83
|
+
"import": {
|
|
84
|
+
"types": "./dist/fumadocs/index.d.ts",
|
|
85
|
+
"default": "./dist/fumadocs/index.js"
|
|
86
|
+
},
|
|
87
|
+
"default": {
|
|
88
|
+
"types": "./dist/fumadocs/index.d.ts",
|
|
89
|
+
"default": "./dist/fumadocs/index.js"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"./honkit": {
|
|
93
|
+
"require": {
|
|
94
|
+
"types": "./dist/honkit/index.d.ts",
|
|
95
|
+
"default": "./dist/honkit/index.js"
|
|
96
|
+
},
|
|
97
|
+
"import": {
|
|
98
|
+
"types": "./dist/honkit/index.d.ts",
|
|
99
|
+
"default": "./dist/honkit/index.js"
|
|
100
|
+
},
|
|
101
|
+
"default": {
|
|
102
|
+
"types": "./dist/honkit/index.d.ts",
|
|
103
|
+
"default": "./dist/honkit/index.js"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"./hugo": {
|
|
107
|
+
"require": {
|
|
108
|
+
"types": "./dist/hugo/index.d.ts",
|
|
109
|
+
"default": "./dist/hugo/index.js"
|
|
110
|
+
},
|
|
111
|
+
"import": {
|
|
112
|
+
"types": "./dist/hugo/index.d.ts",
|
|
113
|
+
"default": "./dist/hugo/index.js"
|
|
114
|
+
},
|
|
115
|
+
"default": {
|
|
116
|
+
"types": "./dist/hugo/index.d.ts",
|
|
117
|
+
"default": "./dist/hugo/index.js"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"./mdbook": {
|
|
121
|
+
"require": {
|
|
122
|
+
"types": "./dist/mdbook/index.d.ts",
|
|
123
|
+
"default": "./dist/mdbook/index.js"
|
|
124
|
+
},
|
|
125
|
+
"import": {
|
|
126
|
+
"types": "./dist/mdbook/index.d.ts",
|
|
127
|
+
"default": "./dist/mdbook/index.js"
|
|
128
|
+
},
|
|
129
|
+
"default": {
|
|
130
|
+
"types": "./dist/mdbook/index.d.ts",
|
|
131
|
+
"default": "./dist/mdbook/index.js"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"./mkdocs": {
|
|
135
|
+
"require": {
|
|
136
|
+
"types": "./dist/mkdocs/index.d.ts",
|
|
137
|
+
"default": "./dist/mkdocs/index.js"
|
|
138
|
+
},
|
|
139
|
+
"import": {
|
|
140
|
+
"types": "./dist/mkdocs/index.d.ts",
|
|
141
|
+
"default": "./dist/mkdocs/index.js"
|
|
142
|
+
},
|
|
143
|
+
"default": {
|
|
144
|
+
"types": "./dist/mkdocs/index.d.ts",
|
|
145
|
+
"default": "./dist/mkdocs/index.js"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"./starlight": {
|
|
149
|
+
"require": {
|
|
150
|
+
"types": "./dist/starlight/index.d.ts",
|
|
151
|
+
"default": "./dist/starlight/index.js"
|
|
152
|
+
},
|
|
153
|
+
"import": {
|
|
154
|
+
"types": "./dist/starlight/index.d.ts",
|
|
155
|
+
"default": "./dist/starlight/index.js"
|
|
156
|
+
},
|
|
157
|
+
"default": {
|
|
158
|
+
"types": "./dist/starlight/index.d.ts",
|
|
159
|
+
"default": "./dist/starlight/index.js"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"./vocs": {
|
|
163
|
+
"require": {
|
|
164
|
+
"types": "./dist/vocs/index.d.ts",
|
|
165
|
+
"default": "./dist/vocs/index.js"
|
|
166
|
+
},
|
|
167
|
+
"import": {
|
|
168
|
+
"types": "./dist/vocs/index.d.ts",
|
|
169
|
+
"default": "./dist/vocs/index.js"
|
|
170
|
+
},
|
|
171
|
+
"default": {
|
|
172
|
+
"types": "./dist/vocs/index.d.ts",
|
|
173
|
+
"default": "./dist/vocs/index.js"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"./defaults": {
|
|
177
|
+
"require": {
|
|
178
|
+
"types": "./dist/defaults.d.ts",
|
|
179
|
+
"default": "./dist/defaults.js"
|
|
180
|
+
},
|
|
181
|
+
"import": {
|
|
182
|
+
"types": "./dist/defaults.d.ts",
|
|
183
|
+
"default": "./dist/defaults.js"
|
|
184
|
+
},
|
|
185
|
+
"default": {
|
|
186
|
+
"types": "./dist/defaults.d.ts",
|
|
187
|
+
"default": "./dist/defaults.js"
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"./package.json": "./package.json"
|
|
44
191
|
},
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"types": "./dist/fumadocs/index.d.ts",
|
|
85
|
-
"default": "./dist/fumadocs/index.js"
|
|
86
|
-
},
|
|
87
|
-
"default": {
|
|
88
|
-
"types": "./dist/fumadocs/index.d.ts",
|
|
89
|
-
"default": "./dist/fumadocs/index.js"
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
"./honkit": {
|
|
93
|
-
"require": {
|
|
94
|
-
"types": "./dist/honkit/index.d.ts",
|
|
95
|
-
"default": "./dist/honkit/index.js"
|
|
96
|
-
},
|
|
97
|
-
"import": {
|
|
98
|
-
"types": "./dist/honkit/index.d.ts",
|
|
99
|
-
"default": "./dist/honkit/index.js"
|
|
100
|
-
},
|
|
101
|
-
"default": {
|
|
102
|
-
"types": "./dist/honkit/index.d.ts",
|
|
103
|
-
"default": "./dist/honkit/index.js"
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
"./hugo": {
|
|
107
|
-
"require": {
|
|
108
|
-
"types": "./dist/hugo/index.d.ts",
|
|
109
|
-
"default": "./dist/hugo/index.js"
|
|
110
|
-
},
|
|
111
|
-
"import": {
|
|
112
|
-
"types": "./dist/hugo/index.d.ts",
|
|
113
|
-
"default": "./dist/hugo/index.js"
|
|
114
|
-
},
|
|
115
|
-
"default": {
|
|
116
|
-
"types": "./dist/hugo/index.d.ts",
|
|
117
|
-
"default": "./dist/hugo/index.js"
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
"./mdbook": {
|
|
121
|
-
"require": {
|
|
122
|
-
"types": "./dist/mdbook/index.d.ts",
|
|
123
|
-
"default": "./dist/mdbook/index.js"
|
|
124
|
-
},
|
|
125
|
-
"import": {
|
|
126
|
-
"types": "./dist/mdbook/index.d.ts",
|
|
127
|
-
"default": "./dist/mdbook/index.js"
|
|
128
|
-
},
|
|
129
|
-
"default": {
|
|
130
|
-
"types": "./dist/mdbook/index.d.ts",
|
|
131
|
-
"default": "./dist/mdbook/index.js"
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
"./mkdocs": {
|
|
135
|
-
"require": {
|
|
136
|
-
"types": "./dist/mkdocs/index.d.ts",
|
|
137
|
-
"default": "./dist/mkdocs/index.js"
|
|
138
|
-
},
|
|
139
|
-
"import": {
|
|
140
|
-
"types": "./dist/mkdocs/index.d.ts",
|
|
141
|
-
"default": "./dist/mkdocs/index.js"
|
|
142
|
-
},
|
|
143
|
-
"default": {
|
|
144
|
-
"types": "./dist/mkdocs/index.d.ts",
|
|
145
|
-
"default": "./dist/mkdocs/index.js"
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
"./starlight": {
|
|
149
|
-
"require": {
|
|
150
|
-
"types": "./dist/starlight/index.d.ts",
|
|
151
|
-
"default": "./dist/starlight/index.js"
|
|
152
|
-
},
|
|
153
|
-
"import": {
|
|
154
|
-
"types": "./dist/starlight/index.d.ts",
|
|
155
|
-
"default": "./dist/starlight/index.js"
|
|
156
|
-
},
|
|
157
|
-
"default": {
|
|
158
|
-
"types": "./dist/starlight/index.d.ts",
|
|
159
|
-
"default": "./dist/starlight/index.js"
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
"./vocs": {
|
|
163
|
-
"require": {
|
|
164
|
-
"types": "./dist/vocs/index.d.ts",
|
|
165
|
-
"default": "./dist/vocs/index.js"
|
|
166
|
-
},
|
|
167
|
-
"import": {
|
|
168
|
-
"types": "./dist/vocs/index.d.ts",
|
|
169
|
-
"default": "./dist/vocs/index.js"
|
|
170
|
-
},
|
|
171
|
-
"default": {
|
|
172
|
-
"types": "./dist/vocs/index.d.ts",
|
|
173
|
-
"default": "./dist/vocs/index.js"
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
"./defaults": {
|
|
177
|
-
"require": {
|
|
178
|
-
"types": "./dist/defaults.d.ts",
|
|
179
|
-
"default": "./dist/defaults.js"
|
|
180
|
-
},
|
|
181
|
-
"import": {
|
|
182
|
-
"types": "./dist/defaults.d.ts",
|
|
183
|
-
"default": "./dist/defaults.js"
|
|
184
|
-
},
|
|
185
|
-
"default": {
|
|
186
|
-
"types": "./dist/defaults.d.ts",
|
|
187
|
-
"default": "./dist/defaults.js"
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
"./package.json": "./package.json"
|
|
191
|
-
},
|
|
192
|
-
"scripts": {
|
|
193
|
-
"stryker": "stryker run",
|
|
194
|
-
"clean": "tsgo --build --clean && rm -rf ./dist",
|
|
195
|
-
"docs": "typedoc --options typedoc.config.mjs",
|
|
196
|
-
"build": "tsgo --build",
|
|
197
|
-
"lint": "eslint --config ../../packages/tooling-config/eslint/config.ts \"{src,tests}/**/*.{ts,js,json,gql}\"",
|
|
198
|
-
"lint:fix": "eslint --config ../../packages/tooling-config/eslint/config.ts \"{src,tests}/**/*.{ts,js,json,gql}\" --fix",
|
|
199
|
-
"prettier": "prettier \"{src,tests}/**/*.{ts,js,json,md,gql}\" --check",
|
|
200
|
-
"prettier:fix": "prettier \"{src,tests}/**/*.{ts,js,json,md,gql}\" --write",
|
|
201
|
-
"ts:check": "tsgo --noEmit",
|
|
202
|
-
"test": "jest",
|
|
203
|
-
"test:unit": "jest --passWithNoTests --testPathPatterns=tests/unit",
|
|
204
|
-
"test:integration": "jest --passWithNoTests --testPathPatterns=tests/integration",
|
|
205
|
-
"test:ci": "jest --passWithNoTests --ci --silent --randomize --runInBand",
|
|
206
|
-
"test:watch": "jest --watch"
|
|
207
|
-
},
|
|
208
|
-
"dependencies": {
|
|
209
|
-
"@graphql-markdown/helpers": "",
|
|
210
|
-
"@graphql-markdown/types": "",
|
|
211
|
-
"@graphql-markdown/utils": ""
|
|
212
|
-
},
|
|
213
|
-
"devDependencies": {
|
|
214
|
-
"@graphql-markdown/tooling-config": ""
|
|
215
|
-
},
|
|
216
|
-
"directories": {
|
|
217
|
-
"test": "tests"
|
|
218
|
-
},
|
|
219
|
-
"engines": {
|
|
220
|
-
"node": ">=22.12.0"
|
|
221
|
-
},
|
|
222
|
-
"publishConfig": {
|
|
223
|
-
"access": "public"
|
|
224
|
-
},
|
|
225
|
-
"typescript": {
|
|
226
|
-
"definition": "dist/index.d.ts"
|
|
227
|
-
},
|
|
228
|
-
"files": [
|
|
229
|
-
"dist"
|
|
230
|
-
]
|
|
192
|
+
"scripts": {
|
|
193
|
+
"stryker": "stryker run",
|
|
194
|
+
"clean": "tsgo --build --clean && rm -rf ./dist",
|
|
195
|
+
"docs": "typedoc --options typedoc.config.mjs",
|
|
196
|
+
"build": "tsgo --build",
|
|
197
|
+
"lint": "eslint --config ../../packages/tooling-config/eslint/config.ts \"{src,tests}/**/*.{ts,js,json,gql}\"",
|
|
198
|
+
"lint:fix": "eslint --config ../../packages/tooling-config/eslint/config.ts \"{src,tests}/**/*.{ts,js,json,gql}\" --fix",
|
|
199
|
+
"prettier": "prettier \"{src,tests}/**/*.{ts,js,json,md,gql}\" --check",
|
|
200
|
+
"prettier:fix": "prettier \"{src,tests}/**/*.{ts,js,json,md,gql}\" --write",
|
|
201
|
+
"ts:check": "tsgo --noEmit",
|
|
202
|
+
"test": "vitest run --passWithNoTests",
|
|
203
|
+
"test:unit": "vitest run --passWithNoTests tests/unit",
|
|
204
|
+
"test:integration": "vitest run --passWithNoTests tests/integration",
|
|
205
|
+
"test:ci": "vitest run --passWithNoTests --silent --sequence.shuffle",
|
|
206
|
+
"test:watch": "vitest --watch"
|
|
207
|
+
},
|
|
208
|
+
"dependencies": {
|
|
209
|
+
"@graphql-markdown/helpers": "",
|
|
210
|
+
"@graphql-markdown/types": "",
|
|
211
|
+
"@graphql-markdown/utils": ""
|
|
212
|
+
},
|
|
213
|
+
"devDependencies": {
|
|
214
|
+
"@graphql-markdown/tooling-config": ""
|
|
215
|
+
},
|
|
216
|
+
"directories": {
|
|
217
|
+
"test": "tests"
|
|
218
|
+
},
|
|
219
|
+
"engines": {
|
|
220
|
+
"node": ">=22.12.0"
|
|
221
|
+
},
|
|
222
|
+
"publishConfig": {
|
|
223
|
+
"access": "public"
|
|
224
|
+
},
|
|
225
|
+
"typescript": {
|
|
226
|
+
"definition": "dist/index.d.ts"
|
|
227
|
+
},
|
|
228
|
+
"files": [
|
|
229
|
+
"dist"
|
|
230
|
+
]
|
|
231
231
|
}
|
package/dist/docfx.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DocFX formatter for GraphQL documentation output.
|
|
3
|
-
*
|
|
4
|
-
* Produces Markdown compatible with Microsoft DocFX.
|
|
5
|
-
* Uses DocFX alert syntax for admonitions and injects the required
|
|
6
|
-
* `uid` front matter field for cross-reference resolution.
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
*/
|
|
10
|
-
import type { AdmonitionType, Badge, CollapsibleOption, Formatter, FrontMatterOptions, Maybe, MDXString, MetaInfo, TypeLink } from "@graphql-markdown/types";
|
|
11
|
-
export declare const formatMDXBadge: ({ text }: Badge) => MDXString;
|
|
12
|
-
export declare const formatMDXAdmonition: ({ text, title, type }: AdmonitionType, _meta: Maybe<MetaInfo>) => MDXString;
|
|
13
|
-
export declare const formatMDXBullet: (text?: string) => MDXString;
|
|
14
|
-
export declare const formatMDXDetails: ({ dataOpen, dataClose, }: CollapsibleOption) => MDXString;
|
|
15
|
-
export declare const formatMDXFrontmatter: (props: Maybe<FrontMatterOptions>, formatted: Maybe<string[]>) => MDXString;
|
|
16
|
-
export declare const formatMDXLink: (link: TypeLink) => TypeLink;
|
|
17
|
-
export declare const formatMDXNameEntity: (name: string, parentType?: Maybe<string>) => MDXString;
|
|
18
|
-
export declare const formatMDXSpecifiedByLink: (url: string) => MDXString;
|
|
19
|
-
export declare const createMDXFormatter: (_meta?: Maybe<MetaInfo>) => Formatter;
|
|
20
|
-
//# sourceMappingURL=docfx.d.ts.map
|
package/dist/docfx.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"docfx.d.ts","sourceRoot":"","sources":["../src/docfx.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAyBjC,eAAO,MAAM,cAAc,aAAc,KAAK,KAAG,SACwB,CAAC;AAE1E,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAIF,CAAC;AAEF,eAAO,MAAM,eAAe,qBAAgB,SACR,CAAC;AAErC,eAAO,MAAM,gBAAgB,6BAG1B,iBAAiB,KAAG,SAC0L,CAAC;AAElN,eAAO,MAAM,oBAAoB,UACxB,KAAK,CAAC,kBAAkB,CAAC,aACrB,KAAK,CAAC,MAAM,EAAE,CAAC,KACzB,SAaF,CAAC;AAEF,eAAO,MAAM,aAAa,SAAU,QAAQ,KAAG,QAAgB,CAAC;AAEhE,eAAO,MAAM,mBAAmB,SACxB,MAAM,eACC,KAAK,CAAC,MAAM,CAAC,KACzB,SAGF,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAAS,MAAM,KAAG,SACb,CAAC;AAE3C,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAS3D,CAAC"}
|
package/dist/docfx.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* DocFX formatter for GraphQL documentation output.
|
|
4
|
-
*
|
|
5
|
-
* Produces Markdown compatible with Microsoft DocFX.
|
|
6
|
-
* Uses DocFX alert syntax for admonitions and injects the required
|
|
7
|
-
* `uid` front matter field for cross-reference resolution.
|
|
8
|
-
*
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.createMDXFormatter = exports.formatMDXSpecifiedByLink = exports.formatMDXNameEntity = exports.formatMDXLink = exports.formatMDXFrontmatter = exports.formatMDXDetails = exports.formatMDXBullet = exports.formatMDXAdmonition = exports.formatMDXBadge = void 0;
|
|
13
|
-
const utils_1 = require("@graphql-markdown/utils");
|
|
14
|
-
// Maps graphql-markdown admonition types to DocFX alert types
|
|
15
|
-
const ALERT_TYPE_MAP = {
|
|
16
|
-
note: "NOTE",
|
|
17
|
-
tip: "TIP",
|
|
18
|
-
info: "IMPORTANT",
|
|
19
|
-
warning: "WARNING",
|
|
20
|
-
danger: "CAUTION",
|
|
21
|
-
deprecated: "WARNING",
|
|
22
|
-
caution: "CAUTION",
|
|
23
|
-
success: "NOTE",
|
|
24
|
-
};
|
|
25
|
-
const quoteLines = (text) => text
|
|
26
|
-
.split(utils_1.MARKDOWN_EOL)
|
|
27
|
-
.map((line) => `> ${line}`)
|
|
28
|
-
.join(utils_1.MARKDOWN_EOL);
|
|
29
|
-
const formatMDXBadge = ({ text }) => `<mark class="gqlmd-docfx-badge">${text}</mark>`;
|
|
30
|
-
exports.formatMDXBadge = formatMDXBadge;
|
|
31
|
-
const formatMDXAdmonition = ({ text, title, type }, _meta) => {
|
|
32
|
-
const alertType = ALERT_TYPE_MAP[type.toLowerCase()] ?? "NOTE";
|
|
33
|
-
const titleLine = title ? `${utils_1.MARKDOWN_EOL}> **${title}**` : "";
|
|
34
|
-
return `${utils_1.MARKDOWN_EOP}> [!${alertType}]${titleLine}${utils_1.MARKDOWN_EOL}${quoteLines(text)}${utils_1.MARKDOWN_EOL}`;
|
|
35
|
-
};
|
|
36
|
-
exports.formatMDXAdmonition = formatMDXAdmonition;
|
|
37
|
-
const formatMDXBullet = (text = "") => `• ${text}`;
|
|
38
|
-
exports.formatMDXBullet = formatMDXBullet;
|
|
39
|
-
const formatMDXDetails = ({ dataOpen, dataClose, }) => `${utils_1.MARKDOWN_EOP}<details>${utils_1.MARKDOWN_EOL}<summary>${dataOpen}</summary>${utils_1.MARKDOWN_EOL}${utils_1.MARKDOWN_EOL}\r${utils_1.MARKDOWN_EOL}${utils_1.MARKDOWN_EOL}<em>${dataClose}</em>${utils_1.MARKDOWN_EOL}</details>${utils_1.MARKDOWN_EOP}`;
|
|
40
|
-
exports.formatMDXDetails = formatMDXDetails;
|
|
41
|
-
const formatMDXFrontmatter = (props, formatted) => {
|
|
42
|
-
if (!formatted)
|
|
43
|
-
return "";
|
|
44
|
-
// DocFX requires a uid field for cross-reference resolution between pages
|
|
45
|
-
const id = props && typeof props === "object" && "id" in props
|
|
46
|
-
? props.id
|
|
47
|
-
: undefined;
|
|
48
|
-
const uidLine = id ? [` uid: ${id}`] : [];
|
|
49
|
-
return [utils_1.FRONT_MATTER_DELIMITER, ...uidLine, ...formatted, utils_1.FRONT_MATTER_DELIMITER].join(utils_1.MARKDOWN_EOL);
|
|
50
|
-
};
|
|
51
|
-
exports.formatMDXFrontmatter = formatMDXFrontmatter;
|
|
52
|
-
const formatMDXLink = (link) => link;
|
|
53
|
-
exports.formatMDXLink = formatMDXLink;
|
|
54
|
-
const formatMDXNameEntity = (name, parentType) => {
|
|
55
|
-
const parentName = parentType ? `${parentType}.` : "";
|
|
56
|
-
return `\`${parentName}${name}\``;
|
|
57
|
-
};
|
|
58
|
-
exports.formatMDXNameEntity = formatMDXNameEntity;
|
|
59
|
-
const formatMDXSpecifiedByLink = (url) => `[Specification ⎘](${url})`;
|
|
60
|
-
exports.formatMDXSpecifiedByLink = formatMDXSpecifiedByLink;
|
|
61
|
-
const createMDXFormatter = (_meta) => ({
|
|
62
|
-
formatMDXBadge: exports.formatMDXBadge,
|
|
63
|
-
formatMDXAdmonition: exports.formatMDXAdmonition,
|
|
64
|
-
formatMDXBullet: exports.formatMDXBullet,
|
|
65
|
-
formatMDXDetails: exports.formatMDXDetails,
|
|
66
|
-
formatMDXFrontmatter: exports.formatMDXFrontmatter,
|
|
67
|
-
formatMDXLink: exports.formatMDXLink,
|
|
68
|
-
formatMDXNameEntity: exports.formatMDXNameEntity,
|
|
69
|
-
formatMDXSpecifiedByLink: exports.formatMDXSpecifiedByLink,
|
|
70
|
-
});
|
|
71
|
-
exports.createMDXFormatter = createMDXFormatter;
|
package/dist/docusaurus.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Docusaurus MDX formatter for GraphQL documentation output.
|
|
3
|
-
*
|
|
4
|
-
* Produces MDX markup compatible with Docusaurus v2 and v3,
|
|
5
|
-
* using Badge, Bullet, SpecifiedBy components and native admonition syntax.
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
import type { AdmonitionType, Badge, CollapsibleOption, Formatter, FrontMatterOptions, Maybe, MDXString, MetaInfo, TypeLink } from "@graphql-markdown/types";
|
|
10
|
-
export declare const mdxDeclaration: MDXString;
|
|
11
|
-
export declare const formatMDXBadge: ({ text, classname }: Badge) => MDXString;
|
|
12
|
-
export declare const formatMDXAdmonition: ({ text, title, type }: AdmonitionType, meta: Maybe<MetaInfo>) => MDXString;
|
|
13
|
-
export declare const formatMDXBullet: (text?: string) => MDXString;
|
|
14
|
-
export declare const formatMDXDetails: ({ dataOpen, dataClose, }: CollapsibleOption) => MDXString;
|
|
15
|
-
export declare const formatMDXSpecifiedByLink: (url: string) => MDXString;
|
|
16
|
-
export declare const formatMDXNameEntity: (name: string, parentType?: Maybe<string>) => MDXString;
|
|
17
|
-
export declare const formatMDXLink: ({ text, url }: TypeLink) => TypeLink;
|
|
18
|
-
export declare const formatMDXFrontmatter: (_props: Maybe<FrontMatterOptions>, formatted: Maybe<string[]>) => MDXString;
|
|
19
|
-
export declare const createMDXFormatter: (meta?: Maybe<MetaInfo>) => Formatter;
|
|
20
|
-
//# sourceMappingURL=docusaurus.d.ts.map
|
package/dist/docusaurus.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"docusaurus.d.ts","sourceRoot":"","sources":["../src/docusaurus.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAWjC,eAAO,MAAM,cAAc,EAAE,SAQf,CAAC;AAEf,eAAO,MAAM,cAAc,wBAAyB,KAAK,KAAG,SAI3D,CAAC;AAEF,eAAO,MAAM,mBAAmB,0BACP,cAAc,QAC/B,KAAK,CAAC,QAAQ,CAAC,KACpB,SAOF,CAAC;AAEF,eAAO,MAAM,eAAe,UAAU,MAAM,KAAQ,SAClB,CAAC;AAEnC,eAAO,MAAM,gBAAgB,6BAG1B,iBAAiB,KAAG,SAItB,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAAS,MAAM,KAAG,SACX,CAAC;AAE7C,eAAO,MAAM,mBAAmB,SACxB,MAAM,eACC,KAAK,CAAC,MAAM,CAAC,KACzB,SAGF,CAAC;AAEF,eAAO,MAAM,aAAa,kBAAmB,QAAQ,KAAG,QAGtD,CAAC;AAEH,eAAO,MAAM,oBAAoB,WACvB,KAAK,CAAC,kBAAkB,CAAC,aACtB,KAAK,CAAC,MAAM,EAAE,CAAC,KACzB,SAKoB,CAAC;AAExB,eAAO,MAAM,kBAAkB,UAAW,KAAK,CAAC,QAAQ,CAAC,KAAG,SAY1D,CAAC"}
|
package/dist/docusaurus.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Docusaurus MDX formatter for GraphQL documentation output.
|
|
4
|
-
*
|
|
5
|
-
* Produces MDX markup compatible with Docusaurus v2 and v3,
|
|
6
|
-
* using Badge, Bullet, SpecifiedBy components and native admonition syntax.
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.createMDXFormatter = exports.formatMDXFrontmatter = exports.formatMDXLink = exports.formatMDXNameEntity = exports.formatMDXSpecifiedByLink = exports.formatMDXDetails = exports.formatMDXBullet = exports.formatMDXAdmonition = exports.formatMDXBadge = exports.mdxDeclaration = void 0;
|
|
12
|
-
const utils_1 = require("@graphql-markdown/utils");
|
|
13
|
-
const LINK_MDX_EXTENSION = ".mdx";
|
|
14
|
-
const DEFAULT_CSS_CLASSNAME = "badge--secondary";
|
|
15
|
-
exports.mdxDeclaration = `
|
|
16
|
-
export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em', color: 'var(--ifm-color-secondary-darkest)' }}> ● </span></>
|
|
17
|
-
|
|
18
|
-
export const SpecifiedBy = (props) => <>Specification<a className="link" style={{ fontSize:'1.5em', paddingLeft:'4px' }} target="_blank" href={props.url} title={'Specified by ' + props.url}>⎘</a></>
|
|
19
|
-
|
|
20
|
-
export const Badge = (props) => <><span className={props.class}>{props.text}</span></>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
`;
|
|
24
|
-
const formatMDXBadge = ({ text, classname }) => {
|
|
25
|
-
const style = typeof classname === "string" ? `badge--${classname.toLowerCase()}` : "";
|
|
26
|
-
return `<Badge class="badge ${DEFAULT_CSS_CLASSNAME} ${style}" text="${text}"/>`;
|
|
27
|
-
};
|
|
28
|
-
exports.formatMDXBadge = formatMDXBadge;
|
|
29
|
-
const formatMDXAdmonition = ({ text, title, type }, meta) => {
|
|
30
|
-
const isDocusaurus = meta?.generatorFrameworkName === "docusaurus";
|
|
31
|
-
if (isDocusaurus && meta.generatorFrameworkVersion?.startsWith("2")) {
|
|
32
|
-
const oldType = type === "warning" ? "caution" : type;
|
|
33
|
-
return `${utils_1.MARKDOWN_EOP}:::${oldType} ${title}${text}:::`;
|
|
34
|
-
}
|
|
35
|
-
return `${utils_1.MARKDOWN_EOP}:::${type}[${title}]${text}:::`;
|
|
36
|
-
};
|
|
37
|
-
exports.formatMDXAdmonition = formatMDXAdmonition;
|
|
38
|
-
const formatMDXBullet = (text = "") => `<Bullet />${text}`;
|
|
39
|
-
exports.formatMDXBullet = formatMDXBullet;
|
|
40
|
-
const formatMDXDetails = ({ dataOpen, dataClose, }) => {
|
|
41
|
-
const openLabel = (0, utils_1.escapeMDX)(`Hide ${dataOpen}`);
|
|
42
|
-
const closeLabel = (0, utils_1.escapeMDX)(`Show ${dataClose}`);
|
|
43
|
-
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" hidden>${openLabel}</span>${utils_1.MARKDOWN_EOL}</summary>${utils_1.MARKDOWN_EOP}\r${utils_1.MARKDOWN_EOP}</details>${utils_1.MARKDOWN_EOP}`;
|
|
44
|
-
};
|
|
45
|
-
exports.formatMDXDetails = formatMDXDetails;
|
|
46
|
-
const formatMDXSpecifiedByLink = (url) => `<SpecifiedBy url="${url}"/>`;
|
|
47
|
-
exports.formatMDXSpecifiedByLink = formatMDXSpecifiedByLink;
|
|
48
|
-
const formatMDXNameEntity = (name, parentType) => {
|
|
49
|
-
const parentName = parentType ? `${parentType}.` : "";
|
|
50
|
-
return `<code style={{ fontWeight: 'normal' }}>${(0, utils_1.escapeMDX)(parentName)}<b>${(0, utils_1.escapeMDX)(name)}</b></code>`;
|
|
51
|
-
};
|
|
52
|
-
exports.formatMDXNameEntity = formatMDXNameEntity;
|
|
53
|
-
const formatMDXLink = ({ text, url }) => ({
|
|
54
|
-
text,
|
|
55
|
-
url: `${url}${LINK_MDX_EXTENSION}`,
|
|
56
|
-
});
|
|
57
|
-
exports.formatMDXLink = formatMDXLink;
|
|
58
|
-
const formatMDXFrontmatter = (_props, formatted) => formatted
|
|
59
|
-
? [utils_1.FRONT_MATTER_DELIMITER, ...formatted, utils_1.FRONT_MATTER_DELIMITER].join(utils_1.MARKDOWN_EOL)
|
|
60
|
-
: "";
|
|
61
|
-
exports.formatMDXFrontmatter = formatMDXFrontmatter;
|
|
62
|
-
const createMDXFormatter = (meta) => ({
|
|
63
|
-
formatMDXBadge: exports.formatMDXBadge,
|
|
64
|
-
formatMDXAdmonition: (admonition, _meta) => (0, exports.formatMDXAdmonition)(admonition, meta ?? _meta),
|
|
65
|
-
formatMDXBullet: exports.formatMDXBullet,
|
|
66
|
-
formatMDXDetails: exports.formatMDXDetails,
|
|
67
|
-
formatMDXFrontmatter: exports.formatMDXFrontmatter,
|
|
68
|
-
formatMDXLink: exports.formatMDXLink,
|
|
69
|
-
formatMDXNameEntity: exports.formatMDXNameEntity,
|
|
70
|
-
formatMDXSpecifiedByLink: exports.formatMDXSpecifiedByLink,
|
|
71
|
-
});
|
|
72
|
-
exports.createMDXFormatter = createMDXFormatter;
|
package/dist/hugo.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hugo formatter for GraphQL documentation output.
|
|
3
|
-
*
|
|
4
|
-
* Produces Markdown compatible with Hugo static site generator.
|
|
5
|
-
* Uses GitHub-style alerts (Hugo 0.132+) for admonitions and
|
|
6
|
-
* strips file extensions from internal links to match Hugo's URL routing.
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
*/
|
|
10
|
-
import type { AdmonitionType, Badge, CollapsibleOption, Formatter, FrontMatterOptions, Maybe, MDXString, MetaInfo, TypeLink } from "@graphql-markdown/types";
|
|
11
|
-
export declare const formatMDXBadge: ({ text }: Badge) => MDXString;
|
|
12
|
-
export declare const formatMDXAdmonition: ({ text, title, type }: AdmonitionType, _meta: Maybe<MetaInfo>) => MDXString;
|
|
13
|
-
export declare const formatMDXBullet: (text?: string) => MDXString;
|
|
14
|
-
export declare const formatMDXDetails: ({ dataOpen, dataClose, }: CollapsibleOption) => MDXString;
|
|
15
|
-
export declare const formatMDXFrontmatter: (_props: Maybe<FrontMatterOptions>, formatted: Maybe<string[]>) => MDXString;
|
|
16
|
-
export declare const formatMDXLink: ({ text, url }: TypeLink) => TypeLink;
|
|
17
|
-
export declare const formatMDXNameEntity: (name: string, parentType?: Maybe<string>) => MDXString;
|
|
18
|
-
export declare const formatMDXSpecifiedByLink: (url: string) => MDXString;
|
|
19
|
-
export declare const createMDXFormatter: (_meta?: Maybe<MetaInfo>) => Formatter;
|
|
20
|
-
//# sourceMappingURL=hugo.d.ts.map
|
package/dist/hugo.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hugo.d.ts","sourceRoot":"","sources":["../src/hugo.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAyBjC,eAAO,MAAM,cAAc,aAAc,KAAK,KAAG,SACuB,CAAC;AAEzE,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAIF,CAAC;AAEF,eAAO,MAAM,eAAe,qBAAgB,SACR,CAAC;AAErC,eAAO,MAAM,gBAAgB,6BAG1B,iBAAiB,KAAG,SACiM,CAAC;AAEzN,eAAO,MAAM,oBAAoB,WACvB,KAAK,CAAC,kBAAkB,CAAC,aACtB,KAAK,CAAC,MAAM,EAAE,CAAC,KACzB,SAKoB,CAAC;AAGxB,eAAO,MAAM,aAAa,kBAAmB,QAAQ,KAAG,QAGtD,CAAC;AAEH,eAAO,MAAM,mBAAmB,SACxB,MAAM,eACC,KAAK,CAAC,MAAM,CAAC,KACzB,SAGF,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAAS,MAAM,KAAG,SACb,CAAC;AAE3C,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAS3D,CAAC"}
|
package/dist/hugo.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Hugo formatter for GraphQL documentation output.
|
|
4
|
-
*
|
|
5
|
-
* Produces Markdown compatible with Hugo static site generator.
|
|
6
|
-
* Uses GitHub-style alerts (Hugo 0.132+) for admonitions and
|
|
7
|
-
* strips file extensions from internal links to match Hugo's URL routing.
|
|
8
|
-
*
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.createMDXFormatter = exports.formatMDXSpecifiedByLink = exports.formatMDXNameEntity = exports.formatMDXLink = exports.formatMDXFrontmatter = exports.formatMDXDetails = exports.formatMDXBullet = exports.formatMDXAdmonition = exports.formatMDXBadge = void 0;
|
|
13
|
-
const utils_1 = require("@graphql-markdown/utils");
|
|
14
|
-
// Maps graphql-markdown admonition types to Hugo GitHub-style alert types (Hugo 0.132+)
|
|
15
|
-
const ALERT_TYPE_MAP = {
|
|
16
|
-
note: "NOTE",
|
|
17
|
-
tip: "TIP",
|
|
18
|
-
info: "IMPORTANT",
|
|
19
|
-
warning: "WARNING",
|
|
20
|
-
danger: "CAUTION",
|
|
21
|
-
deprecated: "WARNING",
|
|
22
|
-
caution: "CAUTION",
|
|
23
|
-
success: "NOTE",
|
|
24
|
-
};
|
|
25
|
-
const quoteLines = (text) => text
|
|
26
|
-
.split(utils_1.MARKDOWN_EOL)
|
|
27
|
-
.map((line) => `> ${line}`)
|
|
28
|
-
.join(utils_1.MARKDOWN_EOL);
|
|
29
|
-
const formatMDXBadge = ({ text }) => `<mark class="gqlmd-hugo-badge">${text}</mark>`;
|
|
30
|
-
exports.formatMDXBadge = formatMDXBadge;
|
|
31
|
-
const formatMDXAdmonition = ({ text, title, type }, _meta) => {
|
|
32
|
-
const alertType = ALERT_TYPE_MAP[type.toLowerCase()] ?? "NOTE";
|
|
33
|
-
const titleLine = title ? `${utils_1.MARKDOWN_EOL}> **${title}**` : "";
|
|
34
|
-
return `${utils_1.MARKDOWN_EOP}> [!${alertType}]${titleLine}${utils_1.MARKDOWN_EOL}${quoteLines(text)}${utils_1.MARKDOWN_EOL}`;
|
|
35
|
-
};
|
|
36
|
-
exports.formatMDXAdmonition = formatMDXAdmonition;
|
|
37
|
-
const formatMDXBullet = (text = "") => `• ${text}`;
|
|
38
|
-
exports.formatMDXBullet = formatMDXBullet;
|
|
39
|
-
const formatMDXDetails = ({ dataOpen, dataClose, }) => `${utils_1.MARKDOWN_EOP}<details>${utils_1.MARKDOWN_EOL}<summary>${dataOpen}</summary>${utils_1.MARKDOWN_EOL}${utils_1.MARKDOWN_EOL}\r${utils_1.MARKDOWN_EOL}${utils_1.MARKDOWN_EOL}<p><em>${dataClose}</em></p>${utils_1.MARKDOWN_EOL}</details>${utils_1.MARKDOWN_EOP}`;
|
|
40
|
-
exports.formatMDXDetails = formatMDXDetails;
|
|
41
|
-
const formatMDXFrontmatter = (_props, formatted) => formatted
|
|
42
|
-
? [utils_1.FRONT_MATTER_DELIMITER, ...formatted, utils_1.FRONT_MATTER_DELIMITER].join(utils_1.MARKDOWN_EOL)
|
|
43
|
-
: "";
|
|
44
|
-
exports.formatMDXFrontmatter = formatMDXFrontmatter;
|
|
45
|
-
// Hugo resolves pages by directory, not by .md extension — strip it from internal links
|
|
46
|
-
const formatMDXLink = ({ text, url }) => ({
|
|
47
|
-
text,
|
|
48
|
-
url: url.replace(/\.md$/, ""),
|
|
49
|
-
});
|
|
50
|
-
exports.formatMDXLink = formatMDXLink;
|
|
51
|
-
const formatMDXNameEntity = (name, parentType) => {
|
|
52
|
-
const parentName = parentType ? `${parentType}.` : "";
|
|
53
|
-
return `\`${parentName}${name}\``;
|
|
54
|
-
};
|
|
55
|
-
exports.formatMDXNameEntity = formatMDXNameEntity;
|
|
56
|
-
const formatMDXSpecifiedByLink = (url) => `[Specification ⎘](${url})`;
|
|
57
|
-
exports.formatMDXSpecifiedByLink = formatMDXSpecifiedByLink;
|
|
58
|
-
const createMDXFormatter = (_meta) => ({
|
|
59
|
-
formatMDXBadge: exports.formatMDXBadge,
|
|
60
|
-
formatMDXAdmonition: exports.formatMDXAdmonition,
|
|
61
|
-
formatMDXBullet: exports.formatMDXBullet,
|
|
62
|
-
formatMDXDetails: exports.formatMDXDetails,
|
|
63
|
-
formatMDXFrontmatter: exports.formatMDXFrontmatter,
|
|
64
|
-
formatMDXLink: exports.formatMDXLink,
|
|
65
|
-
formatMDXNameEntity: exports.formatMDXNameEntity,
|
|
66
|
-
formatMDXSpecifiedByLink: exports.formatMDXSpecifiedByLink,
|
|
67
|
-
});
|
|
68
|
-
exports.createMDXFormatter = createMDXFormatter;
|
package/dist/mdbook.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mdBook formatter for GraphQL documentation output.
|
|
3
|
-
*
|
|
4
|
-
* Produces Markdown compatible with Rust's mdBook static site generator.
|
|
5
|
-
* Front matter is suppressed because mdBook renders it as literal content.
|
|
6
|
-
* Admonitions fall back to blockquote style as mdBook has no native support.
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
*/
|
|
10
|
-
import type { AdmonitionType, Badge, CollapsibleOption, Formatter, FrontMatterOptions, Maybe, MDXString, MetaInfo, TypeLink } from "@graphql-markdown/types";
|
|
11
|
-
export declare const formatMDXBadge: ({ text }: Badge) => MDXString;
|
|
12
|
-
export declare const formatMDXAdmonition: ({ text, title, type }: AdmonitionType, _meta: Maybe<MetaInfo>) => MDXString;
|
|
13
|
-
export declare const formatMDXBullet: (text?: string) => MDXString;
|
|
14
|
-
export declare const formatMDXDetails: ({ dataOpen, dataClose, }: CollapsibleOption) => MDXString;
|
|
15
|
-
export declare const formatMDXFrontmatter: (_props: Maybe<FrontMatterOptions>, _formatted: Maybe<string[]>) => MDXString;
|
|
16
|
-
export declare const formatMDXLink: (link: TypeLink) => TypeLink;
|
|
17
|
-
export declare const formatMDXNameEntity: (name: string, parentType?: Maybe<string>) => MDXString;
|
|
18
|
-
export declare const formatMDXSpecifiedByLink: (url: string) => MDXString;
|
|
19
|
-
export declare const createMDXFormatter: (_meta?: Maybe<MetaInfo>) => Formatter;
|
|
20
|
-
//# sourceMappingURL=mdbook.d.ts.map
|
package/dist/mdbook.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mdbook.d.ts","sourceRoot":"","sources":["../src/mdbook.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AASjC,eAAO,MAAM,cAAc,aAAc,KAAK,KAAG,SACX,CAAC;AAEvC,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAGF,CAAC;AAEF,eAAO,MAAM,eAAe,qBAAgB,SACR,CAAC;AAErC,eAAO,MAAM,gBAAgB,6BAG1B,iBAAiB,KAAG,SAC0L,CAAC;AAGlN,eAAO,MAAM,oBAAoB,WACvB,KAAK,CAAC,kBAAkB,CAAC,cACrB,KAAK,CAAC,MAAM,EAAE,CAAC,KAC1B,SAA4B,CAAC;AAEhC,eAAO,MAAM,aAAa,SAAU,QAAQ,KAAG,QAAgB,CAAC;AAEhE,eAAO,MAAM,mBAAmB,SACxB,MAAM,eACC,KAAK,CAAC,MAAM,CAAC,KACzB,SAGF,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAAS,MAAM,KAAG,SACb,CAAC;AAE3C,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAS3D,CAAC"}
|
package/dist/mdbook.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* mdBook formatter for GraphQL documentation output.
|
|
4
|
-
*
|
|
5
|
-
* Produces Markdown compatible with Rust's mdBook static site generator.
|
|
6
|
-
* Front matter is suppressed because mdBook renders it as literal content.
|
|
7
|
-
* Admonitions fall back to blockquote style as mdBook has no native support.
|
|
8
|
-
*
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.createMDXFormatter = exports.formatMDXSpecifiedByLink = exports.formatMDXNameEntity = exports.formatMDXLink = exports.formatMDXFrontmatter = exports.formatMDXDetails = exports.formatMDXBullet = exports.formatMDXAdmonition = exports.formatMDXBadge = void 0;
|
|
13
|
-
const utils_1 = require("@graphql-markdown/utils");
|
|
14
|
-
const quoteLines = (text) => text
|
|
15
|
-
.split(utils_1.MARKDOWN_EOL)
|
|
16
|
-
.map((line) => `> ${line}`)
|
|
17
|
-
.join(utils_1.MARKDOWN_EOL);
|
|
18
|
-
const formatMDXBadge = ({ text }) => `**${text}**`;
|
|
19
|
-
exports.formatMDXBadge = formatMDXBadge;
|
|
20
|
-
const formatMDXAdmonition = ({ text, title, type }, _meta) => {
|
|
21
|
-
const label = (title ?? type).toUpperCase();
|
|
22
|
-
return `${utils_1.MARKDOWN_EOP}> **${label}**${utils_1.MARKDOWN_EOL}${quoteLines(text)}${utils_1.MARKDOWN_EOL}`;
|
|
23
|
-
};
|
|
24
|
-
exports.formatMDXAdmonition = formatMDXAdmonition;
|
|
25
|
-
const formatMDXBullet = (text = "") => `• ${text}`;
|
|
26
|
-
exports.formatMDXBullet = formatMDXBullet;
|
|
27
|
-
const formatMDXDetails = ({ dataOpen, dataClose, }) => `${utils_1.MARKDOWN_EOP}<details>${utils_1.MARKDOWN_EOL}<summary>${dataOpen}</summary>${utils_1.MARKDOWN_EOL}${utils_1.MARKDOWN_EOL}\r${utils_1.MARKDOWN_EOL}${utils_1.MARKDOWN_EOL}<em>${dataClose}</em>${utils_1.MARKDOWN_EOL}</details>${utils_1.MARKDOWN_EOP}`;
|
|
28
|
-
exports.formatMDXDetails = formatMDXDetails;
|
|
29
|
-
// mdBook does not support front matter — rendering it would produce literal --- and YAML as content
|
|
30
|
-
const formatMDXFrontmatter = (_props, _formatted) => "";
|
|
31
|
-
exports.formatMDXFrontmatter = formatMDXFrontmatter;
|
|
32
|
-
const formatMDXLink = (link) => link;
|
|
33
|
-
exports.formatMDXLink = formatMDXLink;
|
|
34
|
-
const formatMDXNameEntity = (name, parentType) => {
|
|
35
|
-
const parentName = parentType ? `${parentType}.` : "";
|
|
36
|
-
return `\`${parentName}${name}\``;
|
|
37
|
-
};
|
|
38
|
-
exports.formatMDXNameEntity = formatMDXNameEntity;
|
|
39
|
-
const formatMDXSpecifiedByLink = (url) => `[Specification ⎘](${url})`;
|
|
40
|
-
exports.formatMDXSpecifiedByLink = formatMDXSpecifiedByLink;
|
|
41
|
-
const createMDXFormatter = (_meta) => ({
|
|
42
|
-
formatMDXBadge: exports.formatMDXBadge,
|
|
43
|
-
formatMDXAdmonition: exports.formatMDXAdmonition,
|
|
44
|
-
formatMDXBullet: exports.formatMDXBullet,
|
|
45
|
-
formatMDXDetails: exports.formatMDXDetails,
|
|
46
|
-
formatMDXFrontmatter: exports.formatMDXFrontmatter,
|
|
47
|
-
formatMDXLink: exports.formatMDXLink,
|
|
48
|
-
formatMDXNameEntity: exports.formatMDXNameEntity,
|
|
49
|
-
formatMDXSpecifiedByLink: exports.formatMDXSpecifiedByLink,
|
|
50
|
-
});
|
|
51
|
-
exports.createMDXFormatter = createMDXFormatter;
|
package/dist/mkdocs.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MkDocs Material formatter for GraphQL documentation output.
|
|
3
|
-
*
|
|
4
|
-
* Produces Markdown compatible with MkDocs Material theme admonitions,
|
|
5
|
-
* collapsible blocks, and standard YAML front matter.
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
import type { AdmonitionType, Badge, CollapsibleOption, Formatter, FrontMatterOptions, Maybe, MDXString, MetaInfo, TypeLink } from "@graphql-markdown/types";
|
|
10
|
-
export declare const formatMDXBadge: ({ text }: Badge) => MDXString;
|
|
11
|
-
export declare const formatMDXAdmonition: ({ text, title, type }: AdmonitionType, _meta: Maybe<MetaInfo>) => MDXString;
|
|
12
|
-
export declare const formatMDXBullet: (text?: string) => MDXString;
|
|
13
|
-
export declare const formatMDXDetails: ({ dataOpen, dataClose, }: CollapsibleOption) => MDXString;
|
|
14
|
-
export declare const formatMDXFrontmatter: (_props: Maybe<FrontMatterOptions>, formatted: Maybe<string[]>) => MDXString;
|
|
15
|
-
export declare const formatMDXLink: (link: TypeLink) => TypeLink;
|
|
16
|
-
export declare const formatMDXNameEntity: (name: string, parentType?: Maybe<string>) => MDXString;
|
|
17
|
-
export declare const formatMDXSpecifiedByLink: (url: string) => MDXString;
|
|
18
|
-
export declare const createMDXFormatter: (_meta?: Maybe<MetaInfo>) => Formatter;
|
|
19
|
-
//# sourceMappingURL=mkdocs.d.ts.map
|
package/dist/mkdocs.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mkdocs.d.ts","sourceRoot":"","sources":["../src/mkdocs.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AA0BjC,eAAO,MAAM,cAAc,aAAc,KAAK,KAAG,SACyB,CAAC;AAE3E,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAIF,CAAC;AAEF,eAAO,MAAM,eAAe,qBAAgB,SACR,CAAC;AAErC,eAAO,MAAM,gBAAgB,6BAG1B,iBAAiB,KAAG,SACkI,CAAC;AAE1J,eAAO,MAAM,oBAAoB,WACvB,KAAK,CAAC,kBAAkB,CAAC,aACtB,KAAK,CAAC,MAAM,EAAE,CAAC,KACzB,SAKoB,CAAC;AAExB,eAAO,MAAM,aAAa,SAAU,QAAQ,KAAG,QAAgB,CAAC;AAEhE,eAAO,MAAM,mBAAmB,SACxB,MAAM,eACC,KAAK,CAAC,MAAM,CAAC,KACzB,SAGF,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAAS,MAAM,KAAG,SACb,CAAC;AAE3C,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAS3D,CAAC"}
|
package/dist/mkdocs.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* MkDocs Material formatter for GraphQL documentation output.
|
|
4
|
-
*
|
|
5
|
-
* Produces Markdown compatible with MkDocs Material theme admonitions,
|
|
6
|
-
* collapsible blocks, and standard YAML front matter.
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.createMDXFormatter = exports.formatMDXSpecifiedByLink = exports.formatMDXNameEntity = exports.formatMDXLink = exports.formatMDXFrontmatter = exports.formatMDXDetails = exports.formatMDXBullet = exports.formatMDXAdmonition = exports.formatMDXBadge = void 0;
|
|
12
|
-
const utils_1 = require("@graphql-markdown/utils");
|
|
13
|
-
const ADMONITION_TYPE_MAP = {
|
|
14
|
-
note: "note",
|
|
15
|
-
tip: "tip",
|
|
16
|
-
info: "info",
|
|
17
|
-
warning: "warning",
|
|
18
|
-
danger: "danger",
|
|
19
|
-
deprecated: "warning",
|
|
20
|
-
caution: "warning",
|
|
21
|
-
success: "success",
|
|
22
|
-
};
|
|
23
|
-
const indentLines = (text, spaces) => {
|
|
24
|
-
const indent = " ".repeat(spaces);
|
|
25
|
-
return text
|
|
26
|
-
.split(utils_1.MARKDOWN_EOL)
|
|
27
|
-
.map((line) => (line.trim() ? `${indent}${line}` : ""))
|
|
28
|
-
.join(utils_1.MARKDOWN_EOL);
|
|
29
|
-
};
|
|
30
|
-
const formatMDXBadge = ({ text }) => `<mark class="gqlmd-mkdocs-badge">${text}</mark>`;
|
|
31
|
-
exports.formatMDXBadge = formatMDXBadge;
|
|
32
|
-
const formatMDXAdmonition = ({ text, title, type }, _meta) => {
|
|
33
|
-
const mkdocsType = ADMONITION_TYPE_MAP[type.toLowerCase()] ?? "note";
|
|
34
|
-
const titleAttr = title ? ` "${title}"` : "";
|
|
35
|
-
return `${utils_1.MARKDOWN_EOP}!!! ${mkdocsType}${titleAttr}${utils_1.MARKDOWN_EOL}${indentLines(text, 4)}${utils_1.MARKDOWN_EOL}`;
|
|
36
|
-
};
|
|
37
|
-
exports.formatMDXAdmonition = formatMDXAdmonition;
|
|
38
|
-
const formatMDXBullet = (text = "") => `• ${text}`;
|
|
39
|
-
exports.formatMDXBullet = formatMDXBullet;
|
|
40
|
-
const formatMDXDetails = ({ dataOpen, dataClose, }) => `${utils_1.MARKDOWN_EOP}??? note "${dataOpen}"${utils_1.MARKDOWN_EOL}${utils_1.MARKDOWN_EOL} \r${utils_1.MARKDOWN_EOL}${utils_1.MARKDOWN_EOL} *${dataClose}*${utils_1.MARKDOWN_EOL}`;
|
|
41
|
-
exports.formatMDXDetails = formatMDXDetails;
|
|
42
|
-
const formatMDXFrontmatter = (_props, formatted) => formatted
|
|
43
|
-
? [utils_1.FRONT_MATTER_DELIMITER, ...formatted, utils_1.FRONT_MATTER_DELIMITER].join(utils_1.MARKDOWN_EOL)
|
|
44
|
-
: "";
|
|
45
|
-
exports.formatMDXFrontmatter = formatMDXFrontmatter;
|
|
46
|
-
const formatMDXLink = (link) => link;
|
|
47
|
-
exports.formatMDXLink = formatMDXLink;
|
|
48
|
-
const formatMDXNameEntity = (name, parentType) => {
|
|
49
|
-
const parentName = parentType ? `${parentType}.` : "";
|
|
50
|
-
return `\`${parentName}${name}\``;
|
|
51
|
-
};
|
|
52
|
-
exports.formatMDXNameEntity = formatMDXNameEntity;
|
|
53
|
-
const formatMDXSpecifiedByLink = (url) => `[Specification ⎘](${url})`;
|
|
54
|
-
exports.formatMDXSpecifiedByLink = formatMDXSpecifiedByLink;
|
|
55
|
-
const createMDXFormatter = (_meta) => ({
|
|
56
|
-
formatMDXBadge: exports.formatMDXBadge,
|
|
57
|
-
formatMDXAdmonition: exports.formatMDXAdmonition,
|
|
58
|
-
formatMDXBullet: exports.formatMDXBullet,
|
|
59
|
-
formatMDXDetails: exports.formatMDXDetails,
|
|
60
|
-
formatMDXFrontmatter: exports.formatMDXFrontmatter,
|
|
61
|
-
formatMDXLink: exports.formatMDXLink,
|
|
62
|
-
formatMDXNameEntity: exports.formatMDXNameEntity,
|
|
63
|
-
formatMDXSpecifiedByLink: exports.formatMDXSpecifiedByLink,
|
|
64
|
-
});
|
|
65
|
-
exports.createMDXFormatter = createMDXFormatter;
|