@mintlify/msft-sdk 0.1.5 → 0.1.6
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/components/content-components/table/index.js +1 -1
- package/dist/components/page.js +7 -13
- package/dist/components/page.js.map +1 -1
- package/dist/index.d.ts +92 -5
- package/dist/index.js +102 -44
- package/dist/index.js.map +1 -1
- package/dist/plugins/extract-headings.js +28 -0
- package/dist/plugins/extract-headings.js.map +1 -0
- package/package.json +1 -1
package/dist/components/page.js
CHANGED
|
@@ -19,11 +19,11 @@ function F({
|
|
|
19
19
|
className: N = "",
|
|
20
20
|
pathname: o,
|
|
21
21
|
markdownContent: f,
|
|
22
|
-
allPages:
|
|
23
|
-
baseUrl:
|
|
22
|
+
allPages: x,
|
|
23
|
+
baseUrl: g
|
|
24
24
|
}) {
|
|
25
|
-
var
|
|
26
|
-
const C = r.serializedContent, s = ((
|
|
25
|
+
var d, l;
|
|
26
|
+
const C = r.serializedContent, s = ((d = r.mdxExtracts) == null ? void 0 : d.zonePivotGroups) || [], a = (l = r.mdxExtracts) == null ? void 0 : l.pivotTocItems;
|
|
27
27
|
return /* @__PURE__ */ e("div", { className: `${p === "dark" ? "dark" : ""} ${N}`, children: /* @__PURE__ */ t("div", { id: "page-container", className: i.pageContainer, children: [
|
|
28
28
|
c && /* @__PURE__ */ e("aside", { className: i.sidebar, "aria-label": "Sidebar navigation", children: /* @__PURE__ */ e("div", { className: i.sidebarInner, children: /* @__PURE__ */ e(
|
|
29
29
|
P,
|
|
@@ -57,8 +57,8 @@ function F({
|
|
|
57
57
|
className: i.contextMenu,
|
|
58
58
|
pathname: o,
|
|
59
59
|
markdownContent: f,
|
|
60
|
-
allPages:
|
|
61
|
-
baseUrl:
|
|
60
|
+
allPages: x,
|
|
61
|
+
baseUrl: g
|
|
62
62
|
}
|
|
63
63
|
)
|
|
64
64
|
] }),
|
|
@@ -72,13 +72,7 @@ function F({
|
|
|
72
72
|
},
|
|
73
73
|
m.id
|
|
74
74
|
)) }),
|
|
75
|
-
/* @__PURE__ */ e("div", { className: i.mdxContent, children: /* @__PURE__ */ e(b, { children: /* @__PURE__ */ e(C, {}) }) })
|
|
76
|
-
/* @__PURE__ */ e("style", { children: `
|
|
77
|
-
div h2,
|
|
78
|
-
div h3 {
|
|
79
|
-
scroll-margin-top: var(--scroll-mt);
|
|
80
|
-
}
|
|
81
|
-
` })
|
|
75
|
+
/* @__PURE__ */ e("div", { className: i.mdxContent, children: /* @__PURE__ */ e(b, { children: /* @__PURE__ */ e(C, {}) }) })
|
|
82
76
|
] })
|
|
83
77
|
] }) }) }) })
|
|
84
78
|
] }) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sources":["../../src/components/page.tsx"],"sourcesContent":["import { MDXRenderer } from \"./mdx-renderer\";\nimport { NavTree } from \"./nav-tree\";\nimport type { DocsPageProps } from \"../types\";\nimport { TableOfContents } from \"./toc\";\nimport { PivotAwareTOC } from \"./toc/pivot-aware-toc\";\nimport { TextAlignLeftFilled } from \"@fluentui/react-icons\";\nimport {\n ZonePivotProvider,\n ZonePivotSelector,\n} from \"./content-components/zone-pivots\";\nimport { PageContextMenu } from \"./page-context-menu\";\nimport styles from \"./page.module.css\";\nimport \"../styles.css\";\n\nexport function DocsPage({\n payload,\n toc,\n navTree,\n dropdown,\n activeHref,\n theme,\n className = \"\",\n pathname,\n markdownContent,\n allPages,\n baseUrl,\n}: DocsPageProps) {\n const Content = payload.serializedContent;\n const zonePivotGroups = payload.mdxExtracts?.zonePivotGroups || [];\n const pivotTocItems = payload.mdxExtracts?.pivotTocItems;\n\n return (\n <div className={`${theme === \"dark\" ? \"dark\" : \"\"} ${className}`}>\n <div id=\"page-container\" className={styles.pageContainer}>\n {navTree && (\n <aside className={styles.sidebar} aria-label=\"Sidebar navigation\">\n <div className={styles.sidebarInner}>\n <NavTree\n navTree={navTree}\n dropdown={dropdown}\n activeHref={activeHref}\n />\n </div>\n </aside>\n )}\n\n <div className={styles.mainWrapper}>\n <div id=\"main-content\" className={styles.mainContent}>\n <ZonePivotProvider groups={zonePivotGroups}>\n <div className={styles.contentWrapper}>\n {toc && toc.length > 0 && (\n <aside className={styles.tocSidebar}>\n <div className={styles.tocInner}>\n <div className={styles.tocHeader}>\n <TextAlignLeftFilled className={styles.tocIcon} />\n <h2 className={styles.tocTitle}>On this page</h2>\n </div>\n {pivotTocItems &&\n Object.keys(pivotTocItems).length > 0 ? (\n <PivotAwareTOC\n baseToc={toc}\n pivotTocItems={pivotTocItems}\n />\n ) : (\n <TableOfContents toc={toc} />\n )}\n </div>\n </aside>\n )}\n\n <div className={styles.contentArea}>\n {payload.title && (\n <header className={styles.header}>\n <div className={styles.headerInner}>\n <div className={styles.headerContent}>\n <h1 className={styles.title}>{payload.title}</h1>\n {pathname && (\n <PageContextMenu\n className={styles.contextMenu}\n pathname={pathname}\n markdownContent={markdownContent}\n allPages={allPages}\n baseUrl={baseUrl}\n />\n )}\n </div>\n {payload.description && (\n <p className={styles.description}>\n {payload.description}\n </p>\n )}\n </div>\n </header>\n )}\n\n {zonePivotGroups.length > 0 && (\n <div className={styles.pivotContainer}>\n {zonePivotGroups.map((group) => (\n <ZonePivotSelector\n key={group.id}\n group={group}\n className={styles.pivotSelector}\n />\n ))}\n </div>\n )}\n\n <div className={styles.mdxContent}>\n <MDXRenderer>\n <Content />\n </MDXRenderer>\n </div>\n
|
|
1
|
+
{"version":3,"file":"page.js","sources":["../../src/components/page.tsx"],"sourcesContent":["import { MDXRenderer } from \"./mdx-renderer\";\nimport { NavTree } from \"./nav-tree\";\nimport type { DocsPageProps } from \"../types\";\nimport { TableOfContents } from \"./toc\";\nimport { PivotAwareTOC } from \"./toc/pivot-aware-toc\";\nimport { TextAlignLeftFilled } from \"@fluentui/react-icons\";\nimport {\n ZonePivotProvider,\n ZonePivotSelector,\n} from \"./content-components/zone-pivots\";\nimport { PageContextMenu } from \"./page-context-menu\";\nimport styles from \"./page.module.css\";\nimport \"../styles.css\";\n\nexport function DocsPage({\n payload,\n toc,\n navTree,\n dropdown,\n activeHref,\n theme,\n className = \"\",\n pathname,\n markdownContent,\n allPages,\n baseUrl,\n}: DocsPageProps) {\n const Content = payload.serializedContent;\n const zonePivotGroups = payload.mdxExtracts?.zonePivotGroups || [];\n const pivotTocItems = payload.mdxExtracts?.pivotTocItems;\n\n return (\n <div className={`${theme === \"dark\" ? \"dark\" : \"\"} ${className}`}>\n <div id=\"page-container\" className={styles.pageContainer}>\n {navTree && (\n <aside className={styles.sidebar} aria-label=\"Sidebar navigation\">\n <div className={styles.sidebarInner}>\n <NavTree\n navTree={navTree}\n dropdown={dropdown}\n activeHref={activeHref}\n />\n </div>\n </aside>\n )}\n\n <div className={styles.mainWrapper}>\n <div id=\"main-content\" className={styles.mainContent}>\n <ZonePivotProvider groups={zonePivotGroups}>\n <div className={styles.contentWrapper}>\n {toc && toc.length > 0 && (\n <aside className={styles.tocSidebar}>\n <div className={styles.tocInner}>\n <div className={styles.tocHeader}>\n <TextAlignLeftFilled className={styles.tocIcon} />\n <h2 className={styles.tocTitle}>On this page</h2>\n </div>\n {pivotTocItems &&\n Object.keys(pivotTocItems).length > 0 ? (\n <PivotAwareTOC\n baseToc={toc}\n pivotTocItems={pivotTocItems}\n />\n ) : (\n <TableOfContents toc={toc} />\n )}\n </div>\n </aside>\n )}\n\n <div className={styles.contentArea}>\n {payload.title && (\n <header className={styles.header}>\n <div className={styles.headerInner}>\n <div className={styles.headerContent}>\n <h1 className={styles.title}>{payload.title}</h1>\n {pathname && (\n <PageContextMenu\n className={styles.contextMenu}\n pathname={pathname}\n markdownContent={markdownContent}\n allPages={allPages}\n baseUrl={baseUrl}\n />\n )}\n </div>\n {payload.description && (\n <p className={styles.description}>\n {payload.description}\n </p>\n )}\n </div>\n </header>\n )}\n\n {zonePivotGroups.length > 0 && (\n <div className={styles.pivotContainer}>\n {zonePivotGroups.map((group) => (\n <ZonePivotSelector\n key={group.id}\n group={group}\n className={styles.pivotSelector}\n />\n ))}\n </div>\n )}\n\n <div className={styles.mdxContent}>\n <MDXRenderer>\n <Content />\n </MDXRenderer>\n </div>\n </div>\n </div>\n </ZonePivotProvider>\n </div>\n </div>\n </div>\n </div>\n );\n}\n"],"names":["DocsPage","payload","toc","navTree","dropdown","activeHref","theme","className","pathname","markdownContent","allPages","baseUrl","Content","zonePivotGroups","_a","pivotTocItems","_b","jsxs","styles","jsx","NavTree","ZonePivotProvider","TextAlignLeftFilled","PivotAwareTOC","TableOfContents","PageContextMenu","group","ZonePivotSelector","MDXRenderer"],"mappings":"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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { default as default_2 } from 'react';
|
|
2
|
+
import { Element as Element_2 } from 'hast';
|
|
3
|
+
import { Handle } from 'hast-util-to-mdast';
|
|
2
4
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
5
|
+
import { MdxJsxFlowElement } from 'mdast-util-mdx-jsx';
|
|
6
|
+
import { Node as Node_2 } from 'unist';
|
|
7
|
+
import { Node as Node_3 } from 'hast';
|
|
8
|
+
import { Plugin as Plugin_2 } from 'unified';
|
|
9
|
+
import * as React_2 from 'react';
|
|
10
|
+
import { Root } from 'mdast';
|
|
11
|
+
import { Root as Root_2 } from 'hast';
|
|
12
|
+
import { State } from 'hast-util-to-mdast';
|
|
13
|
+
import { Text as Text_2 } from 'hast';
|
|
3
14
|
|
|
4
15
|
export declare const allComponents: {
|
|
5
16
|
CodeBlock: typeof CodeBlock;
|
|
@@ -24,6 +35,8 @@ declare interface CalloutProps {
|
|
|
24
35
|
|
|
25
36
|
declare type CalloutType = "note" | "tip" | "important" | "caution" | "warning" | "nextstepaction";
|
|
26
37
|
|
|
38
|
+
export declare const capitalize: (str: string) => string;
|
|
39
|
+
|
|
27
40
|
export declare function CodeBlock({ children, className, fileName, language, }: CodeBlockProps): JSX_2.Element;
|
|
28
41
|
|
|
29
42
|
declare interface CodeBlockProps {
|
|
@@ -53,7 +66,7 @@ export declare const copyMarkdownToClipboard: ({ pathname, onSuccess, onFail, }:
|
|
|
53
66
|
|
|
54
67
|
export declare const defaultComponents: MDXComponents;
|
|
55
68
|
|
|
56
|
-
declare function Details({ children, open }: DetailsProps): JSX_2.Element;
|
|
69
|
+
export declare function Details({ children, open }: DetailsProps): JSX_2.Element;
|
|
57
70
|
|
|
58
71
|
declare interface DetailsProps {
|
|
59
72
|
children: default_2.ReactNode;
|
|
@@ -107,12 +120,25 @@ declare interface DropdownMenuProps {
|
|
|
107
120
|
className?: string;
|
|
108
121
|
}
|
|
109
122
|
|
|
123
|
+
export declare type ElementType = {
|
|
124
|
+
type?: string;
|
|
125
|
+
tagName?: string;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export declare function extractHeadings(): (tree: Node_2, file: unknown) => void;
|
|
129
|
+
|
|
110
130
|
export declare function generateLlmsFullTxt(pages: LlmsPageConfig[], baseUrl: string): Promise<string>;
|
|
111
131
|
|
|
112
132
|
export declare function generateLlmsTxt(pages: LlmsPageConfig[], baseUrl: string): string;
|
|
113
133
|
|
|
134
|
+
export declare function getClassNames(element: Element_2): string[];
|
|
135
|
+
|
|
136
|
+
export declare const getNodeText: (node: unknown) => string;
|
|
137
|
+
|
|
114
138
|
export declare function getPageMarkdown(pathname: string): Promise<string>;
|
|
115
139
|
|
|
140
|
+
export declare function getTextContent(node: Element_2 | Text_2): string;
|
|
141
|
+
|
|
116
142
|
export declare const Heading: ({ id, level, children, className }: HeadingProps) => JSX_2.Element;
|
|
117
143
|
|
|
118
144
|
declare interface HeadingProps {
|
|
@@ -122,6 +148,12 @@ declare interface HeadingProps {
|
|
|
122
148
|
className?: string;
|
|
123
149
|
}
|
|
124
150
|
|
|
151
|
+
export declare function isElement<T extends ElementType = Element_2>(node: ElementType | undefined, key?: keyof T, element?: string): node is T & {
|
|
152
|
+
data?: {
|
|
153
|
+
meta?: unknown;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
|
|
125
157
|
export declare function Link({ href, children, className }: LinkProps): JSX_2.Element;
|
|
126
158
|
|
|
127
159
|
declare interface LinkProps {
|
|
@@ -181,6 +213,8 @@ export declare interface MdxExtracts {
|
|
|
181
213
|
pivotTocItems?: Record<string, TocItem[]>;
|
|
182
214
|
}
|
|
183
215
|
|
|
216
|
+
export declare function mdxJsxFlowElementHandler(state: State, node: Element_2): MdxJsxFlowElement;
|
|
217
|
+
|
|
184
218
|
export declare function MDXRenderer({ children, components }: MDXRendererProps): JSX_2.Element;
|
|
185
219
|
|
|
186
220
|
declare interface MDXRendererProps {
|
|
@@ -238,7 +272,7 @@ export declare interface PageContextMenuProps {
|
|
|
238
272
|
baseUrl?: string;
|
|
239
273
|
}
|
|
240
274
|
|
|
241
|
-
declare function ParamName({ children }: ParamNameProps): JSX_2.Element;
|
|
275
|
+
export declare function ParamName({ children }: ParamNameProps): JSX_2.Element;
|
|
242
276
|
|
|
243
277
|
declare interface ParamNameProps {
|
|
244
278
|
children: React.ReactNode;
|
|
@@ -253,22 +287,71 @@ export declare interface PayloadData {
|
|
|
253
287
|
mdxExtracts?: MdxExtracts;
|
|
254
288
|
}
|
|
255
289
|
|
|
290
|
+
export declare function PivotAwareTOC({ baseToc, pivotTocItems }: PivotAwareTOCProps): JSX_2.Element;
|
|
291
|
+
|
|
292
|
+
declare interface PivotAwareTOCProps {
|
|
293
|
+
baseToc: TocItem[];
|
|
294
|
+
pivotTocItems?: Record<string, TocItem[]>;
|
|
295
|
+
}
|
|
296
|
+
|
|
256
297
|
export declare function PlainTextPage({ content }: PlainTextPageProps): JSX_2.Element;
|
|
257
298
|
|
|
258
299
|
export declare interface PlainTextPageProps {
|
|
259
300
|
content: string;
|
|
260
301
|
}
|
|
261
302
|
|
|
303
|
+
export declare const rehypeCallouts: Plugin_2<[], Node_3>;
|
|
304
|
+
|
|
305
|
+
export declare const rehypeCodeblocks: Plugin_2<[], Node_3>;
|
|
306
|
+
|
|
307
|
+
export declare const rehypeDetails: Plugin_2<[], Node_3>;
|
|
308
|
+
|
|
309
|
+
export declare const rehypeHeadingIds: Plugin_2<[], Node_3>;
|
|
310
|
+
|
|
311
|
+
export declare const rehypeParamName: Plugin_2<[], Node_3>;
|
|
312
|
+
|
|
313
|
+
export declare function rehypeRemark(): (tree: Root_2) => Root;
|
|
314
|
+
|
|
315
|
+
export declare function rehypeRemoveHtmlComments(): (root: Root_2) => void;
|
|
316
|
+
|
|
317
|
+
export declare const rehypeTabs: Plugin_2<[], Node_3>;
|
|
318
|
+
|
|
319
|
+
export declare const rehypeZonePivots: Plugin_2<[ConvertOptions?], Node_3>;
|
|
320
|
+
|
|
321
|
+
export declare function remarkHeadingIds(): (tree: Root) => void;
|
|
322
|
+
|
|
323
|
+
export declare function removeHtmlComments(root: Root_2): void;
|
|
324
|
+
|
|
325
|
+
export declare const sanitizePreTags: Plugin_2<[], Node_3>;
|
|
326
|
+
|
|
262
327
|
export declare function serializeMdx(mdxString: string): Promise<default_2.ComponentType>;
|
|
263
328
|
|
|
264
|
-
declare function Summary({ children, isOpen }: SummaryProps): JSX_2.Element;
|
|
329
|
+
export declare function Summary({ children, isOpen }: SummaryProps): JSX_2.Element;
|
|
265
330
|
|
|
266
331
|
declare interface SummaryProps {
|
|
267
332
|
children: default_2.ReactNode;
|
|
268
333
|
isOpen?: boolean;
|
|
269
334
|
}
|
|
270
335
|
|
|
271
|
-
declare function Tab({ children }: TabProps): JSX_2.Element;
|
|
336
|
+
export declare function Tab({ children }: TabProps): JSX_2.Element;
|
|
337
|
+
|
|
338
|
+
export declare const Table: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLTableElement> & React_2.RefAttributes<HTMLTableElement>>;
|
|
339
|
+
|
|
340
|
+
export declare const TableBody: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLTableSectionElement> & React_2.RefAttributes<HTMLTableSectionElement>>;
|
|
341
|
+
|
|
342
|
+
export declare const TableCaption: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLTableCaptionElement> & React_2.RefAttributes<HTMLTableCaptionElement>>;
|
|
343
|
+
|
|
344
|
+
export declare const TableCell: React_2.ForwardRefExoticComponent<React_2.TdHTMLAttributes<HTMLTableCellElement> & React_2.RefAttributes<HTMLTableCellElement>>;
|
|
345
|
+
|
|
346
|
+
export declare const tableCellHandler: Handle;
|
|
347
|
+
|
|
348
|
+
export declare const TableFooter: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLTableSectionElement> & React_2.RefAttributes<HTMLTableSectionElement>>;
|
|
349
|
+
|
|
350
|
+
export declare const tableHandler: Handle;
|
|
351
|
+
|
|
352
|
+
export declare const TableHead: React_2.ForwardRefExoticComponent<React_2.ThHTMLAttributes<HTMLTableCellElement> & React_2.RefAttributes<HTMLTableCellElement>>;
|
|
353
|
+
|
|
354
|
+
export declare const TableHeader: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLTableSectionElement> & React_2.RefAttributes<HTMLTableSectionElement>>;
|
|
272
355
|
|
|
273
356
|
export declare function TableOfContents({ toc }: TableOfContentsProps): JSX_2.Element;
|
|
274
357
|
|
|
@@ -276,13 +359,17 @@ declare interface TableOfContentsProps {
|
|
|
276
359
|
toc: TocItem[];
|
|
277
360
|
}
|
|
278
361
|
|
|
362
|
+
export declare const TableRow: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLTableRowElement> & React_2.RefAttributes<HTMLTableRowElement>>;
|
|
363
|
+
|
|
364
|
+
export declare const tableRowHandler: Handle;
|
|
365
|
+
|
|
279
366
|
declare interface TabProps {
|
|
280
367
|
title: string;
|
|
281
368
|
icon?: string;
|
|
282
369
|
children: default_2.ReactNode;
|
|
283
370
|
}
|
|
284
371
|
|
|
285
|
-
declare function Tabs({ children, defaultTab }: TabsProps): JSX_2.Element;
|
|
372
|
+
export declare function Tabs({ children, defaultTab }: TabsProps): JSX_2.Element;
|
|
286
373
|
|
|
287
374
|
declare interface TabsProps {
|
|
288
375
|
children: default_2.ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -1,50 +1,108 @@
|
|
|
1
1
|
import { DocsPage as r } from "./components/page.js";
|
|
2
|
-
import { MDXRenderer as
|
|
3
|
-
import { PlainTextPage as
|
|
4
|
-
import { NavTree as
|
|
5
|
-
import { TableOfContents as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
2
|
+
import { MDXRenderer as m } from "./components/mdx-renderer.js";
|
|
3
|
+
import { PlainTextPage as p } from "./components/plain-text-page.js";
|
|
4
|
+
import { NavTree as l } from "./components/nav-tree/index.js";
|
|
5
|
+
import { TableOfContents as n } from "./components/toc/index.js";
|
|
6
|
+
import { PivotAwareTOC as s } from "./components/toc/pivot-aware-toc.js";
|
|
7
|
+
import { PageContextMenu as T } from "./components/page-context-menu.js";
|
|
8
|
+
import { copyMarkdownToClipboard as C, getPageMarkdown as g, useMarkdownCopy as P } from "./hooks/useMarkdownCopy.js";
|
|
9
|
+
import { generateLlmsFullTxt as H, generateLlmsTxt as v } from "./utils/generate-llms-txt.js";
|
|
10
|
+
import { getNodeText as M } from "./utils/get-node-text.js";
|
|
11
|
+
import { capitalize as k } from "./utils/string.js";
|
|
12
|
+
import { getClassNames as w, getTextContent as N, isElement as D } from "./utils/rehype.js";
|
|
13
|
+
import { convertHtmlToMdx as Z } from "./parser/convert-html-to-mdx.js";
|
|
14
|
+
import { serializeMdx as F } from "./parser/serialize-mdx.js";
|
|
15
|
+
import { extractHeadings as B } from "./plugins/extract-headings.js";
|
|
16
|
+
import { rehypeRemoveHtmlComments as I, removeHtmlComments as O } from "./plugins/sanitize/remove-html-comments.js";
|
|
17
|
+
import { CodeBlock as A } from "./components/content-components/code-block.js";
|
|
18
|
+
import { Heading as X } from "./components/content-components/heading.js";
|
|
19
|
+
import { Link as q } from "./components/content-components/link.js";
|
|
20
|
+
import { Callout as K } from "./components/content-components/callouts.js";
|
|
21
|
+
import { ZonePivot as U } from "./components/content-components/zone-pivots/zone-pivot.js";
|
|
22
|
+
import { ZoneTarget as W } from "./components/content-components/zone-pivots/zone-target.js";
|
|
23
|
+
import { ZonePivotProvider as _ } from "./components/content-components/zone-pivots/zone-pivot-context.js";
|
|
24
|
+
import { ZonePivotSelector as ee } from "./components/content-components/zone-pivots/zone-pivot-selector.js";
|
|
25
|
+
import { ParamName as re } from "./components/content-components/param-name.js";
|
|
26
|
+
import { Tabs as me } from "./components/content-components/tabs/tabs.js";
|
|
27
|
+
import { Tab as pe } from "./components/content-components/tabs/tab.js";
|
|
28
|
+
import { Details as le, Summary as fe } from "./components/content-components/details/details.js";
|
|
29
|
+
import { Table as de, TableBody as se, TableCaption as ie, TableCell as Te, TableFooter as be, TableHead as Ce, TableHeader as ge, TableRow as Pe } from "./components/content-components/table/index.js";
|
|
30
|
+
import { allComponents as He } from "./components/content-components/all-components.js";
|
|
31
|
+
import { defaultComponents as he } from "./components/content-components/default-components.js";
|
|
32
|
+
import { DropdownMenu as ce } from "./components/nav-tree/dropdown-menu.js";
|
|
33
|
+
import { MobileNavTree as ue } from "./components/nav-tree/mobile-nav.js";
|
|
34
|
+
import { rehypeCodeblocks as Ne } from "./plugins/rehype/rehype-code-blocks.js";
|
|
35
|
+
import { remarkHeadingIds as Re } from "./plugins/remark/remark-heading-ids.js";
|
|
36
|
+
import { sanitizePreTags as ze } from "./plugins/sanitize/rehype-pre-to-mdx-fence.js";
|
|
37
|
+
import { rehypeCallouts as Le } from "./plugins/sanitize/rehype-callouts.js";
|
|
38
|
+
import { rehypeParamName as Ee } from "./plugins/sanitize/rehype-param-name.js";
|
|
39
|
+
import { rehypeTabs as Oe } from "./plugins/sanitize/rehype-tabs.js";
|
|
40
|
+
import { rehypeDetails as Ae } from "./plugins/sanitize/rehype-details.js";
|
|
41
|
+
import { rehypeHeadingIds as Xe } from "./plugins/sanitize/rehype-heading-ids.js";
|
|
42
|
+
import { rehypeZonePivots as qe } from "./plugins/sanitize/rehype-zone-pivots.js";
|
|
43
|
+
import { mdxJsxFlowElementHandler as Ke, rehypeRemark as Qe } from "./plugins/sanitize/rehype-remark.js";
|
|
44
|
+
import { tableCellHandler as Ve, tableHandler as We, tableRowHandler as Ye } from "./plugins/sanitize/rehype-table-align.js";
|
|
23
45
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
46
|
+
K as Callout,
|
|
47
|
+
A as CodeBlock,
|
|
48
|
+
le as Details,
|
|
26
49
|
r as DocsPage,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
ce as DropdownMenu,
|
|
51
|
+
X as Heading,
|
|
52
|
+
q as Link,
|
|
53
|
+
m as MDXRenderer,
|
|
54
|
+
ue as MobileNavTree,
|
|
55
|
+
l as NavTree,
|
|
56
|
+
T as PageContextMenu,
|
|
57
|
+
re as ParamName,
|
|
58
|
+
s as PivotAwareTOC,
|
|
59
|
+
p as PlainTextPage,
|
|
60
|
+
fe as Summary,
|
|
61
|
+
pe as Tab,
|
|
62
|
+
de as Table,
|
|
63
|
+
se as TableBody,
|
|
64
|
+
ie as TableCaption,
|
|
65
|
+
Te as TableCell,
|
|
66
|
+
be as TableFooter,
|
|
67
|
+
Ce as TableHead,
|
|
68
|
+
ge as TableHeader,
|
|
69
|
+
n as TableOfContents,
|
|
70
|
+
Pe as TableRow,
|
|
71
|
+
me as Tabs,
|
|
72
|
+
U as ZonePivot,
|
|
73
|
+
_ as ZonePivotProvider,
|
|
74
|
+
ee as ZonePivotSelector,
|
|
75
|
+
W as ZoneTarget,
|
|
76
|
+
He as allComponents,
|
|
77
|
+
k as capitalize,
|
|
78
|
+
Z as convertHtmlToMdx,
|
|
79
|
+
C as copyMarkdownToClipboard,
|
|
80
|
+
he as defaultComponents,
|
|
81
|
+
B as extractHeadings,
|
|
82
|
+
H as generateLlmsFullTxt,
|
|
45
83
|
v as generateLlmsTxt,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
84
|
+
w as getClassNames,
|
|
85
|
+
M as getNodeText,
|
|
86
|
+
g as getPageMarkdown,
|
|
87
|
+
N as getTextContent,
|
|
88
|
+
D as isElement,
|
|
89
|
+
Ke as mdxJsxFlowElementHandler,
|
|
90
|
+
Le as rehypeCallouts,
|
|
91
|
+
Ne as rehypeCodeblocks,
|
|
92
|
+
Ae as rehypeDetails,
|
|
93
|
+
Xe as rehypeHeadingIds,
|
|
94
|
+
Ee as rehypeParamName,
|
|
95
|
+
Qe as rehypeRemark,
|
|
96
|
+
I as rehypeRemoveHtmlComments,
|
|
97
|
+
Oe as rehypeTabs,
|
|
98
|
+
qe as rehypeZonePivots,
|
|
99
|
+
Re as remarkHeadingIds,
|
|
100
|
+
O as removeHtmlComments,
|
|
101
|
+
ze as sanitizePreTags,
|
|
102
|
+
F as serializeMdx,
|
|
103
|
+
Ve as tableCellHandler,
|
|
104
|
+
We as tableHandler,
|
|
105
|
+
Ye as tableRowHandler,
|
|
106
|
+
P as useMarkdownCopy
|
|
49
107
|
};
|
|
50
108
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { visit as a } from "unist-util-visit";
|
|
2
|
+
import o from "@sindresorhus/slugify";
|
|
3
|
+
function l(e) {
|
|
4
|
+
return e.children.filter((t) => t.type === "text").map((t) => t.value).join("").replace(/\s*\([^)]*\)\s*/g, " ").trim();
|
|
5
|
+
}
|
|
6
|
+
function g() {
|
|
7
|
+
return (e, n) => {
|
|
8
|
+
const i = [];
|
|
9
|
+
a(e, "heading", (t) => {
|
|
10
|
+
const r = t.depth;
|
|
11
|
+
if (r >= 2 && r <= 3) {
|
|
12
|
+
const c = l(t), s = o(c.replace(/\./g, "-"));
|
|
13
|
+
i.push({
|
|
14
|
+
title: c,
|
|
15
|
+
slug: s,
|
|
16
|
+
level: r
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}), n.data = {
|
|
20
|
+
...n.data,
|
|
21
|
+
headings: i
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
g as extractHeadings
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=extract-headings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-headings.js","sources":["../../src/plugins/extract-headings.ts"],"sourcesContent":["import { visit } from \"unist-util-visit\";\nimport type { Node } from \"unist\";\nimport type { TocItem } from \"../types\";\nimport slugify from \"@sindresorhus/slugify\";\n\nfunction getHeadingText(node: Record<string, unknown>): string {\n const children = node.children as Array<Record<string, unknown>>;\n const text = children\n .filter((child) => child.type === \"text\")\n .map((child) => child.value as string)\n .join(\"\");\n\n return text.replace(/\\s*\\([^)]*\\)\\s*/g, \" \").trim();\n}\n\nexport function extractHeadings() {\n return (tree: Node, file: unknown) => {\n const headings: TocItem[] = [];\n\n visit(tree, \"heading\", (node: Record<string, unknown>) => {\n const depth = node.depth as number;\n if (depth >= 2 && depth <= 3) {\n const text = getHeadingText(node);\n const slug = slugify(text.replace(/\\./g, '-'));\n\n headings.push({\n title: text,\n slug,\n level: depth,\n });\n }\n });\n\n (file as Record<string, unknown>).data = {\n ...((file as Record<string, unknown>).data as Record<string, unknown>),\n headings,\n };\n };\n}\n"],"names":["getHeadingText","node","child","extractHeadings","tree","file","headings","visit","depth","text","slug","slugify"],"mappings":";;AAKA,SAASA,EAAeC,GAAuC;AAO7D,SANiBA,EAAK,SAEnB,OAAO,CAACC,MAAUA,EAAM,SAAS,MAAM,EACvC,IAAI,CAACA,MAAUA,EAAM,KAAe,EACpC,KAAK,EAAE,EAEE,QAAQ,oBAAoB,GAAG,EAAE,KAAA;AAC/C;AAEO,SAASC,IAAkB;AAChC,SAAO,CAACC,GAAYC,MAAkB;AACpC,UAAMC,IAAsB,CAAA;AAE5B,IAAAC,EAAMH,GAAM,WAAW,CAACH,MAAkC;AACxD,YAAMO,IAAQP,EAAK;AACnB,UAAIO,KAAS,KAAKA,KAAS,GAAG;AAC5B,cAAMC,IAAOT,EAAeC,CAAI,GAC1BS,IAAOC,EAAQF,EAAK,QAAQ,OAAO,GAAG,CAAC;AAE7C,QAAAH,EAAS,KAAK;AAAA,UACZ,OAAOG;AAAA,UACP,MAAAC;AAAA,UACA,OAAOF;AAAA,QAAA,CACR;AAAA,MACH;AAAA,IACF,CAAC,GAEAH,EAAiC,OAAO;AAAA,MACvC,GAAKA,EAAiC;AAAA,MACtC,UAAAC;AAAA,IAAA;AAAA,EAEJ;AACF;"}
|