react-docs-ui 0.3.0 → 0.4.0

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 CHANGED
@@ -1,77 +1,49 @@
1
- English | [简体中文](README-zh.md)
2
-
3
- ## react-docs-ui
4
-
5
- React documentation site UI components. Ship a modern docs site with a small set of composable primitives and a ready-to-use app shell.
6
-
7
- ### Install
8
- ```bash
9
- npm install react-docs-ui
10
- ```
11
-
12
- ### Quick usage
13
- Minimal layout:
14
- ```tsx
15
- import 'react-docs-ui/dist/react-docs-ui.css'
16
- import { DocsLayout, HeaderNav, SidebarNav, TableOfContents, MdxContent } from 'react-docs-ui'
17
-
18
- function Page() {
19
- const source = `# Hello\n\nSome markdown...`
20
- return (
21
- <DocsLayout lang="en" config={{
22
- site: { logo: '/logo.svg', title: 'My Docs', description: 'Awesome docs' },
23
- navbar: { items: [] },
24
- sidebar: { collections: {} },
25
- }}>
26
- <MdxContent source={source} />
27
- </DocsLayout>
28
- )
29
- }
30
- ```
31
-
32
- Or use the full app router (reads `public/config/site(.lang).yaml` and `public/docs/<lang>/**/*.md` at runtime):
33
- ```tsx
34
- import 'react-docs-ui/dist/react-docs-ui.css'
35
- import { DocsApp } from 'react-docs-ui'
36
-
37
- export default function App() {
38
- return <DocsApp />
39
- }
40
- ```
41
-
42
- ### Exports
43
- - Layout: `DocsLayout`
44
- - App shell: `DocsApp`
45
- - Navigation: `HeaderNav`, `SidebarNav`, `TableOfContents`
46
- - Theming: `ThemeProvider`, `ModeToggle`, `LanguageSwitcher`
47
- - Markdown: `MdxContent`
48
- - Primitives: `ScrollArea`, `Tooltip`, `Dialog`, `DropdownMenu`, `Command`, `ContextMenu`, `buttonVariants`
49
- - Utils: `cn`, `getConfig`, types `SiteConfig`
50
-
51
- ### Configuration file (`public/config/site.yaml`)
52
- See the `create-react-docs-ui` README for a full example. Basic shape:
53
- ```yaml
54
- site:
55
- logo: /logo.svg
56
- title: My Docs
57
- description: Awesome docs
58
- navbar:
59
- items:
60
- - title: GitHub
61
- link: https://github.com/shenjianZ/react-docs-ui
62
- external: true
63
- sidebar:
64
- collections: {}
65
- ```
66
-
67
- ### Documentation content
68
- - Place markdown under `public/docs/<lang>/**/*.md`
69
- - Route path maps to file path after the language segment
70
- - Optional frontmatter is supported by a simple parser
71
-
72
- ### Requirements
73
- - React 18+
74
- - Works with Vite; CSS file must be imported
75
-
76
- ### License
77
- MIT
1
+ English | [简体中文](README-zh.md)
2
+
3
+ ## react-docs-ui
4
+
5
+ React documentation site UI components. Build modern docs sites with a ready-to-use app shell.
6
+
7
+ ### Install
8
+
9
+ ```bash
10
+ npm install react-docs-ui
11
+ ```
12
+
13
+ ### Quick Start
14
+
15
+ Full app (reads `public/config/site(.lang).yaml` and `public/docs/<lang>/**/*.md`):
16
+
17
+ ```tsx
18
+ import 'react-docs-ui/dist/style.css'
19
+ import { DocsApp } from 'react-docs-ui'
20
+
21
+ export default function App() {
22
+ return <DocsApp />
23
+ }
24
+ ```
25
+
26
+ ### Features
27
+
28
+ - Configuration-driven via `site.yaml`
29
+ - MD/MDX with syntax highlighting
30
+ - Light/dark themes
31
+ - Command menu (Cmd+K)
32
+ - Context menu
33
+ - Internationalization
34
+ - Table of contents
35
+ - PWA support
36
+ - AI integration (requires API key)
37
+
38
+ ### Exports
39
+
40
+ - Layout: `DocsLayout`
41
+ - App shell: `DocsApp`
42
+ - Navigation: `HeaderNav`, `SidebarNav`, `TableOfContents`
43
+ - Theming: `ThemeProvider`, `ModeToggle`, `LanguageSwitcher`
44
+ - Markdown: `MdxContent`
45
+ - Primitives: `ScrollArea`, `Tooltip`, `Dialog`, `DropdownMenu`, `Command`, `ContextMenu`
46
+
47
+ ### License
48
+
49
+ MIT