@graphql-markdown/formatters 1.0.1 → 1.1.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/defaults.d.ts +27 -0
- package/dist/defaults.d.ts.map +1 -1
- package/dist/defaults.js +34 -1
- package/dist/docfx/index.d.ts +3 -7
- package/dist/docfx/index.d.ts.map +1 -1
- package/dist/docfx/index.js +109 -40
- package/dist/docusaurus/index.d.ts +16 -0
- package/dist/docusaurus/index.d.ts.map +1 -1
- package/dist/docusaurus/index.js +34 -3
- package/dist/fumadocs/index.d.ts +13 -3
- package/dist/fumadocs/index.d.ts.map +1 -1
- package/dist/fumadocs/index.js +19 -9
- package/dist/honkit/index.d.ts +3 -1
- package/dist/honkit/index.d.ts.map +1 -1
- package/dist/honkit/index.js +5 -2
- package/dist/hugo/index.d.ts +1 -1
- package/dist/hugo/index.d.ts.map +1 -1
- package/dist/hugo/index.js +6 -4
- package/dist/mdbook/index.d.ts +1 -1
- package/dist/mdbook/index.d.ts.map +1 -1
- package/dist/mdbook/index.js +7 -9
- package/dist/mkdocs/index.d.ts +3 -2
- package/dist/mkdocs/index.d.ts.map +1 -1
- package/dist/mkdocs/index.js +6 -7
- package/dist/output.d.ts +58 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +112 -0
- package/dist/starlight/index.d.ts +13 -22
- package/dist/starlight/index.d.ts.map +1 -1
- package/dist/starlight/index.js +14 -34
- package/dist/version.d.ts +61 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +119 -0
- package/dist/vocs/index.d.ts +18 -4
- package/dist/vocs/index.d.ts.map +1 -1
- package/dist/vocs/index.js +21 -9
- 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/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;
|