@graphql-markdown/formatters 1.2.0 → 1.2.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/README.md +42 -24
- package/dist/docfx/index.d.ts +1 -1
- package/dist/docfx/index.d.ts.map +1 -1
- package/dist/docfx/index.js +20 -20
- package/dist/docusaurus/index.js +5 -5
- package/dist/fumadocs/index.d.ts +1 -1
- package/dist/fumadocs/index.d.ts.map +1 -1
- package/dist/fumadocs/index.js +12 -12
- package/dist/honkit/index.d.ts +2 -2
- package/dist/honkit/index.d.ts.map +1 -1
- package/dist/honkit/index.js +6 -6
- package/dist/hugo/index.d.ts +1 -1
- package/dist/hugo/index.d.ts.map +1 -1
- package/dist/hugo/index.js +12 -12
- package/dist/index.d.ts +10 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -10
- package/dist/mdbook/index.d.ts +1 -1
- package/dist/mdbook/index.d.ts.map +1 -1
- package/dist/mdbook/index.js +15 -15
- package/dist/mdx/index.d.ts +1 -1
- package/dist/mdx/index.d.ts.map +1 -1
- package/dist/mdx/index.js +15 -15
- package/dist/mkdocs/index.d.ts +2 -2
- package/dist/mkdocs/index.d.ts.map +1 -1
- package/dist/mkdocs/index.js +14 -14
- package/dist/starlight/index.d.ts +2 -2
- package/dist/starlight/index.d.ts.map +1 -1
- package/dist/starlight/index.js +13 -13
- package/dist/vocs/index.d.ts +17 -3
- package/dist/vocs/index.d.ts.map +1 -1
- package/dist/vocs/index.js +31 -10
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
# @graphql-markdown/formatters
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@graphql-markdown/formatters)
|
|
4
|
+
[](https://jsr.io/@graphql-markdown/formatters)
|
|
5
|
+
[](https://raw.githubusercontent.com/graphql-markdown/graphql-markdown/main/LICENSE)
|
|
6
|
+
[](https://sonarcloud.io/summary/new_code?id=graphql-markdown_formatters)
|
|
7
|
+
[](https://sonarcloud.io/summary/new_code?id=graphql-markdown_formatters)
|
|
8
|
+
[](https://dashboard.stryker-mutator.io/reports/github.com/graphql-markdown/graphql-markdown/main?module=formatters)
|
|
9
|
+
|
|
10
|
+
Framework formatter presets for [GraphQL-Markdown](https://graphql-markdown.dev).
|
|
4
11
|
|
|
5
12
|
This package provides ready-to-use formatter presets for popular documentation frameworks, with each formatter in its own package subpath.
|
|
6
13
|
|
|
7
14
|
## Installation
|
|
8
15
|
|
|
9
|
-
```
|
|
16
|
+
```shell
|
|
10
17
|
npm install @graphql-markdown/formatters
|
|
11
18
|
```
|
|
12
19
|
|
|
13
|
-
##
|
|
20
|
+
## Usage
|
|
14
21
|
|
|
15
22
|
Use any formatter in your GraphQL-Markdown configuration:
|
|
16
23
|
|
|
@@ -38,30 +45,35 @@ await runGraphQLMarkdown({
|
|
|
38
45
|
|
|
39
46
|
The legacy `mdxParser` setting still works as a deprecated alias, but new configurations should use `formatter`.
|
|
40
47
|
|
|
41
|
-
## Supported
|
|
48
|
+
## Supported formatters
|
|
42
49
|
|
|
43
50
|
Each formatter has its own setup guide:
|
|
44
51
|
|
|
45
|
-
| Framework
|
|
46
|
-
|
|
|
47
|
-
| Astro Starlight
|
|
48
|
-
| DocFX
|
|
49
|
-
| Docusaurus
|
|
50
|
-
| HonKit
|
|
51
|
-
| Hugo
|
|
52
|
-
| mdBook
|
|
53
|
-
| Generic MDX
|
|
54
|
-
| MkDocs
|
|
55
|
-
| Next.js + Fumadocs | `@graphql-markdown/formatters/fumadocs`
|
|
56
|
-
| Vocs
|
|
57
|
-
|
|
58
|
-
## Custom
|
|
52
|
+
| Framework | Package Path | Documentation |
|
|
53
|
+
| ------------------ | ----------------------------------------- | --------------------------------- |
|
|
54
|
+
| Astro Starlight | `@graphql-markdown/formatters/starlight` | [Guide](src/starlight/README.md) |
|
|
55
|
+
| DocFX | `@graphql-markdown/formatters/docfx` | [Guide](src/docfx/README.md) |
|
|
56
|
+
| Docusaurus | `@graphql-markdown/formatters/docusaurus` | [Guide](src/docusaurus/README.md) |
|
|
57
|
+
| HonKit | `@graphql-markdown/formatters/honkit` | [Guide](src/honkit/README.md) |
|
|
58
|
+
| Hugo | `@graphql-markdown/formatters/hugo` | [Guide](src/hugo/README.md) |
|
|
59
|
+
| mdBook | `@graphql-markdown/formatters/mdbook` | [Guide](src/mdbook/README.md) |
|
|
60
|
+
| Generic MDX | `@graphql-markdown/formatters/mdx` | [Guide](src/mdx/README.md) |
|
|
61
|
+
| MkDocs | `@graphql-markdown/formatters/mkdocs` | [Guide](src/mkdocs/README.md) |
|
|
62
|
+
| Next.js + Fumadocs | `@graphql-markdown/formatters/fumadocs` | [Guide](src/fumadocs/README.md) |
|
|
63
|
+
| Vocs | `@graphql-markdown/formatters/vocs` | [Guide](src/vocs/README.md) |
|
|
64
|
+
|
|
65
|
+
## Custom formatter
|
|
59
66
|
|
|
60
67
|
For frameworks not listed above, create a custom MDX module. See the [Integration Guide](https://graphql-markdown.dev/docs/advanced/integration-with-frameworks#custom-mdx-formatter) for the full formatter contract, the `formatMDXDetails` `\r` delimiter invariant, and examples of extending a preset.
|
|
61
68
|
|
|
69
|
+
## Documentation
|
|
70
|
+
|
|
71
|
+
- [Integration with Frameworks](https://graphql-markdown.dev/docs/advanced/integration-with-frameworks)
|
|
72
|
+
- [Configuration Options](https://graphql-markdown.dev/docs/settings)
|
|
73
|
+
|
|
62
74
|
## Contributing
|
|
63
75
|
|
|
64
|
-
### Add a
|
|
76
|
+
### Add a new formatter
|
|
65
77
|
|
|
66
78
|
1. Create the formatter module at `src/<name>/index.ts`.
|
|
67
79
|
2. Create documentation at `src/<name>/README.md`.
|
|
@@ -69,13 +81,13 @@ For frameworks not listed above, create a custom MDX module. See the [Integratio
|
|
|
69
81
|
4. Add a package subpath export for `./<name>` in `package.json` under `exports`.
|
|
70
82
|
5. Add unit tests in `tests/unit/<name>/index.test.ts`.
|
|
71
83
|
|
|
72
|
-
### Formatter
|
|
84
|
+
### Formatter contract
|
|
73
85
|
|
|
74
86
|
A formatter module exports `createMDXFormatter` and any subset of the standard formatter functions (`formatMDXBadge`, `formatMDXAdmonition`, `formatMDXBullet`, `formatMDXDetails`, `formatMDXFrontmatter`, `formatMDXLink`, `formatMDXNameEntity`, `formatMDXSpecifiedByLink`). Optional exports include `mdxDeclaration`, `mdxExtension`, and lifecycle hooks.
|
|
75
87
|
|
|
76
88
|
See the [Integration Guide](https://graphql-markdown.dev/docs/advanced/integration-with-frameworks#custom-mdx-formatter) for the full contract, type signatures, and the `formatMDXDetails` `\r` delimiter invariant.
|
|
77
89
|
|
|
78
|
-
### Testing
|
|
90
|
+
### Testing checklist
|
|
79
91
|
|
|
80
92
|
Add tests that verify:
|
|
81
93
|
|
|
@@ -85,14 +97,14 @@ Add tests that verify:
|
|
|
85
97
|
|
|
86
98
|
Run targeted tests while developing:
|
|
87
99
|
|
|
88
|
-
```
|
|
100
|
+
```shell
|
|
89
101
|
cd packages/formatters
|
|
90
102
|
bun run test:unit -- tests/unit/<name>/index.test.ts
|
|
91
103
|
```
|
|
92
104
|
|
|
93
105
|
Run package checks before opening a PR:
|
|
94
106
|
|
|
95
|
-
```
|
|
107
|
+
```shell
|
|
96
108
|
cd packages/formatters
|
|
97
109
|
bun run lint
|
|
98
110
|
bun run prettier
|
|
@@ -101,7 +113,13 @@ bun run test:unit
|
|
|
101
113
|
|
|
102
114
|
For repository-wide validation:
|
|
103
115
|
|
|
104
|
-
```
|
|
116
|
+
```shell
|
|
105
117
|
cd /path/to/graphql-markdown
|
|
106
118
|
bun run test
|
|
107
119
|
```
|
|
120
|
+
|
|
121
|
+
## License
|
|
122
|
+
|
|
123
|
+
GraphQL-Markdown packages are 100% free and open-source, under the [MIT license](https://github.com/graphql-markdown/graphql-markdown/blob/main/LICENSE).
|
|
124
|
+
|
|
125
|
+
This package is [Treeware](https://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/graphql-markdown/graphql-markdown) to thank us for our work. By contributing to the Treeware forest, you'll be creating employment for local families and restoring wildlife habitats.
|
package/dist/docfx/index.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare const formatMDXFrontmatter: (props: Maybe<FrontMatterOptions>, fo
|
|
|
37
37
|
* @returns The link unchanged
|
|
38
38
|
*/
|
|
39
39
|
export declare const formatMDXLink: (link: TypeLink) => TypeLink;
|
|
40
|
-
export { formatMDXBullet, formatMDXDetails, formatMDXNameEntity, formatMDXPermalink, formatMDXSpecifiedByLink, } from "../defaults";
|
|
40
|
+
export { formatMDXBullet, formatMDXDetails, formatMDXNameEntity, formatMDXPermalink, formatMDXSpecifiedByLink, } from "../defaults.ts";
|
|
41
41
|
/**
|
|
42
42
|
* Creates a DocFX formatter.
|
|
43
43
|
* @param _meta - Unused metadata parameter
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/docfx/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,SAAS,EACT,kBAAkB,EAClB,KAAK,EAEL,SAAS,EACT,QAAQ,EACR,sBAAsB,EACtB,QAAQ,EACT,MAAM,yBAAyB,CAAC;AA+BjC,sFAAsF;AACtF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIlD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,wBAAyB,KAAK,KAAG,SAI3D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAIF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,UACxB,KAAK,CAAC,kBAAkB,CAAC,aACrB,KAAK,CAAC,MAAM,EAAE,CAAC,KACzB,SAgBF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,SAAU,QAAQ,KAAG,QAE9C,CAAC;AAEF,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/docfx/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,SAAS,EACT,kBAAkB,EAClB,KAAK,EAEL,SAAS,EACT,QAAQ,EACR,sBAAsB,EACtB,QAAQ,EACT,MAAM,yBAAyB,CAAC;AA+BjC,sFAAsF;AACtF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIlD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,wBAAyB,KAAK,KAAG,SAI3D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAIF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,UACxB,KAAK,CAAC,kBAAkB,CAAC,aACrB,KAAK,CAAC,MAAM,EAAE,CAAC,KACzB,SAgBF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,SAAU,QAAQ,KAAG,QAE9C,CAAC;AAEF,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAY5D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAG,KAAc,CAAC;AA0P3C,eAAO,MAAM,2BAA2B,EAAE,sBAiDzC,CAAC"}
|
package/dist/docfx/index.js
CHANGED
|
@@ -13,8 +13,8 @@ exports.afterRenderTypeEntitiesHook = exports.mdxExtension = exports.createMDXFo
|
|
|
13
13
|
const node_path_1 = require("node:path");
|
|
14
14
|
const helpers_1 = require("@graphql-markdown/helpers");
|
|
15
15
|
const utils_1 = require("@graphql-markdown/utils");
|
|
16
|
-
const
|
|
17
|
-
const
|
|
16
|
+
const defaults_ts_1 = require("../defaults.js");
|
|
17
|
+
const output_ts_1 = require("../output.js");
|
|
18
18
|
/** Maps graphql-markdown admonition types to DocFX alert types. */
|
|
19
19
|
const ALERT_TYPE_MAP = {
|
|
20
20
|
note: "NOTE",
|
|
@@ -69,7 +69,7 @@ const formatMDXFrontmatter = (props, formatted) => {
|
|
|
69
69
|
const id = props && typeof props === "object" && "id" in props
|
|
70
70
|
? props.id
|
|
71
71
|
: undefined;
|
|
72
|
-
const uidLine = id ? [`
|
|
72
|
+
const uidLine = id ? [`uid: ${id}`] : [];
|
|
73
73
|
return [
|
|
74
74
|
utils_1.FRONT_MATTER_DELIMITER,
|
|
75
75
|
...uidLine,
|
|
@@ -87,12 +87,12 @@ const formatMDXLink = (link) => {
|
|
|
87
87
|
return link;
|
|
88
88
|
};
|
|
89
89
|
exports.formatMDXLink = formatMDXLink;
|
|
90
|
-
var
|
|
91
|
-
Object.defineProperty(exports, "formatMDXBullet", { enumerable: true, get: function () { return
|
|
92
|
-
Object.defineProperty(exports, "formatMDXDetails", { enumerable: true, get: function () { return
|
|
93
|
-
Object.defineProperty(exports, "formatMDXNameEntity", { enumerable: true, get: function () { return
|
|
94
|
-
Object.defineProperty(exports, "formatMDXPermalink", { enumerable: true, get: function () { return
|
|
95
|
-
Object.defineProperty(exports, "formatMDXSpecifiedByLink", { enumerable: true, get: function () { return
|
|
90
|
+
var defaults_ts_2 = require("../defaults.js");
|
|
91
|
+
Object.defineProperty(exports, "formatMDXBullet", { enumerable: true, get: function () { return defaults_ts_2.formatMDXBullet; } });
|
|
92
|
+
Object.defineProperty(exports, "formatMDXDetails", { enumerable: true, get: function () { return defaults_ts_2.formatMDXDetails; } });
|
|
93
|
+
Object.defineProperty(exports, "formatMDXNameEntity", { enumerable: true, get: function () { return defaults_ts_2.formatMDXNameEntity; } });
|
|
94
|
+
Object.defineProperty(exports, "formatMDXPermalink", { enumerable: true, get: function () { return defaults_ts_2.formatMDXPermalink; } });
|
|
95
|
+
Object.defineProperty(exports, "formatMDXSpecifiedByLink", { enumerable: true, get: function () { return defaults_ts_2.formatMDXSpecifiedByLink; } });
|
|
96
96
|
/**
|
|
97
97
|
* Creates a DocFX formatter.
|
|
98
98
|
* @param _meta - Unused metadata parameter
|
|
@@ -102,13 +102,13 @@ const createMDXFormatter = (_meta) => {
|
|
|
102
102
|
return {
|
|
103
103
|
formatMDXBadge: exports.formatMDXBadge,
|
|
104
104
|
formatMDXAdmonition: exports.formatMDXAdmonition,
|
|
105
|
-
formatMDXBullet:
|
|
106
|
-
formatMDXDetails:
|
|
105
|
+
formatMDXBullet: defaults_ts_1.formatMDXBullet,
|
|
106
|
+
formatMDXDetails: defaults_ts_1.formatMDXDetails,
|
|
107
107
|
formatMDXFrontmatter: exports.formatMDXFrontmatter,
|
|
108
108
|
formatMDXLink: exports.formatMDXLink,
|
|
109
|
-
formatMDXNameEntity:
|
|
110
|
-
formatMDXPermalink:
|
|
111
|
-
formatMDXSpecifiedByLink:
|
|
109
|
+
formatMDXNameEntity: defaults_ts_1.formatMDXNameEntity,
|
|
110
|
+
formatMDXPermalink: defaults_ts_1.formatMDXPermalink,
|
|
111
|
+
formatMDXSpecifiedByLink: defaults_ts_1.formatMDXSpecifiedByLink,
|
|
112
112
|
};
|
|
113
113
|
};
|
|
114
114
|
exports.createMDXFormatter = createMDXFormatter;
|
|
@@ -204,15 +204,15 @@ const queueFileUpdate = async (filePath, update) => {
|
|
|
204
204
|
const updateToc = async (tocFilePath, name, href, outputAdapter) => {
|
|
205
205
|
await queueFileUpdate(tocFilePath, async () => {
|
|
206
206
|
const entry = `- name: ${name}${utils_1.MARKDOWN_EOL} href: ${href}`;
|
|
207
|
-
const existing = await (0,
|
|
207
|
+
const existing = await (0, output_ts_1.readOptionalOutput)(tocFilePath, outputAdapter);
|
|
208
208
|
if (typeof existing !== "string") {
|
|
209
|
-
await (0,
|
|
209
|
+
await (0, output_ts_1.writeOutput)(tocFilePath, entry + utils_1.MARKDOWN_EOL, outputAdapter);
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
212
212
|
if (existing.includes(`href: ${href}`)) {
|
|
213
213
|
return;
|
|
214
214
|
}
|
|
215
|
-
await (0,
|
|
215
|
+
await (0, output_ts_1.writeOutput)(tocFilePath, existing.trimEnd() + utils_1.MARKDOWN_EOL + entry + utils_1.MARKDOWN_EOL, outputAdapter);
|
|
216
216
|
});
|
|
217
217
|
};
|
|
218
218
|
// Tracks directories whose index.md has already been prepended to their toc.yml,
|
|
@@ -245,7 +245,7 @@ const addOverviewEntry = async (currentDir, tocPath, isRoot, outputAdapter) => {
|
|
|
245
245
|
// the section index lives wherever the pages were written, which is not the
|
|
246
246
|
// local filesystem when a custom adapter is configured
|
|
247
247
|
const indexPath = (0, node_path_1.join)(currentDir, "index.md");
|
|
248
|
-
if (typeof (await (0,
|
|
248
|
+
if (typeof (await (0, output_ts_1.readOptionalOutput)(indexPath, outputAdapter)) !== "string") {
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
251
|
await updateToc(tocPath, `${(0, utils_1.capitalize)((0, node_path_1.basename)(currentDir))} Overview`, "index.md", outputAdapter);
|
|
@@ -291,7 +291,7 @@ const afterRenderTypeEntitiesHook = async (event) => {
|
|
|
291
291
|
// Rewrite uid as a path-derived value to guarantee uniqueness across the site.
|
|
292
292
|
// e.g. operations/queries/continent.md → uid: operations-queries-continent
|
|
293
293
|
const uid = pagePath.replace(/\.mdx?$/, "").replaceAll(/[/\\]/g, "-");
|
|
294
|
-
const content = await (0,
|
|
294
|
+
const content = await (0, output_ts_1.readOutput)(filePath, outputAdapter);
|
|
295
295
|
if (typeof content !== "string") {
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
@@ -301,7 +301,7 @@ const afterRenderTypeEntitiesHook = async (event) => {
|
|
|
301
301
|
const withUid = content.replace(/^([ \t]*)uid:.*$/m, `$1uid: ${uid}`);
|
|
302
302
|
const rewritten = rewriteInternalLinks(withUid, filePath, outputDir, baseURL, knownDocPaths);
|
|
303
303
|
if (rewritten !== content) {
|
|
304
|
-
await (0,
|
|
304
|
+
await (0, output_ts_1.writeOutput)(filePath, rewritten, outputAdapter);
|
|
305
305
|
}
|
|
306
306
|
// A page outside the output root has no toc to belong to.
|
|
307
307
|
if (pagePath.startsWith("..")) {
|
package/dist/docusaurus/index.js
CHANGED
|
@@ -11,8 +11,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
11
11
|
exports.createMDXFormatter = exports.formatMDXPermalink = exports.formatMDXFrontmatter = exports.formatMDXLink = exports.formatMDXNameEntity = exports.formatMDXSpecifiedByLink = exports.formatMDXDetails = exports.formatMDXBullet = exports.formatMDXAdmonition = exports.formatMDXBadge = exports.mdxDeclaration = void 0;
|
|
12
12
|
const helpers_1 = require("@graphql-markdown/helpers");
|
|
13
13
|
const utils_1 = require("@graphql-markdown/utils");
|
|
14
|
-
const
|
|
15
|
-
const
|
|
14
|
+
const defaults_ts_1 = require("../defaults.js");
|
|
15
|
+
const version_ts_1 = require("../version.js");
|
|
16
16
|
const LINK_MDX_EXTENSION = ".mdx";
|
|
17
17
|
const DOCUSAURUS_FRAMEWORK = "docusaurus";
|
|
18
18
|
/** Docusaurus version using the legacy `:::caution` admonition syntax. */
|
|
@@ -49,7 +49,7 @@ exports.formatMDXBadge = formatMDXBadge;
|
|
|
49
49
|
* @returns Formatted admonition string
|
|
50
50
|
*/
|
|
51
51
|
const formatMDXAdmonition = ({ text, title, type }, meta) => {
|
|
52
|
-
if ((0,
|
|
52
|
+
if ((0, version_ts_1.isFrameworkVersion)(meta, DOCUSAURUS_FRAMEWORK, LEGACY_ADMONITION_VERSION)) {
|
|
53
53
|
const oldType = type === "warning" ? "caution" : type;
|
|
54
54
|
return `${utils_1.MARKDOWN_EOP}:::${oldType} ${title}${text}:::`;
|
|
55
55
|
}
|
|
@@ -138,10 +138,10 @@ exports.formatMDXFrontmatter = formatMDXFrontmatter;
|
|
|
138
138
|
* @returns Formatted permalink string
|
|
139
139
|
*/
|
|
140
140
|
const formatMDXPermalink = (id, meta) => {
|
|
141
|
-
if ((0,
|
|
141
|
+
if ((0, version_ts_1.isFrameworkVersionAtLeast)(meta, DOCUSAURUS_FRAMEWORK, MDX_COMMENT_HEADING_ID_VERSION)) {
|
|
142
142
|
return `{/* #${id} */}`;
|
|
143
143
|
}
|
|
144
|
-
return (0,
|
|
144
|
+
return (0, defaults_ts_1.formatMDXEscapedPermalink)(id);
|
|
145
145
|
};
|
|
146
146
|
exports.formatMDXPermalink = formatMDXPermalink;
|
|
147
147
|
/**
|
package/dist/fumadocs/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export declare const formatMDXAdmonition: ({ text, title, type }: AdmonitionType
|
|
|
42
42
|
* @returns Unmodified link
|
|
43
43
|
*/
|
|
44
44
|
export declare const formatMDXLink: (link: TypeLink) => TypeLink;
|
|
45
|
-
export { formatMDXBullet, formatMDXDetails, formatMDXFrontmatter, formatMDXNameEntity, formatMDXSpecifiedByLink, } from "../defaults";
|
|
45
|
+
export { formatMDXBullet, formatMDXDetails, formatMDXFrontmatter, formatMDXNameEntity, formatMDXSpecifiedByLink, } from "../defaults.ts";
|
|
46
46
|
/**
|
|
47
47
|
* Creates a Fumadocs formatter.
|
|
48
48
|
* @param _meta - Unused metadata parameter
|
|
@@ -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;AAUjC;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,OAAQ,MAAM,KAAG,SAE/C,CAAC;AAEF,+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,
|
|
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;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,OAAQ,MAAM,KAAG,SAE/C,CAAC;AAEF,+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,gBAAgB,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAY5D,CAAC"}
|
package/dist/fumadocs/index.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
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 = exports.formatMDXPermalink = void 0;
|
|
12
12
|
const utils_1 = require("@graphql-markdown/utils");
|
|
13
|
-
const
|
|
13
|
+
const defaults_ts_1 = require("../defaults.js");
|
|
14
14
|
/**
|
|
15
15
|
* Formats a permalink for a section header using the Fumadocs `[#id]` syntax.
|
|
16
16
|
*
|
|
@@ -63,12 +63,12 @@ const formatMDXLink = (link) => {
|
|
|
63
63
|
return link;
|
|
64
64
|
};
|
|
65
65
|
exports.formatMDXLink = formatMDXLink;
|
|
66
|
-
var
|
|
67
|
-
Object.defineProperty(exports, "formatMDXBullet", { enumerable: true, get: function () { return
|
|
68
|
-
Object.defineProperty(exports, "formatMDXDetails", { enumerable: true, get: function () { return
|
|
69
|
-
Object.defineProperty(exports, "formatMDXFrontmatter", { enumerable: true, get: function () { return
|
|
70
|
-
Object.defineProperty(exports, "formatMDXNameEntity", { enumerable: true, get: function () { return
|
|
71
|
-
Object.defineProperty(exports, "formatMDXSpecifiedByLink", { enumerable: true, get: function () { return
|
|
66
|
+
var defaults_ts_2 = require("../defaults.js");
|
|
67
|
+
Object.defineProperty(exports, "formatMDXBullet", { enumerable: true, get: function () { return defaults_ts_2.formatMDXBullet; } });
|
|
68
|
+
Object.defineProperty(exports, "formatMDXDetails", { enumerable: true, get: function () { return defaults_ts_2.formatMDXDetails; } });
|
|
69
|
+
Object.defineProperty(exports, "formatMDXFrontmatter", { enumerable: true, get: function () { return defaults_ts_2.formatMDXFrontmatter; } });
|
|
70
|
+
Object.defineProperty(exports, "formatMDXNameEntity", { enumerable: true, get: function () { return defaults_ts_2.formatMDXNameEntity; } });
|
|
71
|
+
Object.defineProperty(exports, "formatMDXSpecifiedByLink", { enumerable: true, get: function () { return defaults_ts_2.formatMDXSpecifiedByLink; } });
|
|
72
72
|
/**
|
|
73
73
|
* Creates a Fumadocs formatter.
|
|
74
74
|
* @param _meta - Unused metadata parameter
|
|
@@ -78,13 +78,13 @@ const createMDXFormatter = (_meta) => {
|
|
|
78
78
|
return {
|
|
79
79
|
formatMDXBadge: exports.formatMDXBadge,
|
|
80
80
|
formatMDXAdmonition: exports.formatMDXAdmonition,
|
|
81
|
-
formatMDXBullet:
|
|
82
|
-
formatMDXDetails:
|
|
83
|
-
formatMDXFrontmatter:
|
|
81
|
+
formatMDXBullet: defaults_ts_1.formatMDXBullet,
|
|
82
|
+
formatMDXDetails: defaults_ts_1.formatMDXDetails,
|
|
83
|
+
formatMDXFrontmatter: defaults_ts_1.formatMDXFrontmatter,
|
|
84
84
|
formatMDXLink: exports.formatMDXLink,
|
|
85
|
-
formatMDXNameEntity:
|
|
85
|
+
formatMDXNameEntity: defaults_ts_1.formatMDXNameEntity,
|
|
86
86
|
formatMDXPermalink: exports.formatMDXPermalink,
|
|
87
|
-
formatMDXSpecifiedByLink:
|
|
87
|
+
formatMDXSpecifiedByLink: defaults_ts_1.formatMDXSpecifiedByLink,
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
exports.createMDXFormatter = createMDXFormatter;
|
package/dist/honkit/index.d.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
import type { AdmonitionType, Badge, CollapsibleOption, Formatter, FrontMatterOptions, Maybe, MDXString, MetaInfo, TypeLink } from "@graphql-markdown/types";
|
|
10
|
-
import { formatMDXBullet, formatMDXPermalink } from "../defaults";
|
|
11
|
-
export { formatMDXPermalink } from "../defaults";
|
|
10
|
+
import { formatMDXBullet, formatMDXPermalink } from "../defaults.ts";
|
|
11
|
+
export { formatMDXPermalink } from "../defaults.ts";
|
|
12
12
|
export declare const __default: {
|
|
13
13
|
formatMDXBullet: typeof formatMDXBullet;
|
|
14
14
|
formatMDXPermalink: typeof formatMDXPermalink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/honkit/index.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;AAQjC,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/honkit/index.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;AAQjC,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,eAAO,MAAM,SAAS,EAAE;IACtB,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;CACL,CAAC;AAE5C,uFAAuF;AACvF,eAAO,MAAM,YAAY,EAAG,KAAc,CAAC;AAS3C;;;;;GAKG;AACH,eAAO,MAAM,cAAc,aAAc,KAAK,KAAG,SAKhD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAGF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,6BAG1B,iBAAiB,KAAG,SAEtB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,UACxB,KAAK,CAAC,kBAAkB,CAAC,aACrB,KAAK,CAAC,MAAM,EAAE,CAAC,KACzB,SAiBF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,kBAAmB,QAAQ,KAAG,QAoBvD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,SACxB,MAAM,eACC,KAAK,CAAC,MAAM,CAAC,KACzB,SAEF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,QAAS,MAAM,KAAG,SAEtD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAY5D,CAAC"}
|
package/dist/honkit/index.js
CHANGED
|
@@ -11,10 +11,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
11
11
|
exports.createMDXFormatter = exports.formatMDXSpecifiedByLink = exports.formatMDXNameEntity = exports.formatMDXLink = exports.formatMDXFrontmatter = exports.formatMDXDetails = exports.formatMDXAdmonition = exports.formatMDXBadge = exports.mdxExtension = exports.__default = exports.formatMDXPermalink = void 0;
|
|
12
12
|
const helpers_1 = require("@graphql-markdown/helpers");
|
|
13
13
|
const utils_1 = require("@graphql-markdown/utils");
|
|
14
|
-
const
|
|
15
|
-
var
|
|
16
|
-
Object.defineProperty(exports, "formatMDXPermalink", { enumerable: true, get: function () { return
|
|
17
|
-
exports.__default = { formatMDXBullet:
|
|
14
|
+
const defaults_ts_1 = require("../defaults.js");
|
|
15
|
+
var defaults_ts_2 = require("../defaults.js");
|
|
16
|
+
Object.defineProperty(exports, "formatMDXPermalink", { enumerable: true, get: function () { return defaults_ts_2.formatMDXPermalink; } });
|
|
17
|
+
exports.__default = { formatMDXBullet: defaults_ts_1.formatMDXBullet, formatMDXPermalink: defaults_ts_1.formatMDXPermalink };
|
|
18
18
|
/** File extension used for generated pages — HonKit renders plain Markdown to HTML. */
|
|
19
19
|
exports.mdxExtension = ".md";
|
|
20
20
|
/** Shared default badge theme used across this preset. */
|
|
@@ -126,12 +126,12 @@ const createMDXFormatter = (_meta) => {
|
|
|
126
126
|
return {
|
|
127
127
|
formatMDXBadge: exports.formatMDXBadge,
|
|
128
128
|
formatMDXAdmonition: exports.formatMDXAdmonition,
|
|
129
|
-
formatMDXBullet:
|
|
129
|
+
formatMDXBullet: defaults_ts_1.formatMDXBullet,
|
|
130
130
|
formatMDXDetails: exports.formatMDXDetails,
|
|
131
131
|
formatMDXFrontmatter: exports.formatMDXFrontmatter,
|
|
132
132
|
formatMDXLink: exports.formatMDXLink,
|
|
133
133
|
formatMDXNameEntity: exports.formatMDXNameEntity,
|
|
134
|
-
formatMDXPermalink:
|
|
134
|
+
formatMDXPermalink: defaults_ts_1.formatMDXPermalink,
|
|
135
135
|
formatMDXSpecifiedByLink: exports.formatMDXSpecifiedByLink,
|
|
136
136
|
};
|
|
137
137
|
};
|
package/dist/hugo/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export declare const formatMDXFrontmatter: (props: Maybe<FrontMatterOptions>, fo
|
|
|
45
45
|
* @returns Link object with the cleaned URL
|
|
46
46
|
*/
|
|
47
47
|
export declare const formatMDXLink: ({ text, url }: TypeLink) => TypeLink;
|
|
48
|
-
export { formatMDXBullet, formatMDXNameEntity, formatMDXPermalink, formatMDXSpecifiedByLink, } from "../defaults";
|
|
48
|
+
export { formatMDXBullet, formatMDXNameEntity, formatMDXPermalink, formatMDXSpecifiedByLink, } from "../defaults.ts";
|
|
49
49
|
/**
|
|
50
50
|
* Creates a Hugo formatter.
|
|
51
51
|
* @param _meta - Unused metadata parameter
|
package/dist/hugo/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hugo/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,yBAAyB,EACzB,KAAK,EAEL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAmCjC;;;;GAIG;AACH,eAAO,MAAM,cAAc,aAAc,KAAK,KAAG,SAEhD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAIF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,6BAG1B,iBAAiB,KAAG,SAEtB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,UACxB,KAAK,CAAC,kBAAkB,CAAC,aACrB,KAAK,CAAC,MAAM,EAAE,CAAC,KACzB,SAiBF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,kBAAmB,QAAQ,KAAG,QAKvD,CAAC;AAEF,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hugo/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,yBAAyB,EACzB,KAAK,EAEL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAmCjC;;;;GAIG;AACH,eAAO,MAAM,cAAc,aAAc,KAAK,KAAG,SAEhD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAIF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,6BAG1B,iBAAiB,KAAG,SAEtB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,UACxB,KAAK,CAAC,kBAAkB,CAAC,aACrB,KAAK,CAAC,MAAM,EAAE,CAAC,KACzB,SAiBF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,kBAAmB,QAAQ,KAAG,QAKvD,CAAC;AAEF,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAY5D,CAAC;AAEF,yFAAyF;AACzF,eAAO,MAAM,YAAY,EAAG,KAAc,CAAC;AAE3C;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,EAAE,yBAgB3C,CAAC"}
|
package/dist/hugo/index.js
CHANGED
|
@@ -13,8 +13,8 @@ exports.beforeGenerateIndexMetafileHook = exports.mdxExtension = exports.createM
|
|
|
13
13
|
const node_path_1 = require("node:path");
|
|
14
14
|
const helpers_1 = require("@graphql-markdown/helpers");
|
|
15
15
|
const utils_1 = require("@graphql-markdown/utils");
|
|
16
|
-
const
|
|
17
|
-
const
|
|
16
|
+
const defaults_ts_1 = require("../defaults.js");
|
|
17
|
+
const output_ts_1 = require("../output.js");
|
|
18
18
|
/**
|
|
19
19
|
* Maps graphql-markdown admonition types to Hugo GitHub-style alert types (Hugo 0.132+).
|
|
20
20
|
* @see https://gohugo.io/render-hooks/blockquotes/#alerts
|
|
@@ -97,11 +97,11 @@ const formatMDXLink = ({ text, url }) => {
|
|
|
97
97
|
};
|
|
98
98
|
};
|
|
99
99
|
exports.formatMDXLink = formatMDXLink;
|
|
100
|
-
var
|
|
101
|
-
Object.defineProperty(exports, "formatMDXBullet", { enumerable: true, get: function () { return
|
|
102
|
-
Object.defineProperty(exports, "formatMDXNameEntity", { enumerable: true, get: function () { return
|
|
103
|
-
Object.defineProperty(exports, "formatMDXPermalink", { enumerable: true, get: function () { return
|
|
104
|
-
Object.defineProperty(exports, "formatMDXSpecifiedByLink", { enumerable: true, get: function () { return
|
|
100
|
+
var defaults_ts_2 = require("../defaults.js");
|
|
101
|
+
Object.defineProperty(exports, "formatMDXBullet", { enumerable: true, get: function () { return defaults_ts_2.formatMDXBullet; } });
|
|
102
|
+
Object.defineProperty(exports, "formatMDXNameEntity", { enumerable: true, get: function () { return defaults_ts_2.formatMDXNameEntity; } });
|
|
103
|
+
Object.defineProperty(exports, "formatMDXPermalink", { enumerable: true, get: function () { return defaults_ts_2.formatMDXPermalink; } });
|
|
104
|
+
Object.defineProperty(exports, "formatMDXSpecifiedByLink", { enumerable: true, get: function () { return defaults_ts_2.formatMDXSpecifiedByLink; } });
|
|
105
105
|
/**
|
|
106
106
|
* Creates a Hugo formatter.
|
|
107
107
|
* @param _meta - Unused metadata parameter
|
|
@@ -111,13 +111,13 @@ const createMDXFormatter = (_meta) => {
|
|
|
111
111
|
return {
|
|
112
112
|
formatMDXBadge: exports.formatMDXBadge,
|
|
113
113
|
formatMDXAdmonition: exports.formatMDXAdmonition,
|
|
114
|
-
formatMDXBullet:
|
|
114
|
+
formatMDXBullet: defaults_ts_1.formatMDXBullet,
|
|
115
115
|
formatMDXDetails: exports.formatMDXDetails,
|
|
116
116
|
formatMDXFrontmatter: exports.formatMDXFrontmatter,
|
|
117
117
|
formatMDXLink: exports.formatMDXLink,
|
|
118
|
-
formatMDXNameEntity:
|
|
119
|
-
formatMDXPermalink:
|
|
120
|
-
formatMDXSpecifiedByLink:
|
|
118
|
+
formatMDXNameEntity: defaults_ts_1.formatMDXNameEntity,
|
|
119
|
+
formatMDXPermalink: defaults_ts_1.formatMDXPermalink,
|
|
120
|
+
formatMDXSpecifiedByLink: defaults_ts_1.formatMDXSpecifiedByLink,
|
|
121
121
|
};
|
|
122
122
|
};
|
|
123
123
|
exports.createMDXFormatter = createMDXFormatter;
|
|
@@ -136,6 +136,6 @@ const beforeGenerateIndexMetafileHook = async (event) => {
|
|
|
136
136
|
const filePath = (0, node_path_1.join)(dirPath, "_index.md");
|
|
137
137
|
const label = (0, utils_1.startCase)(category);
|
|
138
138
|
const content = `${utils_1.FRONT_MATTER_DELIMITER}${utils_1.MARKDOWN_EOL}title: "${label}"${utils_1.MARKDOWN_EOL}type: docs${utils_1.MARKDOWN_EOL}bookCollapseSection: true${utils_1.MARKDOWN_EOL}${utils_1.FRONT_MATTER_DELIMITER}${utils_1.MARKDOWN_EOL}${utils_1.MARKDOWN_EOL}# ${label}${utils_1.MARKDOWN_EOL}${utils_1.MARKDOWN_EOL}`;
|
|
139
|
-
await (0,
|
|
139
|
+
await (0, output_ts_1.writeOutput)(filePath, content, outputAdapter, dirPath);
|
|
140
140
|
};
|
|
141
141
|
exports.beforeGenerateIndexMetafileHook = beforeGenerateIndexMetafileHook;
|
package/dist/index.d.ts
CHANGED
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @packageDocumentation
|
|
16
16
|
*/
|
|
17
|
-
export * as docusaurus from "./docusaurus/index";
|
|
18
|
-
export * as docfx from "./docfx/index";
|
|
19
|
-
export * as fumadocs from "./fumadocs/index";
|
|
20
|
-
export * as honkit from "./honkit/index";
|
|
21
|
-
export * as hugo from "./hugo/index";
|
|
22
|
-
export * as mdbook from "./mdbook/index";
|
|
23
|
-
export * as mdx from "./mdx/index";
|
|
24
|
-
export * as mkdocs from "./mkdocs/index";
|
|
25
|
-
export * as starlight from "./starlight/index";
|
|
26
|
-
export * as vocs from "./vocs/index";
|
|
17
|
+
export * as docusaurus from "./docusaurus/index.ts";
|
|
18
|
+
export * as docfx from "./docfx/index.ts";
|
|
19
|
+
export * as fumadocs from "./fumadocs/index.ts";
|
|
20
|
+
export * as honkit from "./honkit/index.ts";
|
|
21
|
+
export * as hugo from "./hugo/index.ts";
|
|
22
|
+
export * as mdbook from "./mdbook/index.ts";
|
|
23
|
+
export * as mdx from "./mdx/index.ts";
|
|
24
|
+
export * as mkdocs from "./mkdocs/index.ts";
|
|
25
|
+
export * as starlight from "./starlight/index.ts";
|
|
26
|
+
export * as vocs from "./vocs/index.ts";
|
|
27
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -50,13 +50,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
50
50
|
})();
|
|
51
51
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
52
|
exports.vocs = exports.starlight = exports.mkdocs = exports.mdx = exports.mdbook = exports.hugo = exports.honkit = exports.fumadocs = exports.docfx = exports.docusaurus = void 0;
|
|
53
|
-
exports.docusaurus = __importStar(require("./docusaurus/index"));
|
|
54
|
-
exports.docfx = __importStar(require("./docfx/index"));
|
|
55
|
-
exports.fumadocs = __importStar(require("./fumadocs/index"));
|
|
56
|
-
exports.honkit = __importStar(require("./honkit/index"));
|
|
57
|
-
exports.hugo = __importStar(require("./hugo/index"));
|
|
58
|
-
exports.mdbook = __importStar(require("./mdbook/index"));
|
|
59
|
-
exports.mdx = __importStar(require("./mdx/index"));
|
|
60
|
-
exports.mkdocs = __importStar(require("./mkdocs/index"));
|
|
61
|
-
exports.starlight = __importStar(require("./starlight/index"));
|
|
62
|
-
exports.vocs = __importStar(require("./vocs/index"));
|
|
53
|
+
exports.docusaurus = __importStar(require("./docusaurus/index.js"));
|
|
54
|
+
exports.docfx = __importStar(require("./docfx/index.js"));
|
|
55
|
+
exports.fumadocs = __importStar(require("./fumadocs/index.js"));
|
|
56
|
+
exports.honkit = __importStar(require("./honkit/index.js"));
|
|
57
|
+
exports.hugo = __importStar(require("./hugo/index.js"));
|
|
58
|
+
exports.mdbook = __importStar(require("./mdbook/index.js"));
|
|
59
|
+
exports.mdx = __importStar(require("./mdx/index.js"));
|
|
60
|
+
exports.mkdocs = __importStar(require("./mkdocs/index.js"));
|
|
61
|
+
exports.starlight = __importStar(require("./starlight/index.js"));
|
|
62
|
+
exports.vocs = __importStar(require("./vocs/index.js"));
|
package/dist/mdbook/index.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export declare const mdxExtension = ".md";
|
|
|
51
51
|
* @returns The link with `.md` appended to extensionless absolute paths
|
|
52
52
|
*/
|
|
53
53
|
export declare const formatMDXLink: (link: TypeLink) => TypeLink;
|
|
54
|
-
export { formatMDXBullet, formatMDXNameEntity, formatMDXPermalink, formatMDXSpecifiedByLink, } from "../defaults";
|
|
54
|
+
export { formatMDXBullet, formatMDXNameEntity, formatMDXPermalink, formatMDXSpecifiedByLink, } from "../defaults.ts";
|
|
55
55
|
/**
|
|
56
56
|
* Rewrites absolute generated doc links to page-relative `.md` paths after each page is rendered.
|
|
57
57
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mdbook/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,KAAK,EAEL,SAAS,EACT,QAAQ,EACR,eAAe,EACf,sBAAsB,EACtB,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAuBjC;;;;GAIG;AACH,eAAO,MAAM,cAAc,aAAc,KAAK,KAAG,SAEhD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAIF,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,kBAE1B,iBAAiB,KAAG,SAEtB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,WACvB,KAAK,CAAC,kBAAkB,CAAC,aACtB,KAAK,CAAC,MAAM,EAAE,CAAC,KACzB,SAEF,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC;;;;GAIG;AACH,eAAO,MAAM,aAAa,SAAU,QAAQ,KAAG,QAU9C,CAAC;AAEF,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mdbook/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,KAAK,EAEL,SAAS,EACT,QAAQ,EACR,eAAe,EACf,sBAAsB,EACtB,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAuBjC;;;;GAIG;AACH,eAAO,MAAM,cAAc,aAAc,KAAK,KAAG,SAEhD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAIF,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,kBAE1B,iBAAiB,KAAG,SAEtB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,WACvB,KAAK,CAAC,kBAAkB,CAAC,aACtB,KAAK,CAAC,MAAM,EAAE,CAAC,KACzB,SAEF,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC;;;;GAIG;AACH,eAAO,MAAM,aAAa,SAAU,QAAQ,KAAG,QAU9C,CAAC;AAEF,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAIxB;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,EAAE,sBAIzC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAY5D,CAAC;AAeF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,eAkFlC,CAAC"}
|
package/dist/mdbook/index.js
CHANGED
|
@@ -14,8 +14,8 @@ exports.afterRenderFilesHook = exports.createMDXFormatter = exports.afterRenderT
|
|
|
14
14
|
const node_path_1 = require("node:path");
|
|
15
15
|
const helpers_1 = require("@graphql-markdown/helpers");
|
|
16
16
|
const utils_1 = require("@graphql-markdown/utils");
|
|
17
|
-
const
|
|
18
|
-
const
|
|
17
|
+
const defaults_ts_1 = require("../defaults.js");
|
|
18
|
+
const output_ts_1 = require("../output.js");
|
|
19
19
|
/**
|
|
20
20
|
* Formats a badge as Markdown bold text — mdBook has no badge component.
|
|
21
21
|
* @param badge - Badge data containing text
|
|
@@ -61,7 +61,7 @@ exports.formatMDXDetails = formatMDXDetails;
|
|
|
61
61
|
* @returns `# Title\n` when a title is available, otherwise an empty string
|
|
62
62
|
*/
|
|
63
63
|
const formatMDXFrontmatter = (_props, formatted) => {
|
|
64
|
-
return (0,
|
|
64
|
+
return (0, defaults_ts_1.formatMDXFrontmatterTitleOnly)(formatted, true);
|
|
65
65
|
};
|
|
66
66
|
exports.formatMDXFrontmatter = formatMDXFrontmatter;
|
|
67
67
|
/** mdBook expects `.md` files; override the default `.mdx` extension. */
|
|
@@ -82,12 +82,12 @@ const formatMDXLink = (link) => {
|
|
|
82
82
|
};
|
|
83
83
|
};
|
|
84
84
|
exports.formatMDXLink = formatMDXLink;
|
|
85
|
-
var
|
|
86
|
-
Object.defineProperty(exports, "formatMDXBullet", { enumerable: true, get: function () { return
|
|
87
|
-
Object.defineProperty(exports, "formatMDXNameEntity", { enumerable: true, get: function () { return
|
|
88
|
-
Object.defineProperty(exports, "formatMDXPermalink", { enumerable: true, get: function () { return
|
|
89
|
-
Object.defineProperty(exports, "formatMDXSpecifiedByLink", { enumerable: true, get: function () { return
|
|
90
|
-
const rewriteInternalLinks = (0,
|
|
85
|
+
var defaults_ts_2 = require("../defaults.js");
|
|
86
|
+
Object.defineProperty(exports, "formatMDXBullet", { enumerable: true, get: function () { return defaults_ts_2.formatMDXBullet; } });
|
|
87
|
+
Object.defineProperty(exports, "formatMDXNameEntity", { enumerable: true, get: function () { return defaults_ts_2.formatMDXNameEntity; } });
|
|
88
|
+
Object.defineProperty(exports, "formatMDXPermalink", { enumerable: true, get: function () { return defaults_ts_2.formatMDXPermalink; } });
|
|
89
|
+
Object.defineProperty(exports, "formatMDXSpecifiedByLink", { enumerable: true, get: function () { return defaults_ts_2.formatMDXSpecifiedByLink; } });
|
|
90
|
+
const rewriteInternalLinks = (0, output_ts_1.createInternalLinksRewriter)(exports.mdxExtension);
|
|
91
91
|
/**
|
|
92
92
|
* Rewrites absolute generated doc links to page-relative `.md` paths after each page is rendered.
|
|
93
93
|
*
|
|
@@ -99,7 +99,7 @@ const rewriteInternalLinks = (0, output_1.createInternalLinksRewriter)(exports.m
|
|
|
99
99
|
* work correctly regardless of where the book is hosted.
|
|
100
100
|
*/
|
|
101
101
|
const afterRenderTypeEntitiesHook = async (event) => {
|
|
102
|
-
await (0,
|
|
102
|
+
await (0, output_ts_1.rewriteRenderedPage)(event, rewriteInternalLinks);
|
|
103
103
|
};
|
|
104
104
|
exports.afterRenderTypeEntitiesHook = afterRenderTypeEntitiesHook;
|
|
105
105
|
/**
|
|
@@ -111,13 +111,13 @@ const createMDXFormatter = (_meta) => {
|
|
|
111
111
|
return {
|
|
112
112
|
formatMDXBadge: exports.formatMDXBadge,
|
|
113
113
|
formatMDXAdmonition: exports.formatMDXAdmonition,
|
|
114
|
-
formatMDXBullet:
|
|
114
|
+
formatMDXBullet: defaults_ts_1.formatMDXBullet,
|
|
115
115
|
formatMDXDetails: exports.formatMDXDetails,
|
|
116
116
|
formatMDXFrontmatter: exports.formatMDXFrontmatter,
|
|
117
117
|
formatMDXLink: exports.formatMDXLink,
|
|
118
|
-
formatMDXNameEntity:
|
|
119
|
-
formatMDXPermalink:
|
|
120
|
-
formatMDXSpecifiedByLink:
|
|
118
|
+
formatMDXNameEntity: defaults_ts_1.formatMDXNameEntity,
|
|
119
|
+
formatMDXPermalink: defaults_ts_1.formatMDXPermalink,
|
|
120
|
+
formatMDXSpecifiedByLink: defaults_ts_1.formatMDXSpecifiedByLink,
|
|
121
121
|
};
|
|
122
122
|
};
|
|
123
123
|
exports.createMDXFormatter = createMDXFormatter;
|
|
@@ -188,6 +188,6 @@ const afterRenderFilesHook = async (event) => {
|
|
|
188
188
|
}
|
|
189
189
|
lines.push("");
|
|
190
190
|
}
|
|
191
|
-
await (0,
|
|
191
|
+
await (0, output_ts_1.writeOutput)(summaryPath, lines.join("\n"), outputAdapter);
|
|
192
192
|
};
|
|
193
193
|
exports.afterRenderFilesHook = afterRenderFilesHook;
|
package/dist/mdx/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @packageDocumentation
|
|
10
10
|
*/
|
|
11
11
|
import type { AdmonitionType, CollapsibleOption, Formatter, Maybe, MDXString, MetaInfo, RenderTypeEntitiesHook, TypeLink } from "@graphql-markdown/types";
|
|
12
|
-
import { formatMDXBadge, formatMDXBullet, formatMDXEscapedPermalink, formatMDXFrontmatter, formatMDXNameEntity, formatMDXSpecifiedByLink } from "../defaults";
|
|
12
|
+
import { formatMDXBadge, formatMDXBullet, formatMDXEscapedPermalink, formatMDXFrontmatter, formatMDXNameEntity, formatMDXSpecifiedByLink } from "../defaults.ts";
|
|
13
13
|
/** Generic MDX pages use the `.mdx` extension. */
|
|
14
14
|
export declare const mdxExtension = ".mdx";
|
|
15
15
|
/**
|
package/dist/mdx/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mdx/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,KAAK,EACL,SAAS,EACT,QAAQ,EACR,sBAAsB,EACtB,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EACL,cAAc,EACd,eAAe,EACf,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mdx/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,KAAK,EACL,SAAS,EACT,QAAQ,EACR,sBAAsB,EACtB,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EACL,cAAc,EACd,eAAe,EACf,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,gBAAgB,CAAC;AAGxB,kDAAkD;AAClD,eAAO,MAAM,YAAY,SAAS,CAAC;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAGF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,6BAG1B,iBAAiB,KAAG,SAEtB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,SAAU,QAAQ,KAAG,QAU9C,CAAC;AAEF,OAAO,EACL,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,GACzB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAO,yBACb,CAAC;AAI5B;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,sBAIzC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAY5D,CAAC"}
|
package/dist/mdx/index.js
CHANGED
|
@@ -13,13 +13,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
exports.createMDXFormatter = exports.afterRenderTypeEntitiesHook = exports.formatMDXPermalink = exports.formatMDXSpecifiedByLink = exports.formatMDXNameEntity = exports.formatMDXFrontmatter = exports.formatMDXBullet = exports.formatMDXBadge = exports.formatMDXLink = exports.formatMDXDetails = exports.formatMDXAdmonition = exports.mdxExtension = void 0;
|
|
14
14
|
const helpers_1 = require("@graphql-markdown/helpers");
|
|
15
15
|
const utils_1 = require("@graphql-markdown/utils");
|
|
16
|
-
const
|
|
17
|
-
Object.defineProperty(exports, "formatMDXBadge", { enumerable: true, get: function () { return
|
|
18
|
-
Object.defineProperty(exports, "formatMDXBullet", { enumerable: true, get: function () { return
|
|
19
|
-
Object.defineProperty(exports, "formatMDXFrontmatter", { enumerable: true, get: function () { return
|
|
20
|
-
Object.defineProperty(exports, "formatMDXNameEntity", { enumerable: true, get: function () { return
|
|
21
|
-
Object.defineProperty(exports, "formatMDXSpecifiedByLink", { enumerable: true, get: function () { return
|
|
22
|
-
const
|
|
16
|
+
const defaults_ts_1 = require("../defaults.js");
|
|
17
|
+
Object.defineProperty(exports, "formatMDXBadge", { enumerable: true, get: function () { return defaults_ts_1.formatMDXBadge; } });
|
|
18
|
+
Object.defineProperty(exports, "formatMDXBullet", { enumerable: true, get: function () { return defaults_ts_1.formatMDXBullet; } });
|
|
19
|
+
Object.defineProperty(exports, "formatMDXFrontmatter", { enumerable: true, get: function () { return defaults_ts_1.formatMDXFrontmatter; } });
|
|
20
|
+
Object.defineProperty(exports, "formatMDXNameEntity", { enumerable: true, get: function () { return defaults_ts_1.formatMDXNameEntity; } });
|
|
21
|
+
Object.defineProperty(exports, "formatMDXSpecifiedByLink", { enumerable: true, get: function () { return defaults_ts_1.formatMDXSpecifiedByLink; } });
|
|
22
|
+
const output_ts_1 = require("../output.js");
|
|
23
23
|
/** Generic MDX pages use the `.mdx` extension. */
|
|
24
24
|
exports.mdxExtension = ".mdx";
|
|
25
25
|
/**
|
|
@@ -64,13 +64,13 @@ exports.formatMDXLink = formatMDXLink;
|
|
|
64
64
|
* @param id - The ID of the section header
|
|
65
65
|
* @returns Escaped permalink string
|
|
66
66
|
*/
|
|
67
|
-
exports.formatMDXPermalink =
|
|
68
|
-
const rewriteInternalLinks = (0,
|
|
67
|
+
exports.formatMDXPermalink = defaults_ts_1.formatMDXEscapedPermalink;
|
|
68
|
+
const rewriteInternalLinks = (0, output_ts_1.createInternalLinksRewriter)(exports.mdxExtension);
|
|
69
69
|
/**
|
|
70
70
|
* Rewrites absolute generated doc links to page-relative `.mdx` paths after each page is rendered.
|
|
71
71
|
*/
|
|
72
72
|
const afterRenderTypeEntitiesHook = async (event) => {
|
|
73
|
-
await (0,
|
|
73
|
+
await (0, output_ts_1.rewriteRenderedPage)(event, rewriteInternalLinks);
|
|
74
74
|
};
|
|
75
75
|
exports.afterRenderTypeEntitiesHook = afterRenderTypeEntitiesHook;
|
|
76
76
|
/**
|
|
@@ -80,15 +80,15 @@ exports.afterRenderTypeEntitiesHook = afterRenderTypeEntitiesHook;
|
|
|
80
80
|
*/
|
|
81
81
|
const createMDXFormatter = (_meta) => {
|
|
82
82
|
return {
|
|
83
|
-
formatMDXBadge:
|
|
83
|
+
formatMDXBadge: defaults_ts_1.formatMDXBadge,
|
|
84
84
|
formatMDXAdmonition: exports.formatMDXAdmonition,
|
|
85
|
-
formatMDXBullet:
|
|
85
|
+
formatMDXBullet: defaults_ts_1.formatMDXBullet,
|
|
86
86
|
formatMDXDetails: exports.formatMDXDetails,
|
|
87
|
-
formatMDXFrontmatter:
|
|
87
|
+
formatMDXFrontmatter: defaults_ts_1.formatMDXFrontmatter,
|
|
88
88
|
formatMDXLink: exports.formatMDXLink,
|
|
89
|
-
formatMDXNameEntity:
|
|
89
|
+
formatMDXNameEntity: defaults_ts_1.formatMDXNameEntity,
|
|
90
90
|
formatMDXPermalink: exports.formatMDXPermalink,
|
|
91
|
-
formatMDXSpecifiedByLink:
|
|
91
|
+
formatMDXSpecifiedByLink: defaults_ts_1.formatMDXSpecifiedByLink,
|
|
92
92
|
};
|
|
93
93
|
};
|
|
94
94
|
exports.createMDXFormatter = createMDXFormatter;
|
package/dist/mkdocs/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
import type { AdmonitionType, Badge, CollapsibleOption, Formatter, FrontMatterOptions, Maybe, MDXString, MetaInfo, RenderTypeEntitiesHook } from "@graphql-markdown/types";
|
|
10
|
-
import { formatMDXBullet, formatMDXLink, formatMDXPermalink } from "../defaults";
|
|
10
|
+
import { formatMDXBullet, formatMDXLink, formatMDXPermalink } from "../defaults.ts";
|
|
11
11
|
export declare const __default: {
|
|
12
12
|
formatMDXBullet: typeof formatMDXBullet;
|
|
13
13
|
formatMDXLink: typeof formatMDXLink;
|
|
@@ -61,7 +61,7 @@ export declare const mdxExtension: ".md";
|
|
|
61
61
|
* @param event - Hook payload containing the current file path and renderer output context
|
|
62
62
|
*/
|
|
63
63
|
export declare const afterRenderTypeEntitiesHook: RenderTypeEntitiesHook;
|
|
64
|
-
export { formatMDXBullet, formatMDXPermalink } from "../defaults";
|
|
64
|
+
export { formatMDXBullet, formatMDXPermalink } from "../defaults.ts";
|
|
65
65
|
/**
|
|
66
66
|
* Creates an MkDocs Material formatter.
|
|
67
67
|
* @param _meta - Unused metadata parameter
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mkdocs/index.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,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,eAAe,EAEf,aAAa,EACb,kBAAkB,EACnB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mkdocs/index.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,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,eAAe,EAEf,aAAa,EACb,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AAGxB,eAAO,MAAM,SAAS,EAAE;IACtB,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;CAK/C,CAAC;AAeF;;;;GAIG;AACH,eAAO,MAAM,cAAc,aAAc,KAAK,KAAG,SAEhD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAIF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,6BAG1B,iBAAiB,KAAG,SAEtB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,WACvB,KAAK,CAAC,kBAAkB,CAAC,aACtB,KAAK,CAAC,MAAM,EAAE,CAAC,KACzB,SAEF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,SACxB,MAAM,eACC,KAAK,CAAC,MAAM,CAAC,KACzB,SAGF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,QAAS,MAAM,KAAG,SAEtD,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,YAAY,EAAG,KAAc,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,EAAE,sBAIzC,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAErE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAY5D,CAAC"}
|
package/dist/mkdocs/index.js
CHANGED
|
@@ -11,12 +11,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
11
11
|
exports.createMDXFormatter = exports.formatMDXPermalink = exports.formatMDXBullet = exports.afterRenderTypeEntitiesHook = exports.mdxExtension = exports.formatMDXSpecifiedByLink = exports.formatMDXNameEntity = exports.formatMDXFrontmatter = exports.formatMDXDetails = exports.formatMDXAdmonition = exports.formatMDXBadge = exports.__default = void 0;
|
|
12
12
|
const helpers_1 = require("@graphql-markdown/helpers");
|
|
13
13
|
const utils_1 = require("@graphql-markdown/utils");
|
|
14
|
-
const
|
|
15
|
-
const
|
|
14
|
+
const defaults_ts_1 = require("../defaults.js");
|
|
15
|
+
const output_ts_1 = require("../output.js");
|
|
16
16
|
exports.__default = {
|
|
17
|
-
formatMDXBullet:
|
|
18
|
-
formatMDXLink:
|
|
19
|
-
formatMDXPermalink:
|
|
17
|
+
formatMDXBullet: defaults_ts_1.formatMDXBullet,
|
|
18
|
+
formatMDXLink: defaults_ts_1.formatMDXLink,
|
|
19
|
+
formatMDXPermalink: defaults_ts_1.formatMDXPermalink,
|
|
20
20
|
};
|
|
21
21
|
const ADMONITION_TYPE_MAP = {
|
|
22
22
|
note: "note",
|
|
@@ -28,7 +28,7 @@ const ADMONITION_TYPE_MAP = {
|
|
|
28
28
|
caution: "warning",
|
|
29
29
|
success: "success",
|
|
30
30
|
};
|
|
31
|
-
const rewriteInternalLinks = (0,
|
|
31
|
+
const rewriteInternalLinks = (0, output_ts_1.createInternalLinksRewriter)();
|
|
32
32
|
/**
|
|
33
33
|
* Formats a badge as an inline HTML mark element.
|
|
34
34
|
* @param badge - Badge data containing text and optional classname
|
|
@@ -67,7 +67,7 @@ exports.formatMDXDetails = formatMDXDetails;
|
|
|
67
67
|
* @returns Visible heading string, or empty string if no title is available
|
|
68
68
|
*/
|
|
69
69
|
const formatMDXFrontmatter = (_props, formatted) => {
|
|
70
|
-
return (0,
|
|
70
|
+
return (0, defaults_ts_1.formatMDXFrontmatterTitleOnly)(formatted);
|
|
71
71
|
};
|
|
72
72
|
exports.formatMDXFrontmatter = formatMDXFrontmatter;
|
|
73
73
|
/**
|
|
@@ -98,12 +98,12 @@ exports.mdxExtension = ".md";
|
|
|
98
98
|
* @param event - Hook payload containing the current file path and renderer output context
|
|
99
99
|
*/
|
|
100
100
|
const afterRenderTypeEntitiesHook = async (event) => {
|
|
101
|
-
await (0,
|
|
101
|
+
await (0, output_ts_1.rewriteRenderedPage)(event, rewriteInternalLinks);
|
|
102
102
|
};
|
|
103
103
|
exports.afterRenderTypeEntitiesHook = afterRenderTypeEntitiesHook;
|
|
104
|
-
var
|
|
105
|
-
Object.defineProperty(exports, "formatMDXBullet", { enumerable: true, get: function () { return
|
|
106
|
-
Object.defineProperty(exports, "formatMDXPermalink", { enumerable: true, get: function () { return
|
|
104
|
+
var defaults_ts_2 = require("../defaults.js");
|
|
105
|
+
Object.defineProperty(exports, "formatMDXBullet", { enumerable: true, get: function () { return defaults_ts_2.formatMDXBullet; } });
|
|
106
|
+
Object.defineProperty(exports, "formatMDXPermalink", { enumerable: true, get: function () { return defaults_ts_2.formatMDXPermalink; } });
|
|
107
107
|
/**
|
|
108
108
|
* Creates an MkDocs Material formatter.
|
|
109
109
|
* @param _meta - Unused metadata parameter
|
|
@@ -113,12 +113,12 @@ const createMDXFormatter = (_meta) => {
|
|
|
113
113
|
return {
|
|
114
114
|
formatMDXBadge: exports.formatMDXBadge,
|
|
115
115
|
formatMDXAdmonition: exports.formatMDXAdmonition,
|
|
116
|
-
formatMDXBullet:
|
|
116
|
+
formatMDXBullet: defaults_ts_1.formatMDXBullet,
|
|
117
117
|
formatMDXDetails: exports.formatMDXDetails,
|
|
118
118
|
formatMDXFrontmatter: exports.formatMDXFrontmatter,
|
|
119
|
-
formatMDXLink:
|
|
119
|
+
formatMDXLink: defaults_ts_1.formatMDXLink,
|
|
120
120
|
formatMDXNameEntity: exports.formatMDXNameEntity,
|
|
121
|
-
formatMDXPermalink:
|
|
121
|
+
formatMDXPermalink: defaults_ts_1.formatMDXPermalink,
|
|
122
122
|
formatMDXSpecifiedByLink: exports.formatMDXSpecifiedByLink,
|
|
123
123
|
};
|
|
124
124
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
10
|
import type { AdmonitionType, Badge, Formatter, Maybe, MDXString, MetaInfo, TypeLink } from "@graphql-markdown/types";
|
|
11
|
-
import { formatMDXEscapedPermalink } from "../defaults";
|
|
11
|
+
import { formatMDXEscapedPermalink } from "../defaults.ts";
|
|
12
12
|
/**
|
|
13
13
|
* Formats a permalink for a section header, using the classic `{#id}` syntax
|
|
14
14
|
* escaped to remain valid MDX.
|
|
@@ -47,7 +47,7 @@ export declare const formatMDXAdmonition: ({ text, title, type }: AdmonitionType
|
|
|
47
47
|
* @returns Unmodified link
|
|
48
48
|
*/
|
|
49
49
|
export declare const formatMDXLink: (link: TypeLink) => TypeLink;
|
|
50
|
-
export { formatMDXBullet, formatMDXDetails, formatMDXFrontmatter, formatMDXNameEntity, formatMDXSpecifiedByLink, } from "../defaults";
|
|
50
|
+
export { formatMDXBullet, formatMDXDetails, formatMDXFrontmatter, formatMDXNameEntity, formatMDXSpecifiedByLink, } from "../defaults.ts";
|
|
51
51
|
/**
|
|
52
52
|
* Creates an Astro Starlight formatter.
|
|
53
53
|
* @param _meta - Unused metadata parameter
|
|
@@ -1 +1 @@
|
|
|
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;AAEjC,OAAO,EAIL,yBAAyB,EAG1B,MAAM,
|
|
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;AAEjC,OAAO,EAIL,yBAAyB,EAG1B,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAO,yBACb,CAAC;AAE5B,+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,gBAAgB,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAY5D,CAAC"}
|
package/dist/starlight/index.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.createMDXFormatter = exports.formatMDXSpecifiedByLink = exports.formatMDXNameEntity = exports.formatMDXFrontmatter = exports.formatMDXDetails = exports.formatMDXBullet = exports.formatMDXLink = exports.formatMDXAdmonition = exports.formatMDXBadge = exports.mdxDeclaration = exports.mdxExtension = exports.formatMDXPermalink = void 0;
|
|
13
13
|
const utils_1 = require("@graphql-markdown/utils");
|
|
14
|
-
const
|
|
14
|
+
const defaults_ts_1 = require("../defaults.js");
|
|
15
15
|
/**
|
|
16
16
|
* Formats a permalink for a section header, using the classic `{#id}` syntax
|
|
17
17
|
* escaped to remain valid MDX.
|
|
@@ -23,7 +23,7 @@ const defaults_1 = require("../defaults");
|
|
|
23
23
|
* @param id - The ID of the section header
|
|
24
24
|
* @returns Formatted permalink string
|
|
25
25
|
*/
|
|
26
|
-
exports.formatMDXPermalink =
|
|
26
|
+
exports.formatMDXPermalink = defaults_ts_1.formatMDXEscapedPermalink;
|
|
27
27
|
/** File extension used for generated pages. */
|
|
28
28
|
exports.mdxExtension = ".mdx";
|
|
29
29
|
/** MDX import statement prepended to every generated file to register Starlight components. */
|
|
@@ -63,12 +63,12 @@ const formatMDXLink = (link) => {
|
|
|
63
63
|
return link;
|
|
64
64
|
};
|
|
65
65
|
exports.formatMDXLink = formatMDXLink;
|
|
66
|
-
var
|
|
67
|
-
Object.defineProperty(exports, "formatMDXBullet", { enumerable: true, get: function () { return
|
|
68
|
-
Object.defineProperty(exports, "formatMDXDetails", { enumerable: true, get: function () { return
|
|
69
|
-
Object.defineProperty(exports, "formatMDXFrontmatter", { enumerable: true, get: function () { return
|
|
70
|
-
Object.defineProperty(exports, "formatMDXNameEntity", { enumerable: true, get: function () { return
|
|
71
|
-
Object.defineProperty(exports, "formatMDXSpecifiedByLink", { enumerable: true, get: function () { return
|
|
66
|
+
var defaults_ts_2 = require("../defaults.js");
|
|
67
|
+
Object.defineProperty(exports, "formatMDXBullet", { enumerable: true, get: function () { return defaults_ts_2.formatMDXBullet; } });
|
|
68
|
+
Object.defineProperty(exports, "formatMDXDetails", { enumerable: true, get: function () { return defaults_ts_2.formatMDXDetails; } });
|
|
69
|
+
Object.defineProperty(exports, "formatMDXFrontmatter", { enumerable: true, get: function () { return defaults_ts_2.formatMDXFrontmatter; } });
|
|
70
|
+
Object.defineProperty(exports, "formatMDXNameEntity", { enumerable: true, get: function () { return defaults_ts_2.formatMDXNameEntity; } });
|
|
71
|
+
Object.defineProperty(exports, "formatMDXSpecifiedByLink", { enumerable: true, get: function () { return defaults_ts_2.formatMDXSpecifiedByLink; } });
|
|
72
72
|
/**
|
|
73
73
|
* Creates an Astro Starlight formatter.
|
|
74
74
|
* @param _meta - Unused metadata parameter
|
|
@@ -78,13 +78,13 @@ const createMDXFormatter = (_meta) => {
|
|
|
78
78
|
return {
|
|
79
79
|
formatMDXBadge: exports.formatMDXBadge,
|
|
80
80
|
formatMDXAdmonition: exports.formatMDXAdmonition,
|
|
81
|
-
formatMDXBullet:
|
|
82
|
-
formatMDXDetails:
|
|
83
|
-
formatMDXFrontmatter:
|
|
81
|
+
formatMDXBullet: defaults_ts_1.formatMDXBullet,
|
|
82
|
+
formatMDXDetails: defaults_ts_1.formatMDXDetails,
|
|
83
|
+
formatMDXFrontmatter: defaults_ts_1.formatMDXFrontmatter,
|
|
84
84
|
formatMDXLink: exports.formatMDXLink,
|
|
85
|
-
formatMDXNameEntity:
|
|
85
|
+
formatMDXNameEntity: defaults_ts_1.formatMDXNameEntity,
|
|
86
86
|
formatMDXPermalink: exports.formatMDXPermalink,
|
|
87
|
-
formatMDXSpecifiedByLink:
|
|
87
|
+
formatMDXSpecifiedByLink: defaults_ts_1.formatMDXSpecifiedByLink,
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
exports.createMDXFormatter = createMDXFormatter;
|
package/dist/vocs/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @packageDocumentation
|
|
7
7
|
*/
|
|
8
|
-
import type { AdmonitionType, Badge, Formatter, Maybe, MDXString, MetaInfo, TypeLink } from "@graphql-markdown/types";
|
|
9
|
-
import { formatMDXEscapedPermalink } from "../defaults";
|
|
8
|
+
import type { AdmonitionType, Badge, Formatter, FrontMatterOptions, Maybe, MDXString, MetaInfo, TypeLink } from "@graphql-markdown/types";
|
|
9
|
+
import { formatMDXEscapedPermalink } from "../defaults.ts";
|
|
10
10
|
/**
|
|
11
11
|
* Formats a permalink for a section header, using the classic `{#id}` syntax
|
|
12
12
|
* escaped to remain valid MDX.
|
|
@@ -25,6 +25,20 @@ export declare const formatMDXPermalink: typeof formatMDXEscapedPermalink;
|
|
|
25
25
|
export declare const mdxDeclaration: MDXString;
|
|
26
26
|
/** File extension used for generated pages. */
|
|
27
27
|
export declare const mdxExtension: ".mdx";
|
|
28
|
+
/**
|
|
29
|
+
* Formats YAML front matter followed by a visible `# Title` heading.
|
|
30
|
+
*
|
|
31
|
+
* Vocs only uses the front matter `title` for the document `<title>`; the
|
|
32
|
+
* page heading must be written in Markdown, so without it generated pages
|
|
33
|
+
* have no visible title.
|
|
34
|
+
*
|
|
35
|
+
* @see https://vocs.dev/docs/markdown
|
|
36
|
+
*
|
|
37
|
+
* @param props - Front matter options
|
|
38
|
+
* @param formatted - Pre-formatted front matter lines
|
|
39
|
+
* @returns Front matter block and title heading, or empty string if no lines provided
|
|
40
|
+
*/
|
|
41
|
+
export declare const formatMDXFrontmatter: (props: Maybe<FrontMatterOptions>, formatted: Maybe<string[]>) => MDXString;
|
|
28
42
|
/**
|
|
29
43
|
* Formats a badge using Vocs native text directive (`:badge[...]`).
|
|
30
44
|
* Maps `DEPRECATED` classname to `warning` color; all others use default.
|
|
@@ -59,7 +73,7 @@ export declare const formatMDXLink: ({ text, url }: TypeLink) => TypeLink;
|
|
|
59
73
|
* @returns Formatted JSX entity reference string
|
|
60
74
|
*/
|
|
61
75
|
export declare const formatMDXNameEntity: (name: string, parentType?: Maybe<string>) => MDXString;
|
|
62
|
-
export { formatMDXDetails,
|
|
76
|
+
export { formatMDXDetails, formatMDXSpecifiedByLink } from "../defaults.ts";
|
|
63
77
|
/**
|
|
64
78
|
* Creates a Vocs formatter.
|
|
65
79
|
* @param _meta - Unused metadata parameter
|
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;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,SAAS,EACT,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAEL,yBAAyB,
|
|
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,kBAAkB,EAClB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAEL,yBAAyB,EAI1B,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAO,yBACb,CAAC;AAE5B,+FAA+F;AAC/F,eAAO,MAAM,cAAc,EAAE,SAEf,CAAC;AAEf,+CAA+C;AAC/C,eAAO,MAAM,YAAY,EAAG,MAAe,CAAC;AAE5C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,oBAAoB,UACxB,KAAK,CAAC,kBAAkB,CAAC,aACrB,KAAK,CAAC,MAAM,EAAE,CAAC,KACzB,SAOF,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;;;;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,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE5E;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAY5D,CAAC"}
|
package/dist/vocs/index.js
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.createMDXFormatter = exports.formatMDXSpecifiedByLink = exports.
|
|
10
|
+
exports.createMDXFormatter = exports.formatMDXSpecifiedByLink = exports.formatMDXDetails = exports.formatMDXNameEntity = exports.formatMDXLink = exports.formatMDXBullet = exports.formatMDXAdmonition = exports.formatMDXBadge = exports.formatMDXFrontmatter = exports.mdxExtension = exports.mdxDeclaration = exports.formatMDXPermalink = void 0;
|
|
11
11
|
const helpers_1 = require("@graphql-markdown/helpers");
|
|
12
12
|
const utils_1 = require("@graphql-markdown/utils");
|
|
13
|
-
const
|
|
13
|
+
const defaults_ts_1 = require("../defaults.js");
|
|
14
14
|
/**
|
|
15
15
|
* Formats a permalink for a section header, using the classic `{#id}` syntax
|
|
16
16
|
* escaped to remain valid MDX.
|
|
@@ -24,13 +24,35 @@ const defaults_1 = require("../defaults");
|
|
|
24
24
|
* @param id - The ID of the section header
|
|
25
25
|
* @returns Formatted permalink string
|
|
26
26
|
*/
|
|
27
|
-
exports.formatMDXPermalink =
|
|
27
|
+
exports.formatMDXPermalink = defaults_ts_1.formatMDXEscapedPermalink;
|
|
28
28
|
/** MDX import statement and inline component definitions prepended to every generated file. */
|
|
29
29
|
exports.mdxDeclaration = `
|
|
30
30
|
export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em' }}> ● </span></>
|
|
31
31
|
`;
|
|
32
32
|
/** File extension used for generated pages. */
|
|
33
33
|
exports.mdxExtension = ".mdx";
|
|
34
|
+
/**
|
|
35
|
+
* Formats YAML front matter followed by a visible `# Title` heading.
|
|
36
|
+
*
|
|
37
|
+
* Vocs only uses the front matter `title` for the document `<title>`; the
|
|
38
|
+
* page heading must be written in Markdown, so without it generated pages
|
|
39
|
+
* have no visible title.
|
|
40
|
+
*
|
|
41
|
+
* @see https://vocs.dev/docs/markdown
|
|
42
|
+
*
|
|
43
|
+
* @param props - Front matter options
|
|
44
|
+
* @param formatted - Pre-formatted front matter lines
|
|
45
|
+
* @returns Front matter block and title heading, or empty string if no lines provided
|
|
46
|
+
*/
|
|
47
|
+
const formatMDXFrontmatter = (props, formatted) => {
|
|
48
|
+
const frontMatter = (0, defaults_ts_1.formatMDXFrontmatter)(props, formatted);
|
|
49
|
+
const heading = (0, defaults_ts_1.formatMDXFrontmatterTitleOnly)(formatted);
|
|
50
|
+
if (!frontMatter || !heading) {
|
|
51
|
+
return frontMatter;
|
|
52
|
+
}
|
|
53
|
+
return `${frontMatter}${utils_1.MARKDOWN_EOP}${heading}`;
|
|
54
|
+
};
|
|
55
|
+
exports.formatMDXFrontmatter = formatMDXFrontmatter;
|
|
34
56
|
/**
|
|
35
57
|
* Formats a badge using Vocs native text directive (`:badge[...]`).
|
|
36
58
|
* Maps `DEPRECATED` classname to `warning` color; all others use default.
|
|
@@ -88,10 +110,9 @@ const formatMDXNameEntity = (name, parentType) => {
|
|
|
88
110
|
return `<span className="gqlmd-mdx-entity"><code className="gqlmd-mdx-entity-name">${name}</code></span>`;
|
|
89
111
|
};
|
|
90
112
|
exports.formatMDXNameEntity = formatMDXNameEntity;
|
|
91
|
-
var
|
|
92
|
-
Object.defineProperty(exports, "formatMDXDetails", { enumerable: true, get: function () { return
|
|
93
|
-
Object.defineProperty(exports, "
|
|
94
|
-
Object.defineProperty(exports, "formatMDXSpecifiedByLink", { enumerable: true, get: function () { return defaults_2.formatMDXSpecifiedByLink; } });
|
|
113
|
+
var defaults_ts_2 = require("../defaults.js");
|
|
114
|
+
Object.defineProperty(exports, "formatMDXDetails", { enumerable: true, get: function () { return defaults_ts_2.formatMDXDetails; } });
|
|
115
|
+
Object.defineProperty(exports, "formatMDXSpecifiedByLink", { enumerable: true, get: function () { return defaults_ts_2.formatMDXSpecifiedByLink; } });
|
|
95
116
|
/**
|
|
96
117
|
* Creates a Vocs formatter.
|
|
97
118
|
* @param _meta - Unused metadata parameter
|
|
@@ -102,12 +123,12 @@ const createMDXFormatter = (_meta) => {
|
|
|
102
123
|
formatMDXBadge: exports.formatMDXBadge,
|
|
103
124
|
formatMDXAdmonition: exports.formatMDXAdmonition,
|
|
104
125
|
formatMDXBullet: exports.formatMDXBullet,
|
|
105
|
-
formatMDXDetails:
|
|
106
|
-
formatMDXFrontmatter:
|
|
126
|
+
formatMDXDetails: defaults_ts_1.formatMDXDetails,
|
|
127
|
+
formatMDXFrontmatter: exports.formatMDXFrontmatter,
|
|
107
128
|
formatMDXLink: exports.formatMDXLink,
|
|
108
129
|
formatMDXNameEntity: exports.formatMDXNameEntity,
|
|
109
130
|
formatMDXPermalink: exports.formatMDXPermalink,
|
|
110
|
-
formatMDXSpecifiedByLink:
|
|
131
|
+
formatMDXSpecifiedByLink: defaults_ts_1.formatMDXSpecifiedByLink,
|
|
111
132
|
};
|
|
112
133
|
};
|
|
113
134
|
exports.createMDXFormatter = createMDXFormatter;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-markdown/formatters",
|
|
3
3
|
"homepage": "https://graphql-markdown.dev",
|
|
4
|
-
"description": "Formatter presets for Docusaurus, Starlight, Fumadocs, Vocs, HonKit, Hugo, MkDocs, DocFX, mdBook
|
|
4
|
+
"description": "Formatter presets for GraphQL-Markdown: Docusaurus, Starlight, Fumadocs, Vocs, HonKit, Hugo, MkDocs, DocFX, mdBook and generic MDX.",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/graphql-markdown/graphql-markdown/issues"
|
|
7
7
|
},
|
|
8
|
-
"version": "1.2.
|
|
8
|
+
"version": "1.2.2",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -211,8 +211,8 @@
|
|
|
211
211
|
"build": "tsgo --build",
|
|
212
212
|
"lint": "eslint --config ../../packages/tooling-config/eslint/config.ts \"{src,tests}/**/*.{ts,js,json,gql}\"",
|
|
213
213
|
"lint:fix": "eslint --config ../../packages/tooling-config/eslint/config.ts \"{src,tests}/**/*.{ts,js,json,gql}\" --fix",
|
|
214
|
-
"prettier": "prettier \"{src,tests}/**/*.{ts,js,json,md,gql}\" --check",
|
|
215
|
-
"prettier:fix": "prettier \"{src,tests}/**/*.{ts,js,json,md,gql}\" --write",
|
|
214
|
+
"prettier": "prettier \"{src,tests}/**/*.{ts,js,json,md,gql}\" README.md --check",
|
|
215
|
+
"prettier:fix": "prettier \"{src,tests}/**/*.{ts,js,json,md,gql}\" README.md --write",
|
|
216
216
|
"ts:check": "tsgo --noEmit",
|
|
217
217
|
"test": "vitest run --passWithNoTests",
|
|
218
218
|
"test:unit": "vitest run --passWithNoTests tests/unit",
|
|
@@ -221,9 +221,9 @@
|
|
|
221
221
|
"test:watch": "vitest --watch"
|
|
222
222
|
},
|
|
223
223
|
"dependencies": {
|
|
224
|
-
"@graphql-markdown/helpers": "^1.2.
|
|
225
|
-
"@graphql-markdown/types": "^1.17.
|
|
226
|
-
"@graphql-markdown/utils": "^1.14.
|
|
224
|
+
"@graphql-markdown/helpers": "^1.2.5",
|
|
225
|
+
"@graphql-markdown/types": "^1.17.1",
|
|
226
|
+
"@graphql-markdown/utils": "^1.14.2"
|
|
227
227
|
},
|
|
228
228
|
"devDependencies": {
|
|
229
229
|
"@graphql-markdown/tooling-config": "^1.0.0"
|
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
"test": "tests"
|
|
233
233
|
},
|
|
234
234
|
"engines": {
|
|
235
|
-
"node": ">=22.
|
|
235
|
+
"node": ">=22.18.0"
|
|
236
236
|
},
|
|
237
237
|
"publishConfig": {
|
|
238
238
|
"access": "public"
|