@knowcode/doc-builder 1.0.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 ADDED
@@ -0,0 +1,250 @@
1
+ # @knowcode/doc-builder
2
+
3
+ A zero-configuration documentation builder for markdown-based sites with Vercel deployment support.
4
+
5
+ ## What It Does
6
+
7
+ @knowcode/doc-builder transforms your markdown files into beautiful, static documentation websites. It:
8
+
9
+ - **Scans** your markdown files and automatically generates navigation
10
+ - **Converts** markdown to HTML with syntax highlighting and diagram support
11
+ - **Styles** everything with a clean, Notion-inspired theme
12
+ - **Deploys** to Vercel with a single command - no configuration needed
13
+ - **Provides** optional features like authentication, dark mode, and changelog generation
14
+
15
+ Perfect for project documentation, API references, knowledge bases, or any content written in markdown.
16
+
17
+ ## Features
18
+
19
+ - 🚀 **Zero Configuration** - Works out of the box with sensible defaults
20
+ - 📝 **Markdown Support** - Write docs in markdown with full GitHub Flavored Markdown support
21
+ - 🎨 **Beautiful Default Theme** - Clean, responsive design inspired by Notion
22
+ - 🔐 **Optional Authentication** - Password-protect your documentation
23
+ - 📊 **Mermaid Diagrams** - Built-in support for diagrams and charts
24
+ - 🌙 **Dark Mode** - Automatic dark mode support
25
+ - 🔄 **Live Reload** - Development server with hot reloading
26
+ - ☁️ **Vercel Integration** - One-command deployment to Vercel
27
+ - 📦 **Self-Contained** - No configuration or setup required
28
+
29
+ ## Quick Start
30
+
31
+ No installation needed! Just run:
32
+
33
+ ```bash
34
+ # Build and deploy to Vercel (default action)
35
+ npx @juno/doc-builder
36
+
37
+ # Or use specific commands:
38
+ npx @juno/doc-builder build # Build HTML files only
39
+ npx @juno/doc-builder dev # Start development server
40
+ npx @juno/doc-builder deploy # Deploy to Vercel
41
+ ```
42
+
43
+ The default action (no command specified) will build your documentation and deploy it to Vercel.
44
+
45
+ ## Installation (Optional)
46
+
47
+ For faster execution and offline use:
48
+
49
+ ```bash
50
+ npm install --save-dev @juno/doc-builder
51
+ ```
52
+
53
+ Then use shorter commands:
54
+ ```bash
55
+ doc-builder build
56
+ doc-builder dev
57
+ doc-builder deploy
58
+ ```
59
+
60
+ ## First-Time Vercel Deployment
61
+
62
+ When deploying for the first time, doc-builder will:
63
+
64
+ 1. Check if Vercel CLI is installed
65
+ 2. Guide you through project setup
66
+ 3. Create `vercel.json` configuration
67
+ 4. Link your project to Vercel
68
+ 5. Show important reminders about Vercel settings
69
+
70
+ ### Important Vercel Settings
71
+
72
+ After deployment, go to your Vercel dashboard:
73
+
74
+ 1. Navigate to **Project Settings > General**
75
+ 2. Under **Security**, find **Deployment Protection**
76
+ 3. Set to **Disabled** for public access
77
+ 4. Or configure authentication for private docs
78
+
79
+ ## Configuration
80
+
81
+ Create `doc-builder.config.js` in your project root:
82
+
83
+ ```javascript
84
+ module.exports = {
85
+ // Directories
86
+ docsDir: 'docs',
87
+ outputDir: 'html',
88
+
89
+ // Site info
90
+ siteName: 'My Documentation',
91
+ siteDescription: 'Documentation for my project',
92
+
93
+ // Features
94
+ features: {
95
+ authentication: true,
96
+ changelog: true,
97
+ mermaid: true,
98
+ darkMode: true
99
+ },
100
+
101
+ // Authentication
102
+ auth: {
103
+ username: 'admin',
104
+ password: 'secret'
105
+ }
106
+ };
107
+ ```
108
+
109
+ ## Presets
110
+
111
+ Use the `cybersolstice` preset for compatibility with existing JUNO projects:
112
+
113
+ ```bash
114
+ npx @juno/doc-builder build --preset cybersolstice
115
+ ```
116
+
117
+ ## Commands
118
+
119
+ ### build
120
+ Build the documentation site to static HTML:
121
+ ```bash
122
+ doc-builder build [options]
123
+
124
+ Options:
125
+ -c, --config <path> Path to config file (default: "doc-builder.config.js")
126
+ -i, --input <dir> Input directory containing markdown files (default: docs)
127
+ -o, --output <dir> Output directory for HTML files (default: html)
128
+ --preset <preset> Use a preset configuration (available: cybersolstice)
129
+ --legacy Use legacy mode for backward compatibility
130
+ --no-auth Disable authentication even if configured
131
+ --no-changelog Disable automatic changelog generation
132
+
133
+ Examples:
134
+ doc-builder build # Build with defaults
135
+ doc-builder build --input docs --output dist
136
+ doc-builder build --preset cybersolstice # Use JUNO platform preset
137
+ doc-builder build --config my-config.js # Use custom config
138
+ ```
139
+
140
+ ### dev
141
+ Start development server with live reload:
142
+ ```bash
143
+ doc-builder dev [options]
144
+
145
+ Options:
146
+ -c, --config <path> Path to config file (default: "doc-builder.config.js")
147
+ -p, --port <port> Port to run dev server on (default: 3000)
148
+ -h, --host <host> Host to bind to (default: localhost)
149
+ --no-open Don't open browser automatically
150
+
151
+ Examples:
152
+ doc-builder dev # Start on http://localhost:3000
153
+ doc-builder dev --port 8080 # Use custom port
154
+ doc-builder dev --host 0.0.0.0 # Allow external connections
155
+ ```
156
+
157
+ ### deploy
158
+ Deploy documentation to Vercel (requires Vercel CLI):
159
+ ```bash
160
+ doc-builder deploy [options]
161
+
162
+ Options:
163
+ -c, --config <path> Path to config file (default: "doc-builder.config.js")
164
+ --prod Deploy to production (default: preview deployment)
165
+ --no-build Skip building before deployment
166
+ --force Force deployment without confirmation
167
+
168
+ Examples:
169
+ doc-builder deploy # Deploy preview to Vercel
170
+ doc-builder deploy --prod # Deploy to production
171
+ doc-builder deploy --no-build # Deploy existing build
172
+
173
+ First-time setup:
174
+ The tool will guide you through:
175
+ 1. Installing Vercel CLI (if needed)
176
+ 2. Creating a new Vercel project
177
+ 3. Configuring deployment settings
178
+
179
+ Important: After deployment, disable Vercel Authentication in project settings for public docs.
180
+ ```
181
+
182
+ ### init
183
+ Initialize doc-builder in your project:
184
+ ```bash
185
+ doc-builder init [options]
186
+
187
+ Options:
188
+ --config Create configuration file
189
+ --example Create example documentation structure
190
+
191
+ Examples:
192
+ doc-builder init --config # Create doc-builder.config.js
193
+ doc-builder init --example # Create example docs folder
194
+ ```
195
+
196
+ ## Project Structure
197
+
198
+ Your project should follow this structure:
199
+
200
+ ```
201
+ my-project/
202
+ ├── docs/ # Markdown files
203
+ │ ├── README.md
204
+ │ ├── guide/
205
+ │ └── api/
206
+ ├── doc-builder.config.js # Configuration (optional)
207
+ └── package.json
208
+ ```
209
+
210
+ ## Using in Other Projects
211
+
212
+ ### Option 1: NPM Link (Development)
213
+
214
+ While developing the doc-builder:
215
+
216
+ ```bash
217
+ # In doc-builder directory
218
+ npm link
219
+
220
+ # In your other project
221
+ npm link @juno/doc-builder
222
+ ```
223
+
224
+ ### Option 2: File Reference
225
+
226
+ In your project's `package.json`:
227
+
228
+ ```json
229
+ {
230
+ "devDependencies": {
231
+ "@juno/doc-builder": "file:../path/to/doc-builder"
232
+ }
233
+ }
234
+ ```
235
+
236
+ ### Option 3: Git Repository
237
+
238
+ Once published:
239
+
240
+ ```json
241
+ {
242
+ "devDependencies": {
243
+ "@juno/doc-builder": "git+https://github.com/juno/doc-builder.git"
244
+ }
245
+ }
246
+ ```
247
+
248
+ ## License
249
+
250
+ MIT