@mintlify/scraping 4.0.1230 → 4.0.1231

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/scraping",
3
- "version": "4.0.1230",
3
+ "version": "4.0.1231",
4
4
  "description": "Scrape documentation frameworks to Mintlify docs",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -87,5 +87,5 @@
87
87
  "optional": true
88
88
  }
89
89
  },
90
- "gitHead": "e929a72c0d7dc12e955ca24554b1a3d6e6171bfa"
90
+ "gitHead": "a037bb67d89d82707d5a9be6c5fcb8422f5b934e"
91
91
  }
@@ -36,10 +36,13 @@ export async function convertSphinx(sourcePath: string): Promise<SdkReference> {
36
36
  const docs = splitSphinxModules(await loadDocs(sourcePath));
37
37
  const slugs = new Set(docs.map((doc) => doc.slug));
38
38
  const anchors = collectAnchors(docs);
39
- return {
40
- pages: docs.map((doc) => renderPage(doc, slugs, anchors)),
41
- groups: buildSphinxNavigation(docs),
42
- };
39
+ const pages = docs.map((doc) => renderPage(doc, slugs, anchors));
40
+ const [first, ...rest] = buildSphinxNavigation(docs);
41
+ const [overview, ...others] = first?.pages ?? [];
42
+ if (first?.group === 'Getting Started' && typeof overview === 'string' && !others.length) {
43
+ return { pages, groups: rest, overview };
44
+ }
45
+ return { pages, groups: first ? [first, ...rest] : [] };
43
46
  }
44
47
 
45
48
  type SphinxAnchors = Map<string, Map<string, string>>;
@@ -201,6 +201,7 @@ export async function convertTypedoc(sourcePath: string): Promise<SdkReference>
201
201
 
202
202
  const overviewPages: SdkPage[] = [];
203
203
  const overviewGroups: SdkNavGroup[] = [];
204
+ let projectOverview: string | undefined;
204
205
  const reservedSlugs = new Set(pages.map((page) => page.slug.toLowerCase()));
205
206
  const containers = [project, ...modules.filter((module) => module !== project)];
206
207
  const overviews: { node: TypedocNode; slug: string }[] = [];
@@ -234,13 +235,15 @@ export async function convertTypedoc(sourcePath: string): Promise<SdkReference>
234
235
  isProject ? undefined : project.name
235
236
  );
236
237
  overviewPages.push(overview);
237
- overviewGroups.push({
238
- group: isProject ? 'Overview' : `${container.name} Overview`,
239
- pages: [slug],
240
- });
238
+ if (isProject) projectOverview = slug;
239
+ else overviewGroups.push({ group: `${container.name} Overview`, pages: [slug] });
241
240
  }
242
241
 
243
- return { pages: [...overviewPages, ...pages], groups: [...overviewGroups, ...groups] };
242
+ return {
243
+ pages: [...overviewPages, ...pages],
244
+ groups: [...overviewGroups, ...groups],
245
+ ...(projectOverview ? { overview: projectOverview } : {}),
246
+ };
244
247
  }
245
248
 
246
249
  function hasCustomLayout(container: TypedocNode): boolean {
package/src/sdk/types.ts CHANGED
@@ -29,6 +29,7 @@ export type SdkNavGroup = {
29
29
  export type SdkReference = {
30
30
  pages: SdkPage[];
31
31
  groups: SdkNavGroup[];
32
+ overview?: string;
32
33
  };
33
34
 
34
35
  export type SdkConverter = (sourcePath: string) => Promise<SdkReference>;