@graphql-markdown/printer-legacy 1.12.3 → 1.13.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/badge.d.ts +5 -4
- package/dist/badge.d.ts.map +1 -0
- package/dist/badge.js +15 -13
- package/dist/code.d.ts +2 -1
- package/dist/code.d.ts.map +1 -0
- package/dist/code.js +24 -22
- package/dist/common.d.ts +7 -8
- package/dist/common.d.ts.map +1 -0
- package/dist/common.js +3 -5
- package/dist/const/options.d.ts +2 -1
- package/dist/const/options.d.ts.map +1 -0
- package/dist/const/strings.d.ts +2 -5
- package/dist/const/strings.d.ts.map +1 -0
- package/dist/const/strings.js +10 -8
- package/dist/directive.d.ts +4 -3
- package/dist/directive.d.ts.map +1 -0
- package/dist/directive.js +10 -12
- package/dist/example.d.ts +1 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/format-helpers.d.ts +42 -0
- package/dist/format-helpers.d.ts.map +1 -0
- package/dist/format-helpers.js +74 -0
- package/dist/formatter.d.ts +28 -0
- package/dist/formatter.d.ts.map +1 -0
- package/dist/formatter.js +63 -0
- package/dist/frontmatter.d.ts +1 -0
- package/dist/frontmatter.d.ts.map +1 -0
- package/dist/graphql/directive.d.ts +3 -2
- package/dist/graphql/directive.d.ts.map +1 -0
- package/dist/graphql/directive.js +1 -1
- package/dist/graphql/enum.d.ts +3 -2
- package/dist/graphql/enum.d.ts.map +1 -0
- package/dist/graphql/index.d.ts +1 -0
- package/dist/graphql/index.d.ts.map +1 -0
- package/dist/graphql/input.d.ts +2 -1
- package/dist/graphql/input.d.ts.map +1 -0
- package/dist/graphql/input.js +2 -1
- package/dist/graphql/interface.d.ts +2 -1
- package/dist/graphql/interface.d.ts.map +1 -0
- package/dist/graphql/interface.js +2 -1
- package/dist/graphql/object.d.ts +1 -0
- package/dist/graphql/object.d.ts.map +1 -0
- package/dist/graphql/operation.d.ts +4 -3
- package/dist/graphql/operation.d.ts.map +1 -0
- package/dist/graphql/operation.js +3 -3
- package/dist/graphql/scalar.d.ts +4 -3
- package/dist/graphql/scalar.d.ts.map +1 -0
- package/dist/graphql/union.d.ts +3 -2
- package/dist/graphql/union.d.ts.map +1 -0
- package/dist/group.d.ts +3 -2
- package/dist/group.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/link.d.ts +5 -7
- package/dist/link.d.ts.map +1 -0
- package/dist/link.js +12 -13
- package/dist/mdx/index.d.ts +2 -1
- package/dist/mdx/index.d.ts.map +1 -0
- package/dist/mdx/index.js +2 -2
- package/dist/printer.d.ts +47 -20
- package/dist/printer.d.ts.map +1 -0
- package/dist/printer.js +160 -36
- package/dist/relation.d.ts +8 -7
- package/dist/relation.d.ts.map +1 -0
- package/dist/relation.js +13 -14
- package/dist/section.d.ts +5 -4
- package/dist/section.d.ts.map +1 -0
- package/dist/section.js +11 -9
- package/package.json +10 -10
package/dist/badge.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* and their properties like deprecation status, nullability, and relationships.
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import type { Badge, MDXString, Maybe, PrintTypeOptions,
|
|
7
|
+
import type { Badge, MDXString, Maybe, PrintTypeOptions, SchemaEntity } from "@graphql-markdown/types";
|
|
8
8
|
export declare const CSS_BADGE_CLASSNAME: {
|
|
9
9
|
DEPRECATED: string;
|
|
10
10
|
RELATION: string;
|
|
@@ -16,11 +16,11 @@ export declare const CSS_BADGE_CLASSNAME: {
|
|
|
16
16
|
* @param groups - Optional map of schema entities to their groups
|
|
17
17
|
* @returns Array of Badge objects containing text and optional classnames
|
|
18
18
|
*/
|
|
19
|
-
export declare const getTypeBadges: (type: unknown, groups?: Maybe<
|
|
19
|
+
export declare const getTypeBadges: (type: unknown, groups?: Maybe<Partial<Record<SchemaEntity, Record<string, Maybe<string>>>>>) => Badge[];
|
|
20
20
|
/**
|
|
21
21
|
* Formats a single badge into MDX string format.
|
|
22
22
|
* @param badge - The badge object containing text and optional classname
|
|
23
|
-
* @param options - Options
|
|
23
|
+
* @param options - Options containing the formatter for badges
|
|
24
24
|
* @returns Formatted MDX string representation of the badge
|
|
25
25
|
*/
|
|
26
26
|
export declare const printBadge: ({ text, classname }: Badge, options: PrintTypeOptions) => MDXString;
|
|
@@ -30,4 +30,5 @@ export declare const printBadge: ({ text, classname }: Badge, options: PrintType
|
|
|
30
30
|
* @param options - Options for printing/formatting the badges
|
|
31
31
|
* @returns Formatted MDX string containing all badges, or empty string if no badges or badges disabled
|
|
32
32
|
*/
|
|
33
|
-
export declare const printBadges: (type: unknown, options: PrintTypeOptions) =>
|
|
33
|
+
export declare const printBadges: (type: unknown, options: PrintTypeOptions) => string | MDXString;
|
|
34
|
+
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../src/badge.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,KAAK,EAEL,SAAS,EACT,KAAK,EACL,gBAAgB,EAEhB,YAAY,EACb,MAAM,yBAAyB,CAAC;AAgBjC,eAAO,MAAM,mBAAmB;;;;CAI/B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,0GA6CzB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,sEActB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,kEAsBvB,CAAC"}
|
package/dist/badge.js
CHANGED
|
@@ -11,6 +11,7 @@ const utils_1 = require("@graphql-markdown/utils");
|
|
|
11
11
|
const graphql_1 = require("@graphql-markdown/graphql");
|
|
12
12
|
const link_1 = require("./link");
|
|
13
13
|
const group_1 = require("./group");
|
|
14
|
+
const formatter_1 = require("./formatter");
|
|
14
15
|
const strings_1 = require("./const/strings");
|
|
15
16
|
exports.CSS_BADGE_CLASSNAME = {
|
|
16
17
|
DEPRECATED: "DEPRECATED",
|
|
@@ -24,10 +25,10 @@ exports.CSS_BADGE_CLASSNAME = {
|
|
|
24
25
|
* @returns Array of Badge objects containing text and optional classnames
|
|
25
26
|
*/
|
|
26
27
|
const getTypeBadges = (type, groups) => {
|
|
27
|
-
const badges = [];
|
|
28
28
|
if (typeof type !== "object" || type === null) {
|
|
29
|
-
return
|
|
29
|
+
return [];
|
|
30
30
|
}
|
|
31
|
+
const badges = [];
|
|
31
32
|
const rootType = ("type" in type ? type.type : type);
|
|
32
33
|
if ((0, graphql_1.isDeprecated)(type)) {
|
|
33
34
|
badges.push({
|
|
@@ -61,16 +62,18 @@ exports.getTypeBadges = getTypeBadges;
|
|
|
61
62
|
/**
|
|
62
63
|
* Formats a single badge into MDX string format.
|
|
63
64
|
* @param badge - The badge object containing text and optional classname
|
|
64
|
-
* @param options - Options
|
|
65
|
+
* @param options - Options containing the formatter for badges
|
|
65
66
|
* @returns Formatted MDX string representation of the badge
|
|
66
67
|
*/
|
|
67
68
|
const printBadge = ({ text, classname }, options) => {
|
|
68
|
-
const textString = typeof text === "object" ? text.singular : text;
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
69
|
+
const textString = (0, utils_1.escapeMDX)(typeof text === "object" ? text.singular : text);
|
|
70
|
+
const badge = { text: textString, classname };
|
|
71
|
+
// Use the formatter from options (either custom or default)
|
|
72
|
+
if (options.formatMDXBadge) {
|
|
73
|
+
return options.formatMDXBadge(badge);
|
|
74
|
+
}
|
|
75
|
+
// Fallback to default formatter (should not happen if Printer.init was called)
|
|
76
|
+
return (0, formatter_1.createDefaultFormatter)().formatMDXBadge(badge);
|
|
74
77
|
};
|
|
75
78
|
exports.printBadge = printBadge;
|
|
76
79
|
/**
|
|
@@ -89,10 +92,9 @@ const printBadges = (type, options) => {
|
|
|
89
92
|
if (badges.length === 0) {
|
|
90
93
|
return "";
|
|
91
94
|
}
|
|
92
|
-
|
|
93
|
-
.map((badge) => {
|
|
95
|
+
const formattedBadges = badges.map((badge) => {
|
|
94
96
|
return (0, exports.printBadge)(badge, options);
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
+
});
|
|
98
|
+
return formattedBadges.join(" ");
|
|
97
99
|
};
|
|
98
100
|
exports.printBadges = printBadges;
|
package/dist/code.d.ts
CHANGED
|
@@ -38,4 +38,5 @@ export declare const printCodeArguments: (type: unknown, indentationLevel?: numb
|
|
|
38
38
|
* // ): User!
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
|
-
export declare const printCodeField: (type: unknown, options?: PrintTypeOptions, indentationLevel?: number) =>
|
|
41
|
+
export declare const printCodeField: (type: unknown, options?: PrintTypeOptions | undefined, indentationLevel?: number) => string | MDXString;
|
|
42
|
+
//# sourceMappingURL=code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../src/code.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAiB3E;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB,sDA4B9B,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,0GAwB1B,CAAC"}
|
package/dist/code.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.printCodeField = exports.printCodeArguments = void 0;
|
|
11
11
|
const graphql_1 = require("@graphql-markdown/graphql");
|
|
12
|
+
const utils_1 = require("@graphql-markdown/utils");
|
|
12
13
|
const strings_1 = require("./const/strings");
|
|
13
14
|
const link_1 = require("./link");
|
|
14
15
|
/**
|
|
@@ -27,28 +28,26 @@ const link_1 = require("./link");
|
|
|
27
28
|
* ```
|
|
28
29
|
*/
|
|
29
30
|
const printCodeArguments = (type, indentationLevel = 1) => {
|
|
30
|
-
if (
|
|
31
|
-
type === null ||
|
|
32
|
-
!("args" in type) ||
|
|
33
|
-
!Array.isArray(type.args) ||
|
|
34
|
-
type.args.length === 0) {
|
|
31
|
+
if (!(0, utils_1.hasNonEmptyArrayProperty)(type, "args")) {
|
|
35
32
|
return "";
|
|
36
33
|
}
|
|
37
34
|
const argIndentation = strings_1.MARKDOWN_CODE_INDENTATION.repeat(indentationLevel);
|
|
38
35
|
const parentIndentation = indentationLevel === 1 ? "" : strings_1.MARKDOWN_CODE_INDENTATION;
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
const argLines = type.args.map((v) => {
|
|
37
|
+
if (!(0, utils_1.hasProperty)(v, "type") || !(0, utils_1.hasProperty)(v, "name")) {
|
|
38
|
+
return "";
|
|
39
|
+
}
|
|
41
40
|
const defaultValue = (0, graphql_1.getFormattedDefaultValue)(v);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
let printedDefault = "";
|
|
42
|
+
if (defaultValue !== undefined && defaultValue !== null) {
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
44
|
+
printedDefault = ` = ${String(defaultValue)}`;
|
|
45
|
+
}
|
|
46
46
|
const propType = String(v.type);
|
|
47
47
|
const propName = String(v.name);
|
|
48
|
-
return `${
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return code;
|
|
48
|
+
return `${argIndentation}${propName}: ${propType}${printedDefault}`;
|
|
49
|
+
});
|
|
50
|
+
return [`(`, ...argLines, `${parentIndentation})`].join(strings_1.MARKDOWN_EOL);
|
|
52
51
|
};
|
|
53
52
|
exports.printCodeArguments = printCodeArguments;
|
|
54
53
|
/**
|
|
@@ -68,17 +67,20 @@ exports.printCodeArguments = printCodeArguments;
|
|
|
68
67
|
* ```
|
|
69
68
|
*/
|
|
70
69
|
const printCodeField = (type, options, indentationLevel = 0) => {
|
|
71
|
-
if (
|
|
70
|
+
if (!(0, utils_1.hasProperty)(type, "type")) {
|
|
72
71
|
return "";
|
|
73
72
|
}
|
|
74
73
|
if (!(0, link_1.hasPrintableDirective)(type, options)) {
|
|
75
74
|
return "";
|
|
76
75
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
const parts = [
|
|
77
|
+
(0, graphql_1.getTypeName)(type),
|
|
78
|
+
(0, exports.printCodeArguments)(type, indentationLevel + 1),
|
|
79
|
+
`: ${(0, graphql_1.getTypeName)(type.type)}`,
|
|
80
|
+
];
|
|
81
|
+
if ((0, graphql_1.isDeprecated)(type)) {
|
|
82
|
+
parts.push(` @${strings_1.DEPRECATED}`);
|
|
83
|
+
}
|
|
84
|
+
return parts.join("") + strings_1.MARKDOWN_EOL;
|
|
83
85
|
};
|
|
84
86
|
exports.printCodeField = printCodeField;
|
package/dist/common.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { Maybe, MDXString, PrintTypeOptions } from "@graphql-markdown/types
|
|
|
10
10
|
* @param options - Printer configuration options
|
|
11
11
|
* @returns Formatted directive documentation string
|
|
12
12
|
*/
|
|
13
|
-
export declare const printCustomDirectives: (type: unknown, options?: PrintTypeOptions) => string;
|
|
13
|
+
export declare const printCustomDirectives: (type: unknown, options?: PrintTypeOptions | undefined) => string;
|
|
14
14
|
/**
|
|
15
15
|
* Formats a GraphQL type description or falls back to a default message.
|
|
16
16
|
*
|
|
@@ -18,18 +18,16 @@ export declare const printCustomDirectives: (type: unknown, options?: PrintTypeO
|
|
|
18
18
|
* @param replacement - Optional fallback text if no description exists
|
|
19
19
|
* @returns Formatted description string or MDX content
|
|
20
20
|
*/
|
|
21
|
-
export declare const formatDescription: (type: unknown, replacement?: Maybe<string>) =>
|
|
21
|
+
export declare const formatDescription: (type: unknown, replacement?: Maybe<string>) => string | MDXString;
|
|
22
22
|
/**
|
|
23
23
|
* Generates a warning message block in MDX format.
|
|
24
|
-
* @param
|
|
25
|
-
* @param param0.text - The warning message text
|
|
26
|
-
* @param param0.title - Optional title for the warning block
|
|
24
|
+
* @param warningConfig - Warning configuration object with `text` and optional `title` properties
|
|
27
25
|
* @param options - Configuration options for printing
|
|
28
26
|
* @returns Formatted warning message as MDX string
|
|
29
27
|
*/
|
|
30
28
|
export declare const printWarning: ({ text, title }: {
|
|
31
|
-
text?: string;
|
|
32
|
-
title?: string;
|
|
29
|
+
text?: string | undefined;
|
|
30
|
+
title?: string | undefined;
|
|
33
31
|
}, options: PrintTypeOptions) => string;
|
|
34
32
|
/**
|
|
35
33
|
* Prints deprecation information for a GraphQL type if it is deprecated.
|
|
@@ -45,4 +43,5 @@ export declare const printDeprecation: (type: unknown, options: PrintTypeOptions
|
|
|
45
43
|
* @param noText - Optional text to display when no description exists
|
|
46
44
|
* @returns Combined description, deprecation notices, and custom directives as MDX content
|
|
47
45
|
*/
|
|
48
|
-
export declare const printDescription: (type: unknown, options: PrintTypeOptions, noText?: string) =>
|
|
46
|
+
export declare const printDescription: (type: unknown, options: PrintTypeOptions, noText?: string | undefined) => string | MDXString;
|
|
47
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAGV,KAAK,EACL,SAAS,EACT,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAcjC;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,mEA+BjC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,oEAY7B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY;;;uCAaxB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,sDAiB5B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,+FAS5B,CAAC"}
|
package/dist/common.js
CHANGED
|
@@ -43,10 +43,10 @@ exports.printCustomDirectives = printCustomDirectives;
|
|
|
43
43
|
* @returns Formatted description string or MDX content
|
|
44
44
|
*/
|
|
45
45
|
const formatDescription = (type, replacement = strings_1.NO_DESCRIPTION_TEXT) => {
|
|
46
|
-
if (
|
|
46
|
+
if (!(0, utils_1.isTypeObject)(type)) {
|
|
47
47
|
return `${strings_1.MARKDOWN_EOP}${(0, utils_1.escapeMDX)(replacement)}`;
|
|
48
48
|
}
|
|
49
|
-
const description =
|
|
49
|
+
const description = (0, utils_1.hasStringProperty)(type, "description")
|
|
50
50
|
? type.description
|
|
51
51
|
: replacement;
|
|
52
52
|
return `${strings_1.MARKDOWN_EOP}${(0, utils_1.escapeMDX)(description)}`;
|
|
@@ -54,9 +54,7 @@ const formatDescription = (type, replacement = strings_1.NO_DESCRIPTION_TEXT) =>
|
|
|
54
54
|
exports.formatDescription = formatDescription;
|
|
55
55
|
/**
|
|
56
56
|
* Generates a warning message block in MDX format.
|
|
57
|
-
* @param
|
|
58
|
-
* @param param0.text - The warning message text
|
|
59
|
-
* @param param0.title - Optional title for the warning block
|
|
57
|
+
* @param warningConfig - Warning configuration object with `text` and optional `title` properties
|
|
60
58
|
* @param options - Configuration options for printing
|
|
61
59
|
* @returns Formatted warning message as MDX string
|
|
62
60
|
*/
|
package/dist/const/options.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare enum SectionLevels {
|
|
|
9
9
|
LEVEL = "#"
|
|
10
10
|
}
|
|
11
11
|
export declare const PRINT_TYPE_DEFAULT_OPTIONS: Required<PrinterConfigPrintTypeOptions>;
|
|
12
|
-
export declare const DEFAULT_OPTIONS: Required<Omit<PrintTypeOptions, "collapsible" | "groups" | "level" | "meta" | "onlyDocDirectives" | "parentType" | "schema" | "skipDocDirectives">> & {
|
|
12
|
+
export declare const DEFAULT_OPTIONS: Required<Omit<PrintTypeOptions, "collapsible" | "formatCategoryFolderName" | "groups" | "level" | "meta" | "onlyDocDirectives" | "parentType" | "schema" | "skipDocDirectives" | "beforeSchemaLoadHook" | "afterSchemaLoadHook" | "beforeDiffCheckHook" | "afterDiffCheckHook" | "beforeRenderRootTypesHook" | "afterRenderRootTypesHook" | "beforeRenderHomepageHook" | "afterRenderHomepageHook" | "beforeRenderTypeEntitiesHook" | "afterRenderTypeEntitiesHook" | "beforeGenerateIndexMetafileHook" | "afterGenerateIndexMetafileHook">> & {
|
|
13
13
|
collapsible: Maybe<CollapsibleOption>;
|
|
14
14
|
groups: Maybe<SchemaEntitiesGroupMap>;
|
|
15
15
|
level: Maybe<SectionLevelValue>;
|
|
@@ -18,3 +18,4 @@ export declare const DEFAULT_OPTIONS: Required<Omit<PrintTypeOptions, "collapsib
|
|
|
18
18
|
schema: Maybe<GraphQLSchema>;
|
|
19
19
|
skipDocDirectives: GraphQLDirective[];
|
|
20
20
|
};
|
|
21
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/const/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAEjB,gBAAgB,EAChB,aAAa,EACb,KAAK,EACL,gBAAgB,EAChB,6BAA6B,EAC7B,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AAIjC,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,oBAAY,aAAa;IACvB,IAAI,KAAK;IACT,KAAK,MAAM;CACZ;AAED,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,6BAA6B,CAU5E,CAAC;AAEJ,eAAO,MAAM,eAAe,EAAE,QAAQ,CACpC,IAAI,CACF,gBAAgB,EACd,aAAa,GACb,0BAA0B,GAC1B,QAAQ,GACR,OAAO,GACP,MAAM,GACN,mBAAmB,GACnB,YAAY,GACZ,QAAQ,GACR,mBAAmB,GACnB,sBAAsB,GACtB,qBAAqB,GACrB,qBAAqB,GACrB,oBAAoB,GACpB,2BAA2B,GAC3B,0BAA0B,GAC1B,0BAA0B,GAC1B,yBAAyB,GACzB,8BAA8B,GAC9B,6BAA6B,GAC7B,iCAAiC,GACjC,gCAAgC,CACnC,CACF,GAAG;IACF,WAAW,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACtC,MAAM,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACtC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAChC,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAC7B,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;CAgBvC,CAAC"}
|
package/dist/const/strings.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import type { RootTypeLocale } from "@graphql-markdown/types";
|
|
2
|
+
export { FRONT_MATTER_DELIMITER, MARKDOWN_CODE_INDENTATION, MARKDOWN_CODE_SNIPPET, MARKDOWN_EOL, MARKDOWN_EOP, } from "@graphql-markdown/utils";
|
|
2
3
|
export declare const ROOT_TYPE_LOCALE: RootTypeLocale;
|
|
3
4
|
export declare const DEPRECATED: "deprecated";
|
|
4
5
|
export declare const NON_NULL: "non-null";
|
|
5
6
|
export declare const GRAPHQL: "graphql";
|
|
6
7
|
export declare const NO_DESCRIPTION_TEXT: "No description";
|
|
7
|
-
export declare const MARKDOWN_CODE_SNIPPET: "```";
|
|
8
|
-
export declare const FRONT_MATTER_DELIMITER: "---";
|
|
9
|
-
export declare const MARKDOWN_CODE_INDENTATION: " ";
|
|
10
|
-
export declare const MARKDOWN_EOL: "\n";
|
|
11
|
-
export declare const MARKDOWN_EOP: string;
|
|
12
8
|
export declare const MARKDOWN_EOC: "\n```\n";
|
|
13
9
|
export declare const MARKDOWN_SOC: "\n```graphql\n";
|
|
10
|
+
//# sourceMappingURL=strings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src/const/strings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,YAAY,EACZ,YAAY,GACb,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,gBAAgB,EAAE,cAYrB,CAAC;AAEX,eAAO,MAAM,UAAU,cAAwB,CAAC;AAChD,eAAO,MAAM,QAAQ,YAAsB,CAAC;AAC5C,eAAO,MAAM,OAAO,WAAqB,CAAC;AAC1C,eAAO,MAAM,mBAAmB,kBAA4B,CAAC;AAE7D,eAAO,MAAM,YAAY,WAC0C,CAAC;AACpE,eAAO,MAAM,YAAY,kBACoD,CAAC"}
|
package/dist/const/strings.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MARKDOWN_SOC = exports.MARKDOWN_EOC = exports.
|
|
3
|
+
exports.MARKDOWN_SOC = exports.MARKDOWN_EOC = exports.NO_DESCRIPTION_TEXT = exports.GRAPHQL = exports.NON_NULL = exports.DEPRECATED = exports.ROOT_TYPE_LOCALE = exports.MARKDOWN_EOP = exports.MARKDOWN_EOL = exports.MARKDOWN_CODE_SNIPPET = exports.MARKDOWN_CODE_INDENTATION = exports.FRONT_MATTER_DELIMITER = void 0;
|
|
4
|
+
const utils_1 = require("@graphql-markdown/utils");
|
|
5
|
+
const utils_2 = require("@graphql-markdown/utils");
|
|
6
|
+
Object.defineProperty(exports, "FRONT_MATTER_DELIMITER", { enumerable: true, get: function () { return utils_2.FRONT_MATTER_DELIMITER; } });
|
|
7
|
+
Object.defineProperty(exports, "MARKDOWN_CODE_INDENTATION", { enumerable: true, get: function () { return utils_2.MARKDOWN_CODE_INDENTATION; } });
|
|
8
|
+
Object.defineProperty(exports, "MARKDOWN_CODE_SNIPPET", { enumerable: true, get: function () { return utils_2.MARKDOWN_CODE_SNIPPET; } });
|
|
9
|
+
Object.defineProperty(exports, "MARKDOWN_EOL", { enumerable: true, get: function () { return utils_2.MARKDOWN_EOL; } });
|
|
10
|
+
Object.defineProperty(exports, "MARKDOWN_EOP", { enumerable: true, get: function () { return utils_2.MARKDOWN_EOP; } });
|
|
4
11
|
exports.ROOT_TYPE_LOCALE = {
|
|
5
12
|
DIRECTIVE: { singular: "directive", plural: "directives" },
|
|
6
13
|
ENUM: { singular: "enum", plural: "enums" },
|
|
@@ -18,10 +25,5 @@ exports.DEPRECATED = "deprecated";
|
|
|
18
25
|
exports.NON_NULL = "non-null";
|
|
19
26
|
exports.GRAPHQL = "graphql";
|
|
20
27
|
exports.NO_DESCRIPTION_TEXT = "No description";
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.MARKDOWN_CODE_INDENTATION = " ";
|
|
24
|
-
exports.MARKDOWN_EOL = "\n";
|
|
25
|
-
exports.MARKDOWN_EOP = `${exports.MARKDOWN_EOL.repeat(2)}`;
|
|
26
|
-
exports.MARKDOWN_EOC = `${exports.MARKDOWN_EOL}${exports.MARKDOWN_CODE_SNIPPET}${exports.MARKDOWN_EOL}`;
|
|
27
|
-
exports.MARKDOWN_SOC = `${exports.MARKDOWN_EOL}${exports.MARKDOWN_CODE_SNIPPET}${exports.GRAPHQL}${exports.MARKDOWN_EOL}`;
|
|
28
|
+
exports.MARKDOWN_EOC = `${utils_1.MARKDOWN_EOL}${utils_1.MARKDOWN_CODE_SNIPPET}${utils_1.MARKDOWN_EOL}`;
|
|
29
|
+
exports.MARKDOWN_SOC = `${utils_1.MARKDOWN_EOL}${utils_1.MARKDOWN_CODE_SNIPPET}${exports.GRAPHQL}${utils_1.MARKDOWN_EOL}`;
|
package/dist/directive.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { Badge, PrintTypeOptions, MDXString, CustomDirectiveMapItem, Custom
|
|
|
9
9
|
* @param type - The GraphQL type to resolve the directive for
|
|
10
10
|
* @param constDirectiveOption - The directive configuration options
|
|
11
11
|
* @param fallback - Optional fallback value if resolution fails
|
|
12
|
-
* @returns The resolved directive value or fallback
|
|
12
|
+
* @returns The resolved directive value or `fallback`/`undefined`
|
|
13
13
|
*/
|
|
14
14
|
export declare const getCustomDirectiveResolver: (resolver: CustomDirectiveResolver, type: unknown, constDirectiveOption: CustomDirectiveMapItem, fallback?: Maybe<string>) => Maybe<string>;
|
|
15
15
|
/**
|
|
@@ -17,7 +17,7 @@ export declare const getCustomDirectiveResolver: (resolver: CustomDirectiveResol
|
|
|
17
17
|
* @param type - The GraphQL type to print the directive for
|
|
18
18
|
* @param constDirectiveOption - The directive configuration options
|
|
19
19
|
* @param options - General printing options
|
|
20
|
-
* @returns Formatted Markdown string for the directive or undefined
|
|
20
|
+
* @returns Formatted Markdown string for the directive or `undefined`
|
|
21
21
|
*/
|
|
22
22
|
export declare const printCustomDirective: (type: unknown, constDirectiveOption: CustomDirectiveMapItem, options: PrintTypeOptions) => Maybe<string>;
|
|
23
23
|
/**
|
|
@@ -40,4 +40,5 @@ export declare const getCustomTags: (type: unknown, options: PrintTypeOptions) =
|
|
|
40
40
|
* @param options - General printing options
|
|
41
41
|
* @returns Formatted Markdown string of badges or empty string
|
|
42
42
|
*/
|
|
43
|
-
export declare const printCustomTags: (type: unknown, options: PrintTypeOptions) =>
|
|
43
|
+
export declare const printCustomTags: (type: unknown, options: PrintTypeOptions) => string | MDXString;
|
|
44
|
+
//# sourceMappingURL=directive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directive.d.ts","sourceRoot":"","sources":["../src/directive.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,KAAK,EACL,gBAAgB,EAChB,SAAS,EACT,sBAAsB,EACtB,uBAAuB,EACvB,KAAK,EACN,MAAM,yBAAyB,CAAC;AASjC;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,6IAiBtC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,2GAoBhC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,sDA4BjC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,uDAwBzB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,kEAc3B,CAAC"}
|
package/dist/directive.js
CHANGED
|
@@ -16,11 +16,10 @@ const badge_1 = require("./badge");
|
|
|
16
16
|
* @param type - The GraphQL type to resolve the directive for
|
|
17
17
|
* @param constDirectiveOption - The directive configuration options
|
|
18
18
|
* @param fallback - Optional fallback value if resolution fails
|
|
19
|
-
* @returns The resolved directive value or fallback
|
|
19
|
+
* @returns The resolved directive value or `fallback`/`undefined`
|
|
20
20
|
*/
|
|
21
21
|
const getCustomDirectiveResolver = (resolver, type, constDirectiveOption, fallback) => {
|
|
22
|
-
if (typeof constDirectiveOption
|
|
23
|
-
typeof constDirectiveOption.type !== "object" ||
|
|
22
|
+
if (typeof constDirectiveOption.type !== "object" ||
|
|
24
23
|
typeof constDirectiveOption[resolver] !== "function") {
|
|
25
24
|
return fallback;
|
|
26
25
|
}
|
|
@@ -32,7 +31,7 @@ exports.getCustomDirectiveResolver = getCustomDirectiveResolver;
|
|
|
32
31
|
* @param type - The GraphQL type to print the directive for
|
|
33
32
|
* @param constDirectiveOption - The directive configuration options
|
|
34
33
|
* @param options - General printing options
|
|
35
|
-
* @returns Formatted Markdown string for the directive or undefined
|
|
34
|
+
* @returns Formatted Markdown string for the directive or `undefined`
|
|
36
35
|
*/
|
|
37
36
|
const printCustomDirective = (type, constDirectiveOption, options) => {
|
|
38
37
|
const typeNameLink = (0, link_1.printLink)(constDirectiveOption.type, {
|
|
@@ -54,7 +53,7 @@ exports.printCustomDirective = printCustomDirective;
|
|
|
54
53
|
*/
|
|
55
54
|
const printCustomDirectives = (type, options) => {
|
|
56
55
|
const constDirectiveMap = (0, graphql_1.getConstDirectiveMap)(type, options.customDirectives);
|
|
57
|
-
if (!constDirectiveMap || Object.keys(constDirectiveMap).length
|
|
56
|
+
if (!constDirectiveMap || Object.keys(constDirectiveMap).length === 0) {
|
|
58
57
|
return "";
|
|
59
58
|
}
|
|
60
59
|
const directives = Object.values(constDirectiveMap)
|
|
@@ -62,7 +61,7 @@ const printCustomDirectives = (type, options) => {
|
|
|
62
61
|
return (0, exports.printCustomDirective)(type, constDirectiveOption, options);
|
|
63
62
|
})
|
|
64
63
|
.filter((value) => {
|
|
65
|
-
return
|
|
64
|
+
return value !== undefined;
|
|
66
65
|
});
|
|
67
66
|
if (directives.length === 0) {
|
|
68
67
|
return "";
|
|
@@ -81,7 +80,7 @@ const getCustomTags = (type, options) => {
|
|
|
81
80
|
const constDirectiveMap = (0, graphql_1.getConstDirectiveMap)(type, options.customDirectives);
|
|
82
81
|
if (typeof constDirectiveMap !== "object" ||
|
|
83
82
|
constDirectiveMap === null ||
|
|
84
|
-
|
|
83
|
+
Object.keys(constDirectiveMap).length === 0) {
|
|
85
84
|
return [];
|
|
86
85
|
}
|
|
87
86
|
return Object.values(constDirectiveMap)
|
|
@@ -89,7 +88,7 @@ const getCustomTags = (type, options) => {
|
|
|
89
88
|
return (0, exports.getCustomDirectiveResolver)("tag", type, constDirectiveOption);
|
|
90
89
|
})
|
|
91
90
|
.filter((value) => {
|
|
92
|
-
return
|
|
91
|
+
return value !== undefined;
|
|
93
92
|
});
|
|
94
93
|
};
|
|
95
94
|
exports.getCustomTags = getCustomTags;
|
|
@@ -104,10 +103,9 @@ const printCustomTags = (type, options) => {
|
|
|
104
103
|
if (badges.length === 0) {
|
|
105
104
|
return "";
|
|
106
105
|
}
|
|
107
|
-
|
|
108
|
-
.map((badge) => {
|
|
106
|
+
const formattedBadges = badges.map((badge) => {
|
|
109
107
|
return (0, badge_1.printBadge)(badge, options);
|
|
110
|
-
})
|
|
111
|
-
|
|
108
|
+
});
|
|
109
|
+
return formattedBadges.join(" ");
|
|
112
110
|
};
|
|
113
111
|
exports.printCustomTags = printCustomTags;
|
package/dist/example.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../src/example.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAIV,KAAK,EACL,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AAwBjC;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,gFAgCrC,CAAC;AA4JF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,YAAY,6DAmBxB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format event helpers for printer-legacy.
|
|
3
|
+
*
|
|
4
|
+
* This module provides helper functions to emit MDX format events and handle
|
|
5
|
+
* fallback to default formatters when no custom handlers are registered.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import type { AdmonitionType, Badge, CollapsibleOption, FrontMatterOptions, Maybe, MDXString, MetaInfo, TypeLink } from "@graphql-markdown/types";
|
|
10
|
+
/**
|
|
11
|
+
* Default badge formatter.
|
|
12
|
+
*/
|
|
13
|
+
export declare const formatMDXBadge: (badge: Badge) => MDXString;
|
|
14
|
+
/**
|
|
15
|
+
* Default admonition formatter.
|
|
16
|
+
*/
|
|
17
|
+
export declare const formatMDXAdmonition: ({ text, title, type, icon }: AdmonitionType, _meta: Maybe<MetaInfo>) => MDXString;
|
|
18
|
+
/**
|
|
19
|
+
* Default bullet formatter.
|
|
20
|
+
*/
|
|
21
|
+
export declare const formatMDXBullet: (text?: string) => MDXString;
|
|
22
|
+
/**
|
|
23
|
+
* Default details formatter.
|
|
24
|
+
*/
|
|
25
|
+
export declare const formatMDXDetails: ({ dataOpen, }: CollapsibleOption) => MDXString;
|
|
26
|
+
/**
|
|
27
|
+
* Default frontmatter formatter.
|
|
28
|
+
*/
|
|
29
|
+
export declare const formatMDXFrontmatter: (_props: Maybe<FrontMatterOptions>, formatted: Maybe<string[]>) => MDXString;
|
|
30
|
+
/**
|
|
31
|
+
* Default link formatter.
|
|
32
|
+
*/
|
|
33
|
+
export declare const formatMDXLink: (link: TypeLink) => TypeLink;
|
|
34
|
+
/**
|
|
35
|
+
* Default name entity formatter.
|
|
36
|
+
*/
|
|
37
|
+
export declare const formatMDXNameEntity: (name: string, parentType?: Maybe<string>) => MDXString;
|
|
38
|
+
/**
|
|
39
|
+
* Default specified-by link formatter.
|
|
40
|
+
*/
|
|
41
|
+
export declare const formatMDXSpecifiedByLink: (url: string) => MDXString;
|
|
42
|
+
//# sourceMappingURL=format-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-helpers.d.ts","sourceRoot":"","sources":["../src/format-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AASjC;;GAEG;AACH,eAAO,MAAM,cAAc,6BAE1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,oFAK/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,8BAE3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,iDAI5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,8EAShC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,8BAEzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,yDAQ/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,4BAEpC,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Format event helpers for printer-legacy.
|
|
4
|
+
*
|
|
5
|
+
* This module provides helper functions to emit MDX format events and handle
|
|
6
|
+
* fallback to default formatters when no custom handlers are registered.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.formatMDXSpecifiedByLink = exports.formatMDXNameEntity = exports.formatMDXLink = exports.formatMDXFrontmatter = exports.formatMDXDetails = exports.formatMDXBullet = exports.formatMDXAdmonition = exports.formatMDXBadge = void 0;
|
|
12
|
+
// Import default formatters
|
|
13
|
+
const strings_1 = require("./const/strings");
|
|
14
|
+
/**
|
|
15
|
+
* Default badge formatter.
|
|
16
|
+
*/
|
|
17
|
+
const formatMDXBadge = (badge) => {
|
|
18
|
+
return `<mark class="gqlmd-mdx-badge">${badge.text}</mark>`;
|
|
19
|
+
};
|
|
20
|
+
exports.formatMDXBadge = formatMDXBadge;
|
|
21
|
+
/**
|
|
22
|
+
* Default admonition formatter.
|
|
23
|
+
*/
|
|
24
|
+
const formatMDXAdmonition = ({ text, title, type, icon }, _meta) => {
|
|
25
|
+
return `${strings_1.MARKDOWN_EOP}<fieldset class="gqlmd-mdx-admonition-fieldset">${strings_1.MARKDOWN_EOL}<legend class="gqlmd-mdx-admonition-legend"><span class="gqlmd-mdx-admonition-legend-type gqlmd-mdx-admonition-legend-type-${type.toLocaleLowerCase()}">${icon ?? type.toUpperCase()} ${title}</span></legend>${strings_1.MARKDOWN_EOL}<span>${text}</span>${strings_1.MARKDOWN_EOL}</fieldset>`;
|
|
26
|
+
};
|
|
27
|
+
exports.formatMDXAdmonition = formatMDXAdmonition;
|
|
28
|
+
/**
|
|
29
|
+
* Default bullet formatter.
|
|
30
|
+
*/
|
|
31
|
+
const formatMDXBullet = (text = "") => {
|
|
32
|
+
return `<span class="gqlmd-mdx-bullet"> ● </span>${text}`;
|
|
33
|
+
};
|
|
34
|
+
exports.formatMDXBullet = formatMDXBullet;
|
|
35
|
+
/**
|
|
36
|
+
* Default details formatter.
|
|
37
|
+
*/
|
|
38
|
+
const formatMDXDetails = ({ dataOpen, }) => {
|
|
39
|
+
return `${strings_1.MARKDOWN_EOP}<details class="gqlmd-mdx-details">${strings_1.MARKDOWN_EOL}<summary class="gqlmd-mdx-details-summary"><span className="gqlmd-mdx-details-summary-open">${dataOpen.toUpperCase()}</span></summary>${strings_1.MARKDOWN_EOL}</details>${strings_1.MARKDOWN_EOP}`;
|
|
40
|
+
};
|
|
41
|
+
exports.formatMDXDetails = formatMDXDetails;
|
|
42
|
+
/**
|
|
43
|
+
* Default frontmatter formatter.
|
|
44
|
+
*/
|
|
45
|
+
const formatMDXFrontmatter = (_props, formatted) => {
|
|
46
|
+
return formatted
|
|
47
|
+
? [strings_1.FRONT_MATTER_DELIMITER, ...formatted, strings_1.FRONT_MATTER_DELIMITER].join(strings_1.MARKDOWN_EOL)
|
|
48
|
+
: "";
|
|
49
|
+
};
|
|
50
|
+
exports.formatMDXFrontmatter = formatMDXFrontmatter;
|
|
51
|
+
/**
|
|
52
|
+
* Default link formatter.
|
|
53
|
+
*/
|
|
54
|
+
const formatMDXLink = (link) => {
|
|
55
|
+
return link;
|
|
56
|
+
};
|
|
57
|
+
exports.formatMDXLink = formatMDXLink;
|
|
58
|
+
/**
|
|
59
|
+
* Default name entity formatter.
|
|
60
|
+
*/
|
|
61
|
+
const formatMDXNameEntity = (name, parentType) => {
|
|
62
|
+
const parentName = parentType
|
|
63
|
+
? `<code class="gqlmd-mdx-entity-parent">${parentType}</code>.`
|
|
64
|
+
: "";
|
|
65
|
+
return `<span class="gqlmd-mdx-entity">${parentName}<code class="gqlmd-mdx-entity-name">${name}</code></span>`;
|
|
66
|
+
};
|
|
67
|
+
exports.formatMDXNameEntity = formatMDXNameEntity;
|
|
68
|
+
/**
|
|
69
|
+
* Default specified-by link formatter.
|
|
70
|
+
*/
|
|
71
|
+
const formatMDXSpecifiedByLink = (url) => {
|
|
72
|
+
return `<span class="gqlmd-mdx-specifiedby">Specification<a class="gqlmd-mdx-specifiedby-link" target="_blank" href="${url}" title="Specified by ${url}">⎘</a></span>`;
|
|
73
|
+
};
|
|
74
|
+
exports.formatMDXSpecifiedByLink = formatMDXSpecifiedByLink;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatter factories for GraphQL documentation output.
|
|
3
|
+
*
|
|
4
|
+
* Provides factory functions to create formatters for different output targets.
|
|
5
|
+
* The default formatter produces HTML-like markup suitable for most Markdown processors.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import type { Formatter } from "@graphql-markdown/types";
|
|
10
|
+
/**
|
|
11
|
+
* Creates a default formatter for documentation output.
|
|
12
|
+
*
|
|
13
|
+
* The default formatter produces HTML-like markup with CSS classes
|
|
14
|
+
* that can be styled with custom CSS. This is suitable for most
|
|
15
|
+
* Markdown processors that support inline HTML.
|
|
16
|
+
*
|
|
17
|
+
* @returns A complete Formatter implementation
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { createDefaultFormatter } from '@graphql-markdown/printer-legacy';
|
|
22
|
+
*
|
|
23
|
+
* const formatter = createDefaultFormatter();
|
|
24
|
+
* const badge = formatter.formatMDXBadge({ text: 'Required' });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const createDefaultFormatter: () => Formatter;
|
|
28
|
+
//# sourceMappingURL=formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAIV,SAAS,EAMV,MAAM,yBAAyB,CAAC;AAQjC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,sBAAsB,iBAkDlC,CAAC"}
|