@brainfish-ai/devdoc 0.1.25 → 0.1.26
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 +2 -2
- package/dist/cli/commands/create.js +28 -9
- package/dist/cli/commands/dev.js +41 -77
- package/package.json +6 -6
- package/renderer/components/docs-viewer/index.tsx +41 -2
- package/renderer/components/docs-viewer/sidebar/collection-tree.tsx +20 -0
- package/templates/basic/README.md +0 -139
- package/templates/basic/assets/favicon.svg +0 -4
- package/templates/basic/assets/logo.svg +0 -9
- package/templates/basic/docs.json +0 -47
- package/templates/basic/guides/configuration.mdx +0 -149
- package/templates/basic/guides/overview.mdx +0 -96
- package/templates/basic/index.mdx +0 -39
- package/templates/basic/package.json +0 -14
- package/templates/basic/quickstart.mdx +0 -92
- package/templates/basic/vercel.json +0 -6
- package/templates/graphql/README.md +0 -139
- package/templates/graphql/api-reference/schema.graphql +0 -305
- package/templates/graphql/assets/favicon.svg +0 -4
- package/templates/graphql/assets/logo.svg +0 -9
- package/templates/graphql/docs.json +0 -54
- package/templates/graphql/guides/configuration.mdx +0 -149
- package/templates/graphql/guides/overview.mdx +0 -96
- package/templates/graphql/index.mdx +0 -39
- package/templates/graphql/package.json +0 -14
- package/templates/graphql/quickstart.mdx +0 -92
- package/templates/graphql/vercel.json +0 -6
- package/templates/openapi/README.md +0 -139
- package/templates/openapi/api-reference/openapi.json +0 -419
- package/templates/openapi/assets/favicon.svg +0 -4
- package/templates/openapi/assets/logo.svg +0 -9
- package/templates/openapi/docs.json +0 -61
- package/templates/openapi/guides/configuration.mdx +0 -149
- package/templates/openapi/guides/overview.mdx +0 -96
- package/templates/openapi/index.mdx +0 -39
- package/templates/openapi/package.json +0 -14
- package/templates/openapi/quickstart.mdx +0 -92
- package/templates/openapi/vercel.json +0 -6
|
@@ -77,6 +77,26 @@ export function CollectionTree({
|
|
|
77
77
|
}
|
|
78
78
|
return expanded
|
|
79
79
|
})
|
|
80
|
+
|
|
81
|
+
// Re-expand all folders when collection folders change (e.g., tab switch)
|
|
82
|
+
// This ensures folders are expanded when switching between tabs with different folder sets
|
|
83
|
+
const folderIds = useMemo(() =>
|
|
84
|
+
collection.folders.map(f => f.id).sort().join(','),
|
|
85
|
+
[collection.folders]
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
if (level === 0 && collection.folders.length > 0) {
|
|
90
|
+
setExpandedFolders(prev => {
|
|
91
|
+
const newExpanded = new Set(prev)
|
|
92
|
+
// Add all current folder IDs to expanded set
|
|
93
|
+
collection.folders.forEach((folder) => {
|
|
94
|
+
newExpanded.add(folder.id)
|
|
95
|
+
})
|
|
96
|
+
return newExpanded
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
}, [folderIds, level, collection.folders])
|
|
80
100
|
|
|
81
101
|
// Auto-expand folder when selectedRequest changes (e.g., via agent navigation)
|
|
82
102
|
useEffect(() => {
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
# My Documentation
|
|
2
|
-
|
|
3
|
-
Documentation site built with [DevDoc](https://github.com/brainfish-ai/devdoc).
|
|
4
|
-
|
|
5
|
-
[](https://vercel.com/new/clone?repository-url=https://github.com/brainfish-ai/devdoc-starter)
|
|
6
|
-
|
|
7
|
-
## Quick Start
|
|
8
|
-
|
|
9
|
-
### Prerequisites
|
|
10
|
-
|
|
11
|
-
- [Node.js](https://nodejs.org/) 18.0 or later
|
|
12
|
-
- npm, yarn, or pnpm
|
|
13
|
-
|
|
14
|
-
### Installation
|
|
15
|
-
|
|
16
|
-
1. **Clone this repository**
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
git clone https://github.com/your-username/your-docs.git
|
|
20
|
-
cd your-docs
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Or use the GitHub template button above.
|
|
24
|
-
|
|
25
|
-
2. **Install dependencies**
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
npm install
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
3. **Start the development server**
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npm run dev
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
4. **Open your browser**
|
|
38
|
-
|
|
39
|
-
Visit [http://localhost:3000](http://localhost:3000) to see your docs.
|
|
40
|
-
|
|
41
|
-
## Project Structure
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
.
|
|
45
|
-
├── docs.json # Site configuration
|
|
46
|
-
├── index.mdx # Homepage
|
|
47
|
-
├── quickstart.mdx # Quickstart guide
|
|
48
|
-
├── guides/
|
|
49
|
-
│ ├── overview.mdx # Overview page
|
|
50
|
-
│ └── configuration.mdx # Configuration guide
|
|
51
|
-
├── public/
|
|
52
|
-
│ ├── logo.svg # Site logo
|
|
53
|
-
│ └── favicon.svg # Favicon
|
|
54
|
-
├── package.json
|
|
55
|
-
├── vercel.json # Vercel deployment config
|
|
56
|
-
└── README.md
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## Configuration
|
|
60
|
-
|
|
61
|
-
Edit `docs.json` to customize your site:
|
|
62
|
-
|
|
63
|
-
```json
|
|
64
|
-
{
|
|
65
|
-
"name": "My Documentation",
|
|
66
|
-
"logo": "/logo.svg",
|
|
67
|
-
"navigation": {
|
|
68
|
-
"tabs": [
|
|
69
|
-
{
|
|
70
|
-
"tab": "Documentation",
|
|
71
|
-
"type": "docs",
|
|
72
|
-
"groups": [
|
|
73
|
-
{
|
|
74
|
-
"group": "Getting Started",
|
|
75
|
-
"pages": ["index", "quickstart"]
|
|
76
|
-
}
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## Writing Content
|
|
85
|
-
|
|
86
|
-
Create `.mdx` files with frontmatter:
|
|
87
|
-
|
|
88
|
-
```mdx
|
|
89
|
-
---
|
|
90
|
-
title: Page Title
|
|
91
|
-
description: Page description for SEO
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
# Your Content Here
|
|
95
|
-
|
|
96
|
-
Write Markdown with React components.
|
|
97
|
-
|
|
98
|
-
<Note>
|
|
99
|
-
Use components like Note, Card, Steps, and more.
|
|
100
|
-
</Note>
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Available Commands
|
|
104
|
-
|
|
105
|
-
| Command | Description |
|
|
106
|
-
|---------|-------------|
|
|
107
|
-
| `npm run dev` | Start development server |
|
|
108
|
-
| `npm run build` | Build for production |
|
|
109
|
-
| `npm run start` | Start production server |
|
|
110
|
-
| `npm run check` | Validate configuration |
|
|
111
|
-
|
|
112
|
-
## Deployment
|
|
113
|
-
|
|
114
|
-
### Vercel (Recommended)
|
|
115
|
-
|
|
116
|
-
Click the "Deploy with Vercel" button above, or:
|
|
117
|
-
|
|
118
|
-
1. Push your code to GitHub
|
|
119
|
-
2. Import the repository in [Vercel](https://vercel.com)
|
|
120
|
-
3. Deploy!
|
|
121
|
-
|
|
122
|
-
### Other Platforms
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
# Build the site
|
|
126
|
-
npm run build
|
|
127
|
-
|
|
128
|
-
# Output is in the dist/ directory
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
## Learn More
|
|
132
|
-
|
|
133
|
-
- [DevDoc Documentation](https://devdoc.sh/docs)
|
|
134
|
-
- [MDX Documentation](https://mdxjs.com/)
|
|
135
|
-
- [Vercel Documentation](https://vercel.com/docs)
|
|
136
|
-
|
|
137
|
-
## License
|
|
138
|
-
|
|
139
|
-
MIT
|