@mintlify/scraping 4.0.907 → 4.0.909
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/__test__/sdk-docfx.test.ts +204 -0
- package/__test__/sdk-javadoc.test.ts +150 -0
- package/__test__/sdk-phpdoc.test.ts +134 -0
- package/__test__/sdk-sphinx.test.ts +84 -0
- package/__test__/sdk-typedoc.test.ts +138 -0
- package/bin/index.d.ts +3 -0
- package/bin/index.js +2 -0
- package/bin/index.js.map +1 -1
- package/bin/sdk/convert.d.ts +6 -0
- package/bin/sdk/convert.js +90 -0
- package/bin/sdk/convert.js.map +1 -0
- package/bin/sdk/converters/docfx.d.ts +2 -0
- package/bin/sdk/converters/docfx.js +402 -0
- package/bin/sdk/converters/docfx.js.map +1 -0
- package/bin/sdk/converters/javadoc.d.ts +2 -0
- package/bin/sdk/converters/javadoc.js +318 -0
- package/bin/sdk/converters/javadoc.js.map +1 -0
- package/bin/sdk/converters/phpdoc.d.ts +2 -0
- package/bin/sdk/converters/phpdoc.js +351 -0
- package/bin/sdk/converters/phpdoc.js.map +1 -0
- package/bin/sdk/converters/sphinx.d.ts +2 -0
- package/bin/sdk/converters/sphinx.js +267 -0
- package/bin/sdk/converters/sphinx.js.map +1 -0
- package/bin/sdk/converters/typedoc.d.ts +2 -0
- package/bin/sdk/converters/typedoc.js +318 -0
- package/bin/sdk/converters/typedoc.js.map +1 -0
- package/bin/sdk/generateSdkReference.d.ts +2 -0
- package/bin/sdk/generateSdkReference.js +20 -0
- package/bin/sdk/generateSdkReference.js.map +1 -0
- package/bin/sdk/types.d.ts +19 -0
- package/bin/sdk/types.js +2 -0
- package/bin/sdk/types.js.map +1 -0
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +5 -4
- package/src/index.ts +3 -0
- package/src/sdk/convert.ts +101 -0
- package/src/sdk/converters/docfx.ts +491 -0
- package/src/sdk/converters/javadoc.ts +330 -0
- package/src/sdk/converters/phpdoc.ts +446 -0
- package/src/sdk/converters/sphinx.ts +277 -0
- package/src/sdk/converters/typedoc.ts +423 -0
- package/src/sdk/generateSdkReference.ts +25 -0
- package/src/sdk/types.ts +24 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { convertDocfx } from './converters/docfx.js';
|
|
2
|
+
import { convertJavadoc } from './converters/javadoc.js';
|
|
3
|
+
import { convertPhpdoc } from './converters/phpdoc.js';
|
|
4
|
+
import { convertSphinx } from './converters/sphinx.js';
|
|
5
|
+
import { convertTypedoc } from './converters/typedoc.js';
|
|
6
|
+
import type { SdkConverter, SdkFormat, SdkReference } from './types.js';
|
|
7
|
+
|
|
8
|
+
const converters: Record<SdkFormat, SdkConverter> = {
|
|
9
|
+
typedoc: convertTypedoc,
|
|
10
|
+
docfx: convertDocfx,
|
|
11
|
+
javadoc: convertJavadoc,
|
|
12
|
+
sphinx: convertSphinx,
|
|
13
|
+
phpdoc: convertPhpdoc,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export async function generateSdkReference(
|
|
17
|
+
format: SdkFormat,
|
|
18
|
+
sourcePath: string
|
|
19
|
+
): Promise<SdkReference> {
|
|
20
|
+
const converter = converters[format];
|
|
21
|
+
if (!converter) {
|
|
22
|
+
throw new Error(`Unsupported SDK documentation format: ${format}`);
|
|
23
|
+
}
|
|
24
|
+
return converter(sourcePath);
|
|
25
|
+
}
|
package/src/sdk/types.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SdkFormat } from '@mintlify/validation';
|
|
2
|
+
|
|
3
|
+
export type { SdkFormat };
|
|
4
|
+
|
|
5
|
+
export type SdkPage = {
|
|
6
|
+
slug: string;
|
|
7
|
+
title: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
tag?: string;
|
|
10
|
+
icon?: string;
|
|
11
|
+
content: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type SdkNavGroup = {
|
|
15
|
+
group: string;
|
|
16
|
+
pages: string[];
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type SdkReference = {
|
|
20
|
+
pages: SdkPage[];
|
|
21
|
+
groups: SdkNavGroup[];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type SdkConverter = (sourcePath: string) => Promise<SdkReference>;
|