You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: development/scripts/build-docs.md
+22-11
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ The `build-docs.ts` script is responsible for generating and managing the docume
18
18
19
19
## Workflow
20
20
21
-
1. Build hierarchical navigation tree from flat items using `buildNavTree()`
21
+
1. Build a hierarchical navigation tree from flat items using `buildNavTree()`
22
22
- Sort items by section type and weight
23
23
- Create root sections, subsections, and document pages
24
24
- Handle special cases like specification references
@@ -60,20 +60,31 @@ Simple structure containing navigation link information:
60
60
-`href`: URL link
61
61
62
62
## Special Features
63
-
- Special handling for the welcome page at /docs
63
+
- Special handling for the welcome page at `/docs`
64
64
- Reference/specification section with automatic linking to latest specification version
65
65
- Weight-based sorting for proper ordering of sections and documents
66
66
- Root sections and subsections are marked differently than content pages
67
67
- Handles navigation between document sections with smart previous/next links
68
68
- Error handling with detailed error messages
69
69
70
-
## Command
71
-
72
-
To run the script manually, execute:
73
-
74
-
```bash
75
-
tsx scripts/build-docs.ts
76
-
```
70
+
## Development Setup
71
+
1.**Prerequisites**:
72
+
- Node.js and npm installed
73
+
- TypeScript installed globally or as a dev dependency
74
+
- Access to the project repository
75
+
2.**Installing Dependencies**:
76
+
```bash
77
+
npm install
78
+
```
79
+
3. **Running the Script**:
80
+
- Ensure the environment variables are set.
81
+
- Execute the script using:
82
+
```bash
83
+
tsx scripts/build-docs.ts
84
+
```
85
+
4. **Output**:
86
+
- The output will be a JSON file containing the hierarchical navigation structure and an array of document pages with their respective navigation controls.
87
+
- The file will be saved in the specified path (e.g., `../config/posts.json`).
77
88
78
89
## Output
79
90
The output will be a JSON file containing the hierarchical navigation structure and an array of document pages with their respective navigation controls. The file will be saved in the specified path (e.g., `../config/posts.json`).
@@ -84,9 +95,9 @@ No environment variables are required for this script.
84
95
85
96
## Usage Context
86
97
87
-
This script appears to be part of a documentation website generation pipeline. It's designed to:
98
+
This script is part of a documentation website generation pipeline. It's designed to:
88
99
89
100
1. Parse raw documentation items
90
-
2. Create a organized navigation structure
101
+
2. Create an organized navigation structure
91
102
3. Add user-friendly navigation controls
92
103
4. Support hierarchical documentation with sections and subsections
0 commit comments