@mintlify/msft-sdk 0.1.0 → 0.1.1
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 +46 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @mintlify/msft-sdk
|
|
2
2
|
|
|
3
|
-
Lightweight SDK for Microsoft documentation with MDX
|
|
3
|
+
Lightweight SDK for rendering Microsoft-style documentation with MDX support.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -8,16 +8,57 @@ Lightweight SDK for Microsoft documentation with MDX rendering.
|
|
|
8
8
|
npm install @mintlify/msft-sdk
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Quick Start
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
### 1. Import Styles
|
|
14
14
|
|
|
15
15
|
```tsx
|
|
16
16
|
import "@mintlify/msft-sdk/styles.css";
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Optional: Add dark mode support with Tailwind CSS:
|
|
20
20
|
|
|
21
|
-
```
|
|
21
|
+
```css
|
|
22
22
|
@variant dark (&:where(.dark, .dark *));
|
|
23
23
|
```
|
|
24
|
+
|
|
25
|
+
### 2. Convert HTML to MDX
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { convertHtmlToMdx, serializeMdx } from "@mintlify/msft-sdk";
|
|
29
|
+
|
|
30
|
+
const { mdx, mdxExtracts } = await convertHtmlToMdx(htmlContent, {
|
|
31
|
+
metadata: { title: "My Doc" },
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const Content = await serializeMdx(mdx);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 3. Render Documentation
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
import { DocsPage } from "@mintlify/msft-sdk";
|
|
41
|
+
|
|
42
|
+
<DocsPage
|
|
43
|
+
payload={{
|
|
44
|
+
serializedContent: Content,
|
|
45
|
+
title: "Documentation",
|
|
46
|
+
mdxExtracts,
|
|
47
|
+
}}
|
|
48
|
+
toc={tocItems}
|
|
49
|
+
navTree={navTree}
|
|
50
|
+
/>;
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Core Exports
|
|
54
|
+
|
|
55
|
+
- `DocsPage` - Main documentation page component
|
|
56
|
+
- `MDXRenderer` - Standalone MDX renderer
|
|
57
|
+
- `convertHtmlToMdx` - Convert HTML to MDX
|
|
58
|
+
- `serializeMdx` - Compile MDX to React components
|
|
59
|
+
- `NavTree`, `TableOfContents` - Navigation components
|
|
60
|
+
- `allComponents` - All available MDX components
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
MIT © Mintlify, Inc.
|