@knowcode/doc-builder 1.9.5 → 1.9.7

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.
Files changed (45) hide show
  1. package/CLAUDE.md +23 -1
  2. package/doc-builder.config.js +1 -0
  3. package/html/README.html +43 -43
  4. package/html/documentation-index.html +43 -43
  5. package/html/guides/authentication-default-change.html +43 -43
  6. package/html/guides/authentication-guide.html +43 -43
  7. package/html/guides/claude-workflow-guide.html +43 -43
  8. package/html/guides/documentation-standards.html +44 -44
  9. package/html/guides/html-embedding-guide.html +43 -43
  10. package/html/guides/image-modal-guide.html +43 -43
  11. package/html/guides/phosphor-icons-guide.html +43 -43
  12. package/html/guides/private-directory-authentication-troubleshooting.html +43 -43
  13. package/html/guides/private-directory-authentication.html +43 -43
  14. package/html/guides/public-site-deployment.html +43 -43
  15. package/html/guides/search-engine-verification-guide.html +43 -43
  16. package/html/guides/seo-guide.html +43 -43
  17. package/html/guides/seo-optimization-guide.html +43 -43
  18. package/html/guides/troubleshooting-guide.html +43 -43
  19. package/html/guides/windows-setup-guide.html +43 -43
  20. package/html/image-modal-test.html +43 -43
  21. package/html/index.html +43 -43
  22. package/html/private/cache-control-anti-pattern.html +43 -43
  23. package/html/private/launch/README.html +43 -43
  24. package/html/private/launch/auth-cleanup-summary.html +43 -43
  25. package/html/private/launch/bubble-plugin-specification.html +43 -43
  26. package/html/private/launch/go-to-market-strategy.html +43 -43
  27. package/html/private/launch/launch-announcements.html +43 -43
  28. package/html/private/launch/vercel-deployment-auth-setup.html +43 -43
  29. package/html/private/next-steps-walkthrough.html +43 -43
  30. package/html/private/supabase-auth-implementation-completed.html +43 -43
  31. package/html/private/supabase-auth-implementation-plan.html +43 -43
  32. package/html/private/supabase-auth-integration-plan.html +43 -43
  33. package/html/private/supabase-auth-setup-guide.html +43 -43
  34. package/html/private/test-private-doc.html +43 -43
  35. package/html/private/user-management-tooling.html +43 -43
  36. package/html/prompts/markdown-document-standards.html +43 -43
  37. package/html/sitemap.xml +56 -50
  38. package/html/test-status.html +281 -0
  39. package/html/vercel-cli-setup-guide.html +43 -43
  40. package/html/vercel-first-time-setup-guide.html +43 -43
  41. package/lib/config.js +126 -3
  42. package/lib/core-builder.js +147 -28
  43. package/lib/emoji-mapper.js +16 -0
  44. package/package.json +4 -5
  45. package/publish.sh +0 -316
@@ -98,8 +98,8 @@
98
98
  "name": "Knowcode Ltd",
99
99
  "url": "https://knowcode.tech"
100
100
  },
101
- "datePublished": "2025-07-29T08:43:44.010Z",
102
- "dateModified": "2025-07-29T08:43:44.010Z",
101
+ "datePublished": "2025-07-29T09:30:31.384Z",
102
+ "dateModified": "2025-07-29T09:30:31.384Z",
103
103
  "mainEntityOfPage": {
104
104
  "@type": "WebPage",
105
105
  "@id": "https://doc-builder-delta.vercel.app/vercel-first-time-setup-guide.html"
@@ -132,7 +132,7 @@
132
132
 
133
133
  <div class="header-actions">
134
134
  <div class="deployment-info">
135
- <span class="deployment-date" title="Built with doc-builder v1.9.5">Last updated: Jul 29, 2025, 08:43 AM UTC</span>
135
+ <span class="deployment-date" title="Built with doc-builder v1.9.5">Last updated: Jul 29, 2025, 09:30 AM UTC</span>
136
136
  </div>
137
137
 
138
138
 
@@ -182,64 +182,64 @@
182
182
 
183
183
  <div class="nav-section" data-level="0">
184
184
  <a class="nav-title" href="/README.html" >
185
- <i class="fas fa-home"></i> Documentation
185
+ <i class="ph ph-house"></i> Documentation
186
186
  </a>
187
187
  <div class="nav-content" >
188
- <a href="/README.html" class="nav-item" data-tooltip="@knowcode/doc-builder."><i class="fas fa-file-alt"></i> Overview</a>
189
- <a href="/documentation-index.html" class="nav-item" data-tooltip="This directory contains additional documentation for the @knowcode/doc-builder project, organized by topic and purpose."><i class="fas fa-file-alt"></i> Documentation Index</a>
190
- <a href="/image-modal-test.html" class="nav-item" data-tooltip="This document tests the new image modal functionality in doc-builder."><i class="fas fa-file-alt"></i> Image Modal Test</a>
191
- <a href="/vercel-cli-setup-guide.html" class="nav-item" data-tooltip="This guide provides comprehensive instructions for installing the Vercel CLI across different operating systems."><i class="fas fa-file-alt"></i> Vercel Cli Setup Guide</a>
192
- <a href="/vercel-first-time-setup-guide.html" class="nav-item active" data-tooltip="This guide walks you through the Vercel deployment process when using ."><i class="fas fa-file-alt"></i> Vercel First Time Setup Guide</a></div></div>
188
+ <a href="/README.html" class="nav-item" data-tooltip="@knowcode/doc-builder."><i class="ph ph-file-text"></i> Overview</a>
189
+ <a href="/documentation-index.html" class="nav-item" data-tooltip="This directory contains additional documentation for the @knowcode/doc-builder project, organized by topic and purpose."><i class="ph ph-pencil-simple" style="color: #d97706;"></i> Documentation Index</a>
190
+ <a href="/image-modal-test.html" class="nav-item" data-tooltip="This document tests the new image modal functionality in doc-builder."><i class="ph ph-file-text"></i> Image Modal Test</a>
191
+ <a href="/vercel-cli-setup-guide.html" class="nav-item" data-tooltip="This guide provides comprehensive instructions for installing the Vercel CLI across different operating systems."><i class="ph ph-check-circle" style="color: #059669;"></i> Vercel Cli Setup Guide</a>
192
+ <a href="/vercel-first-time-setup-guide.html" class="nav-item active" data-tooltip="This guide walks you through the Vercel deployment process when using ."><i class="ph ph-check-circle" style="color: #059669;"></i> Vercel First Time Setup Guide</a></div></div>
193
193
  <div class="nav-section" data-level="1">
194
194
  <a class="nav-title collapsible" href="#" data-target="nav-guides-1" >
195
- <i class="fas fa-chevron-right collapse-icon"></i><i class="fas fa-folder"></i> Guides
195
+ <i class="ph ph-caret-right collapse-icon"></i><i class="ph ph-book"></i> Guides
196
196
  </a>
197
197
  <div class="nav-content collapsed" id="nav-guides-1">
198
- <a href="/guides/authentication-default-change.html" class="nav-item" data-tooltip="Starting from version 1.7.4, @knowcode/doc-builder now defaults to no authentication for all documentation sites."><i class="fas fa-file-alt"></i> Authentication Default Change</a>
199
- <a href="/guides/authentication-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder supports enterprise-grade authentication through Supabase - a secure, scalable authentication platform."><i class="fas fa-file-alt"></i> Authentication Guide</a>
200
- <a href="/guides/claude-workflow-guide.html" class="nav-item" data-tooltip="This guide demonstrates an efficient workflow for using Claude Code with a refined CLAUDE.md file to create high-quality documentation and deploy it..."><i class="fas fa-file-alt"></i> Claude Workflow Guide</a>
201
- <a href="/guides/documentation-standards.html" class="nav-item" data-tooltip="This document defines the documentation standards and conventions for the @knowcode/doc-builder project."><i class="fas fa-file-alt"></i> Documentation Standards</a>
202
- <a href="/guides/html-embedding-guide.html" class="nav-item" data-tooltip="Starting from version 1.9.2, doc-builder treats HTML files ( and ) as attachments that are automatically copied to your output directory during the..."><i class="fas fa-file-alt"></i> Html Embedding Guide</a>
203
- <a href="/guides/image-modal-guide.html" class="nav-item" data-tooltip="When users click on any image in your generated documentation, it opens in a professional modal overlay with: Full-screen viewing experience Smooth..."><i class="fas fa-file-alt"></i> Image Modal Guide</a>
204
- <a href="/guides/phosphor-icons-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder automatically converts Unicode emojis in your markdown files to beautiful Phosphor icons in the generated HTML."><i class="fas fa-file-alt"></i> Phosphor Icons Guide</a>
205
- <a href="/guides/private-directory-authentication.html" class="nav-item" data-tooltip="The @knowcode/doc-builder provides flexible authentication options to protect your documentation."><i class="fas fa-file-alt"></i> Private Directory Authentication</a>
206
- <a href="/guides/private-directory-authentication-troubleshooting.html" class="nav-item" data-tooltip="Private Directory Authentication Troubleshooting."><i class="fas fa-file-alt"></i> Private Directory Authentication Troubleshooting</a>
207
- <a href="/guides/public-site-deployment.html" class="nav-item" data-tooltip="The @knowcode/doc-builder now supports deploying public documentation sites without authentication."><i class="fas fa-file-alt"></i> Public Site Deployment</a>
208
- <a href="/guides/search-engine-verification-guide.html" class="nav-item" data-tooltip="Search engine verification provides access to powerful webmaster tools:."><i class="fas fa-file-alt"></i> Search Engine Verification Guide</a>
209
- <a href="/guides/seo-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder includes comprehensive SEO (Search Engine Optimization) features to help your documentation rank better in search results and..."><i class="fas fa-file-alt"></i> Seo Guide</a>
210
- <a href="/guides/seo-optimization-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder includes comprehensive SEO (Search Engine Optimization) features that automatically optimize your documentation for search..."><i class="fas fa-file-alt"></i> Seo Optimization Guide</a>
211
- <a href="/guides/troubleshooting-guide.html" class="nav-item" data-tooltip="This guide helps you resolve common issues when using @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Troubleshooting Guide</a>
212
- <a href="/guides/windows-setup-guide.html" class="nav-item" data-tooltip="This guide helps Windows users set up the complete AI-powered documentation workflow using Claude Code, @knowcode/doc-builder, and Vercel."><i class="fas fa-file-alt"></i> Windows Setup Guide</a></div></div>
198
+ <a href="/guides/authentication-default-change.html" class="nav-item" data-tooltip="Starting from version 1.7.4, @knowcode/doc-builder now defaults to no authentication for all documentation sites."><i class="ph ph-file-text"></i> Authentication Default Change</a>
199
+ <a href="/guides/authentication-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder supports enterprise-grade authentication through Supabase - a secure, scalable authentication platform."><i class="ph ph-check-circle" style="color: #059669;"></i> Authentication Guide</a>
200
+ <a href="/guides/claude-workflow-guide.html" class="nav-item" data-tooltip="This guide demonstrates an efficient workflow for using Claude Code with a refined CLAUDE.md file to create high-quality documentation and deploy it..."><i class="ph ph-pencil-simple" style="color: #d97706;"></i> Claude Workflow Guide</a>
201
+ <a href="/guides/documentation-standards.html" class="nav-item" data-tooltip="This document defines the documentation standards and conventions for the @knowcode/doc-builder project."><i class="ph ph-pencil-simple" style="color: #d97706;"></i> Documentation Standards</a>
202
+ <a href="/guides/html-embedding-guide.html" class="nav-item" data-tooltip="Starting from version 1.9.2, doc-builder treats HTML files ( and ) as attachments that are automatically copied to your output directory during the..."><i class="ph ph-check-circle" style="color: #059669;"></i> Html Embedding Guide</a>
203
+ <a href="/guides/image-modal-guide.html" class="nav-item" data-tooltip="When users click on any image in your generated documentation, it opens in a professional modal overlay with: Full-screen viewing experience Smooth..."><i class="ph ph-check-circle" style="color: #059669;"></i> Image Modal Guide</a>
204
+ <a href="/guides/phosphor-icons-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder automatically converts Unicode emojis in your markdown files to beautiful Phosphor icons in the generated HTML."><i class="ph ph-pencil-simple" style="color: #d97706;"></i> Phosphor Icons Guide</a>
205
+ <a href="/guides/private-directory-authentication.html" class="nav-item" data-tooltip="The @knowcode/doc-builder provides flexible authentication options to protect your documentation."><i class="ph ph-check-circle" style="color: #059669;"></i> Private Directory Authentication</a>
206
+ <a href="/guides/private-directory-authentication-troubleshooting.html" class="nav-item" data-tooltip="Private Directory Authentication Troubleshooting."><i class="ph ph-check-circle" style="color: #059669;"></i> Private Directory Authentication Troubleshooting</a>
207
+ <a href="/guides/public-site-deployment.html" class="nav-item" data-tooltip="The @knowcode/doc-builder now supports deploying public documentation sites without authentication."><i class="ph ph-check-circle" style="color: #059669;"></i> Public Site Deployment</a>
208
+ <a href="/guides/search-engine-verification-guide.html" class="nav-item" data-tooltip="Search engine verification provides access to powerful webmaster tools:."><i class="ph ph-check-circle" style="color: #059669;"></i> Search Engine Verification Guide</a>
209
+ <a href="/guides/seo-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder includes comprehensive SEO (Search Engine Optimization) features to help your documentation rank better in search results and..."><i class="ph ph-check-circle" style="color: #059669;"></i> Seo Guide</a>
210
+ <a href="/guides/seo-optimization-guide.html" class="nav-item" data-tooltip="Comprehensive guide to optimizing documentation for search engines. Learn SEO best practices, use built-in features, and improve your rankings."><i class="ph ph-check-circle" style="color: #059669;"></i> Seo Optimization Guide</a>
211
+ <a href="/guides/troubleshooting-guide.html" class="nav-item" data-tooltip="This guide helps you resolve common issues when using @knowcode/doc-builder."><i class="ph ph-check-circle" style="color: #059669;"></i> Troubleshooting Guide</a>
212
+ <a href="/guides/windows-setup-guide.html" class="nav-item" data-tooltip="This guide helps Windows users set up the complete AI-powered documentation workflow using Claude Code, @knowcode/doc-builder, and Vercel."><i class="ph ph-check-circle" style="color: #059669;"></i> Windows Setup Guide</a></div></div>
213
213
  <div class="nav-section private-nav" data-level="1">
214
214
  <a class="nav-title collapsible" href="#" data-target="nav-private-1" >
215
- <i class="fas fa-chevron-right collapse-icon"></i><i class="fas fa-folder"></i> Private
215
+ <i class="ph ph-caret-right collapse-icon"></i><i class="ph ph-lock"></i> Private
216
216
  </a>
217
217
  <div class="nav-content collapsed" id="nav-private-1">
218
- <a href="/private/cache-control-anti-pattern.html" class="nav-item" data-tooltip="Cache Control Anti-Pattern: Why Aggressive Cache-Busting is Bad for Documentation Sites."><i class="fas fa-file-alt"></i> Cache Control Anti Pattern</a>
219
- <a href="/private/next-steps-walkthrough.html" class="nav-item" data-tooltip="Now that we&#039;ve implemented Supabase authentication, let&#039;s walk through testing the implementation and preparing for deployment."><i class="fas fa-file-alt"></i> Next Steps Walkthrough</a>
220
- <a href="/private/supabase-auth-implementation-completed.html" class="nav-item" data-tooltip="This document records the successful implementation of Supabase authentication in @knowcode/doc-builder v1.7.5+."><i class="fas fa-file-alt"></i> Supabase Auth Implementation Completed</a>
221
- <a href="/private/supabase-auth-implementation-plan.html" class="nav-item" data-tooltip="Supabase Auth Implementation Plan for @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Supabase Auth Implementation Plan</a>
222
- <a href="/private/supabase-auth-integration-plan.html" class="nav-item" data-tooltip="Supabase Authentication Integration Plan for @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Supabase Auth Integration Plan</a>
223
- <a href="/private/supabase-auth-setup-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder supports enterprise-grade authentication through Supabase."><i class="fas fa-file-alt"></i> Supabase Auth Setup Guide</a>
224
- <a href="/private/test-private-doc.html" class="nav-item" data-tooltip="Test Private Document."><i class="fas fa-file-alt"></i> Test Private Doc</a>
225
- <a href="/private/user-management-tooling.html" class="nav-item" data-tooltip="The user management system is a set of tools designed to manage user access to Supabase-authenticated documentation sites built with."><i class="fas fa-file-alt"></i> User Management Tooling</a></div></div>
218
+ <a href="/private/cache-control-anti-pattern.html" class="nav-item" data-tooltip="Cache Control Anti-Pattern: Why Aggressive Cache-Busting is Bad for Documentation Sites."><i class="ph ph-check-circle" style="color: #059669;"></i> Cache Control Anti Pattern</a>
219
+ <a href="/private/next-steps-walkthrough.html" class="nav-item" data-tooltip="Now that we&#039;ve implemented Supabase authentication, let&#039;s walk through testing the implementation and preparing for deployment."><i class="ph ph-check-circle" style="color: #059669;"></i> Next Steps Walkthrough</a>
220
+ <a href="/private/supabase-auth-implementation-completed.html" class="nav-item" data-tooltip="This document records the successful implementation of Supabase authentication in @knowcode/doc-builder v1.7.5+."><i class="ph ph-check-circle" style="color: #059669;"></i> Supabase Auth Implementation Completed</a>
221
+ <a href="/private/supabase-auth-implementation-plan.html" class="nav-item" data-tooltip="Supabase Auth Implementation Plan for @knowcode/doc-builder."><i class="ph ph-check-circle" style="color: #059669;"></i> Supabase Auth Implementation Plan</a>
222
+ <a href="/private/supabase-auth-integration-plan.html" class="nav-item" data-tooltip="Supabase Authentication Integration Plan for @knowcode/doc-builder."><i class="ph ph-check-circle" style="color: #059669;"></i> Supabase Auth Integration Plan</a>
223
+ <a href="/private/supabase-auth-setup-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder supports enterprise-grade authentication through Supabase."><i class="ph ph-check-circle" style="color: #059669;"></i> Supabase Auth Setup Guide</a>
224
+ <a href="/private/test-private-doc.html" class="nav-item" data-tooltip="Test Private Document."><i class="ph ph-file-text"></i> Test Private Doc</a>
225
+ <a href="/private/user-management-tooling.html" class="nav-item" data-tooltip="The user management system is a set of tools designed to manage user access to Supabase-authenticated documentation sites built with."><i class="ph ph-check-circle" style="color: #059669;"></i> User Management Tooling</a></div></div>
226
226
  <div class="nav-section private-nav" data-level="2">
227
227
  <a class="nav-title collapsible" href="/private/launch/README.html" data-target="nav-private-launch-2" >
228
- <i class="fas fa-chevron-right collapse-icon"></i><i class="fas fa-folder"></i> Launch
228
+ <i class="ph ph-caret-right collapse-icon"></i><i class="ph ph-rocket-launch"></i> Launch
229
229
  </a>
230
230
  <div class="nav-content collapsed" id="nav-private-launch-2">
231
- <a href="/private/launch/README.html" class="nav-item" data-tooltip="This directory contains all documentation related to the commercial launch of @knowcode/doc-builder, including go-to-market strategy, platform..."><i class="fas fa-file-alt"></i> Launch Overview</a>
232
- <a href="/private/launch/auth-cleanup-summary.html" class="nav-item" data-tooltip="All references to the old client-side authentication system have been removed from @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Auth Cleanup Summary</a>
233
- <a href="/private/launch/bubble-plugin-specification.html" class="nav-item" data-tooltip="This document outlines the technical specification for creating a Bubble.io plugin that integrates @knowcode/doc-builder, enabling Bubble developers..."><i class="fas fa-file-alt"></i> Bubble Plugin Specification</a>
234
- <a href="/private/launch/go-to-market-strategy.html" class="nav-item" data-tooltip="Go-to-Market Strategy &amp; Product Launch Plan."><i class="fas fa-file-alt"></i> Go To Market Strategy</a>
235
- <a href="/private/launch/launch-announcements.html" class="nav-item" data-tooltip="This document contains ready-to-use announcement templates for launching @knowcode/doc-builder across various platforms and channels."><i class="fas fa-file-alt"></i> Launch Announcements</a>
236
- <a href="/private/launch/vercel-deployment-auth-setup.html" class="nav-item" data-tooltip="Vercel Deployment Authentication Setup Guide."><i class="fas fa-file-alt"></i> Vercel Deployment Auth Setup</a></div></div>
231
+ <a href="/private/launch/README.html" class="nav-item" data-tooltip="This directory contains all documentation related to the commercial launch of @knowcode/doc-builder, including go-to-market strategy, platform..."><i class="ph ph-check-circle" style="color: #059669;"></i> Launch Overview</a>
232
+ <a href="/private/launch/auth-cleanup-summary.html" class="nav-item" data-tooltip="All references to the old client-side authentication system have been removed from @knowcode/doc-builder."><i class="ph ph-check-circle" style="color: #059669;"></i> Auth Cleanup Summary</a>
233
+ <a href="/private/launch/bubble-plugin-specification.html" class="nav-item" data-tooltip="This document outlines the technical specification for creating a Bubble.io plugin that integrates @knowcode/doc-builder, enabling Bubble developers..."><i class="ph ph-x-circle" style="color: #dc2626;"></i> Bubble Plugin Specification</a>
234
+ <a href="/private/launch/go-to-market-strategy.html" class="nav-item" data-tooltip="Go-to-Market Strategy &amp; Product Launch Plan."><i class="ph ph-pencil-simple" style="color: #d97706;"></i> Go To Market Strategy</a>
235
+ <a href="/private/launch/launch-announcements.html" class="nav-item" data-tooltip="This document contains ready-to-use announcement templates for launching @knowcode/doc-builder across various platforms and channels."><i class="ph ph-check-circle" style="color: #059669;"></i> Launch Announcements</a>
236
+ <a href="/private/launch/vercel-deployment-auth-setup.html" class="nav-item" data-tooltip="Vercel Deployment Authentication Setup Guide."><i class="ph ph-check-circle" style="color: #059669;"></i> Vercel Deployment Auth Setup</a></div></div>
237
237
  <div class="nav-section" data-level="1">
238
238
  <a class="nav-title collapsible" href="#" data-target="nav-prompts-1" >
239
- <i class="fas fa-chevron-right collapse-icon"></i><i class="fas fa-folder"></i> Prompts
239
+ <i class="ph ph-caret-right collapse-icon"></i><i class="ph ph-chat-circle-dots"></i> Prompts
240
240
  </a>
241
241
  <div class="nav-content collapsed" id="nav-prompts-1">
242
- <a href="/prompts/markdown-document-standards.html" class="nav-item" data-tooltip="Detailed introduction to the topic..."><i class="fas fa-file-alt"></i> Markdown Document Standards</a></div></div>
242
+ <a href="/prompts/markdown-document-standards.html" class="nav-item" data-tooltip="Detailed introduction to the topic..."><i class="ph ph-pencil-simple" style="color: #d97706;"></i> Markdown Document Standards</a></div></div>
243
243
  </nav>
244
244
  <div class="resize-handle"></div>
245
245
  </aside>
package/lib/config.js CHANGED
@@ -1,12 +1,16 @@
1
1
  const fs = require('fs-extra');
2
2
  const path = require('path');
3
3
  const chalk = require('chalk');
4
+ const semver = require('semver');
4
5
  const sharedAuth = require('./shared-auth-config');
5
6
 
6
7
  /**
7
8
  * Default configuration
8
9
  */
9
10
  const defaultConfig = {
11
+ // Configuration version - updated when new config options are added
12
+ configVersion: require('../package.json').version,
13
+
10
14
  // Source and output directories
11
15
  docsDir: 'docs',
12
16
  outputDir: 'html',
@@ -32,7 +36,9 @@ const defaultConfig = {
32
36
  normalizeTitle: true, // Auto-normalize all-caps titles to title case
33
37
  showPdfDownload: true, // Show PDF download icon in header
34
38
  menuDefaultOpen: true, // Menu/sidebar open by default
35
- attachments: true // Copy attachments (Excel, PDF, etc.) to output
39
+ attachments: true, // Copy attachments (Excel, PDF, etc.) to output
40
+ dynamicNavIcons: true, // Use status-based icons in navigation
41
+ subtleColors: true // Apply subtle colors to status icons
36
42
  },
37
43
 
38
44
  // Authentication - Supabase only (basic auth removed for security)
@@ -212,6 +218,112 @@ const notionInspiredPreset = {
212
218
  }
213
219
  };
214
220
 
221
+ /**
222
+ * Check if config migration is needed
223
+ * @param {object} userConfig - Current user configuration
224
+ * @param {string} packageVersion - Current package version
225
+ * @returns {boolean} - Whether migration is needed
226
+ */
227
+ function needsMigration(userConfig, packageVersion) {
228
+ // If no configVersion in user config, it needs migration
229
+ if (!userConfig.configVersion) {
230
+ return true;
231
+ }
232
+
233
+ try {
234
+ // Use semver to compare versions
235
+ return semver.lt(userConfig.configVersion, packageVersion);
236
+ } catch (error) {
237
+ console.warn(chalk.yellow(`Warning: Invalid version format in config: ${userConfig.configVersion}`));
238
+ return true; // Migrate on version parse errors
239
+ }
240
+ }
241
+
242
+ /**
243
+ * Deep merge objects, preserving user customizations
244
+ * @param {object} target - Target object (defaults)
245
+ * @param {object} source - Source object (user config)
246
+ * @returns {object} - Merged object
247
+ */
248
+ function deepMerge(target, source) {
249
+ const result = { ...target };
250
+
251
+ for (const key in source) {
252
+ if (source.hasOwnProperty(key)) {
253
+ if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {
254
+ // Recursively merge objects
255
+ result[key] = deepMerge(target[key] || {}, source[key]);
256
+ } else {
257
+ // Use source value (user customization takes precedence)
258
+ result[key] = source[key];
259
+ }
260
+ }
261
+ }
262
+
263
+ return result;
264
+ }
265
+
266
+ /**
267
+ * Migrate user configuration to current version
268
+ * @param {object} userConfig - Current user configuration
269
+ * @param {string} targetVersion - Target package version
270
+ * @returns {object} - Migrated configuration
271
+ */
272
+ function migrateConfig(userConfig, targetVersion) {
273
+ console.log(chalk.blue(`🔄 Migrating config from ${userConfig.configVersion || 'unknown'} to ${targetVersion}`));
274
+
275
+ // Start with current defaults
276
+ let migratedConfig = { ...defaultConfig };
277
+
278
+ // Deep merge user customizations
279
+ migratedConfig = deepMerge(migratedConfig, userConfig);
280
+
281
+ // Update the config version
282
+ migratedConfig.configVersion = targetVersion;
283
+
284
+ // Log new features added
285
+ const newFeatures = [];
286
+ if (!userConfig.features?.dynamicNavIcons) {
287
+ newFeatures.push('Dynamic navigation icons');
288
+ }
289
+ if (!userConfig.features?.subtleColors) {
290
+ newFeatures.push('Subtle status colors');
291
+ }
292
+ if (!userConfig.features?.phosphorWeight) {
293
+ newFeatures.push('Phosphor icon weight options');
294
+ }
295
+ if (!userConfig.features?.phosphorSize) {
296
+ newFeatures.push('Phosphor icon sizing');
297
+ }
298
+
299
+ if (newFeatures.length > 0) {
300
+ console.log(chalk.green(`✨ Added new features: ${newFeatures.join(', ')}`));
301
+ }
302
+
303
+ return migratedConfig;
304
+ }
305
+
306
+ /**
307
+ * Save configuration to file
308
+ * @param {string} configPath - Path to config file
309
+ * @param {object} config - Configuration object to save
310
+ */
311
+ async function saveConfig(configPath, config) {
312
+ // Create backup of existing config
313
+ if (fs.existsSync(configPath)) {
314
+ const backupPath = `${configPath}.backup.${Date.now()}`;
315
+ await fs.copy(configPath, backupPath);
316
+ console.log(chalk.gray(`💾 Backed up existing config to ${path.basename(backupPath)}`));
317
+ }
318
+
319
+ // Format config as module.exports
320
+ const configContent = `module.exports = ${JSON.stringify(config, null, 2)};
321
+ `;
322
+
323
+ await fs.writeFile(configPath, configContent);
324
+ console.log(chalk.green(`✅ Updated config file: ${path.basename(configPath)}`));
325
+ }
326
+
215
327
  /**
216
328
  * Load configuration
217
329
  */
@@ -228,7 +340,15 @@ async function loadConfig(configPath, options = {}) {
228
340
  if (fs.existsSync(customConfigPath)) {
229
341
  try {
230
342
  const customConfig = require(customConfigPath);
231
- config = { ...config, ...customConfig };
343
+ const packageJson = require('../package.json');
344
+
345
+ // Check if migration is needed
346
+ if (needsMigration(customConfig, packageJson.version)) {
347
+ config = migrateConfig(customConfig, packageJson.version);
348
+ await saveConfig(customConfigPath, config);
349
+ } else {
350
+ config = { ...config, ...customConfig };
351
+ }
232
352
 
233
353
  // Handle alternative config formats
234
354
  if (customConfig.site) {
@@ -356,5 +476,8 @@ module.exports = {
356
476
  defaultConfig,
357
477
  notionInspiredPreset,
358
478
  loadConfig,
359
- createDefaultConfig
479
+ createDefaultConfig,
480
+ needsMigration,
481
+ migrateConfig,
482
+ saveConfig
360
483
  };
@@ -64,6 +64,113 @@ function escapeHtml(text) {
64
64
  return text.replace(/[&<>"']/g, m => map[m]);
65
65
  }
66
66
 
67
+ // Detect document status from content and front matter
68
+ function detectDocumentStatus(content, frontMatter = {}) {
69
+ // Check front matter first
70
+ if (frontMatter.status) {
71
+ return frontMatter.status.toLowerCase();
72
+ }
73
+
74
+ // Check content for status indicators (case insensitive)
75
+ const contentLower = content.toLowerCase();
76
+
77
+ const statusIndicators = {
78
+ 'draft': ['🚧', 'draft', 'work in progress', 'wip', 'under construction'],
79
+ 'complete': ['✅', 'completed', 'verified', 'ready', '✓'],
80
+ 'warning': ['âš ī¸', '❗', 'warning', 'caution', 'attention'],
81
+ 'error': ['❌', '🚨', 'error', 'failed', 'broken'],
82
+ 'planning': ['📋', 'planning', 'todo', 'roadmap', 'brainstorm'],
83
+ 'deprecated': ['đŸ—‘ī¸', 'deprecated', 'obsolete', 'archived']
84
+ };
85
+
86
+ for (const [status, indicators] of Object.entries(statusIndicators)) {
87
+ for (const indicator of indicators) {
88
+ if (contentLower.includes(indicator)) {
89
+ return status;
90
+ }
91
+ }
92
+ }
93
+
94
+ // Special cases based on file name patterns
95
+ if (frontMatter.title || content.includes('# ')) {
96
+ const title = (frontMatter.title || content.match(/^#\s+(.+)$/m)?.[1] || '').toLowerCase();
97
+
98
+ if (title.includes('readme') || title.includes('overview')) return 'readme';
99
+ if (title.includes('guide') || title.includes('tutorial')) return 'guide';
100
+ if (title.includes('troubleshoot') || title.includes('problem')) return 'troubleshoot';
101
+ if (title.includes('api') || title.includes('reference')) return 'reference';
102
+ }
103
+
104
+ return 'default';
105
+ }
106
+
107
+ // Get icon for document status with subtle styling
108
+ function getIconForStatus(status, isFolder = false, config = {}) {
109
+ if (isFolder) {
110
+ return '<i class="ph ph-folder"></i>';
111
+ }
112
+
113
+ // Check if dynamic icons are enabled (default: true)
114
+ const dynamicIcons = config.features?.dynamicNavIcons !== false;
115
+ const subtleColors = config.features?.subtleColors !== false && dynamicIcons;
116
+
117
+ if (!dynamicIcons) {
118
+ return '<i class="ph ph-file-text"></i>';
119
+ }
120
+
121
+ const statusIcons = {
122
+ 'draft': {
123
+ icon: 'ph ph-pencil-simple',
124
+ color: subtleColors ? '#d97706' : undefined // More subtle amber
125
+ },
126
+ 'complete': {
127
+ icon: 'ph ph-check-circle',
128
+ color: subtleColors ? '#059669' : undefined // More subtle emerald
129
+ },
130
+ 'warning': {
131
+ icon: 'ph ph-warning',
132
+ color: subtleColors ? '#ea580c' : undefined // More subtle orange
133
+ },
134
+ 'error': {
135
+ icon: 'ph ph-x-circle',
136
+ color: subtleColors ? '#dc2626' : undefined // More subtle red
137
+ },
138
+ 'planning': {
139
+ icon: 'ph ph-list-checks',
140
+ color: subtleColors ? '#7c3aed' : undefined // More subtle violet
141
+ },
142
+ 'deprecated': {
143
+ icon: 'ph ph-archive',
144
+ color: subtleColors ? '#6b7280' : undefined // Subtle gray
145
+ },
146
+ 'guide': {
147
+ icon: 'ph ph-book-open',
148
+ color: subtleColors ? '#2563eb' : undefined // More subtle blue
149
+ },
150
+ 'readme': {
151
+ icon: 'ph ph-house',
152
+ color: subtleColors ? '#059669' : undefined // More subtle emerald
153
+ },
154
+ 'troubleshoot': {
155
+ icon: 'ph ph-wrench',
156
+ color: subtleColors ? '#dc2626' : undefined // More subtle red
157
+ },
158
+ 'reference': {
159
+ icon: 'ph ph-book',
160
+ color: subtleColors ? '#7c3aed' : undefined // More subtle violet
161
+ },
162
+ 'default': {
163
+ icon: 'ph ph-file-text',
164
+ color: undefined
165
+ }
166
+ };
167
+
168
+ const statusConfig = statusIcons[status] || statusIcons.default;
169
+ const colorStyle = statusConfig.color ? ` style="color: ${statusConfig.color};"` : '';
170
+
171
+ return `<i class="${statusConfig.icon}"${colorStyle}></i>`;
172
+ }
173
+
67
174
  // Extract summary from markdown content for tooltips
68
175
  function extractSummary(content, maxLength = 150) {
69
176
  // Remove front matter
@@ -553,31 +660,35 @@ function buildNavigationStructure(files, currentFile, config = {}) {
553
660
  // Helper function to render a section
554
661
  const renderSection = (folderName, folderData, level = 0, parentPath = '') => {
555
662
  const icons = {
556
- 'root': 'fas fa-home',
557
- 'product-roadmap': 'fas fa-road',
558
- 'product-requirements': 'fas fa-clipboard-list',
559
- 'architecture': 'fas fa-sitemap',
560
- 'system-analysis': 'fas fa-chart-line',
561
- 'system': 'fas fa-cogs',
562
- 'bubble': 'fas fa-circle',
563
- 'quickbase': 'fas fa-database',
564
- 'activecampaign': 'fas fa-envelope',
565
- 'doc-signer': 'fas fa-signature',
566
- 'api-deprecated': 'fas fa-archive',
567
- 'postman': 'fas fa-flask',
568
- 'mcp': 'fas fa-puzzle-piece',
569
- 'team': 'fas fa-users',
570
- 'thought-leadership': 'fas fa-lightbulb',
571
- 'middleware': 'fas fa-layer-group',
572
- 'paths': 'fas fa-route',
573
- 'testing': 'fas fa-vial',
574
- 'api': 'fas fa-plug',
575
- 'documentation-tool': 'fas fa-tools'
663
+ 'root': 'ph ph-house',
664
+ 'product-roadmap': 'ph ph-road-horizon',
665
+ 'product-requirements': 'ph ph-list-checks',
666
+ 'architecture': 'ph ph-tree-structure',
667
+ 'system-analysis': 'ph ph-chart-line-up',
668
+ 'system': 'ph ph-gear-six',
669
+ 'bubble': 'ph ph-circle',
670
+ 'quickbase': 'ph ph-database',
671
+ 'activecampaign': 'ph ph-envelope',
672
+ 'doc-signer': 'ph ph-signature',
673
+ 'api-deprecated': 'ph ph-archive',
674
+ 'postman': 'ph ph-flask',
675
+ 'mcp': 'ph ph-puzzle-piece',
676
+ 'team': 'ph ph-users',
677
+ 'thought-leadership': 'ph ph-lightbulb',
678
+ 'middleware': 'ph ph-stack',
679
+ 'paths': 'ph ph-path',
680
+ 'testing': 'ph ph-test-tube',
681
+ 'api': 'ph ph-plug',
682
+ 'documentation-tool': 'ph ph-wrench',
683
+ 'guides': 'ph ph-book',
684
+ 'private': 'ph ph-lock',
685
+ 'launch': 'ph ph-rocket-launch',
686
+ 'prompts': 'ph ph-chat-circle-dots'
576
687
  };
577
688
 
578
689
  const displayName = folderName === 'root' ? 'Documentation' :
579
690
  folderName.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase());
580
- const icon = icons[folderName] || 'fas fa-folder';
691
+ const icon = icons[folderName] || 'ph ph-folder';
581
692
 
582
693
  if (!folderData.files.length && !Object.keys(folderData.folders).length) {
583
694
  return '';
@@ -587,7 +698,7 @@ function buildNavigationStructure(files, currentFile, config = {}) {
587
698
  const pathParts = parentPath ? [parentPath, folderName].join('-') : folderName;
588
699
  const sectionId = `nav-${pathParts}-${level}`;
589
700
  const isCollapsible = level > 0 || folderName !== 'root';
590
- const collapseIcon = isCollapsible ? '<i class="fas fa-chevron-right collapse-icon"></i>' : '';
701
+ const collapseIcon = isCollapsible ? '<i class="ph ph-caret-right collapse-icon"></i>' : '';
591
702
 
592
703
  // Check if this folder has a README.md file to link to
593
704
  const readmeFile = folderData.files.find(f => f.displayName === 'README');
@@ -634,9 +745,10 @@ function buildNavigationStructure(files, currentFile, config = {}) {
634
745
 
635
746
  const linkPath = '/' + file.urlPath;
636
747
  const tooltip = file.summary ? ` data-tooltip="${escapeHtml(file.summary)}"` : '';
748
+ const icon = getIconForStatus(file.status || 'default', false, config);
637
749
 
638
750
  html += `
639
- <a href="${linkPath}" class="nav-item${isActive}"${tooltip}><i class="fas fa-file-alt"></i> ${title}</a>`;
751
+ <a href="${linkPath}" class="nav-item${isActive}"${tooltip}>${icon} ${title}</a>`;
640
752
  });
641
753
 
642
754
  html += `</div></div>`;
@@ -698,8 +810,9 @@ function buildNavigationStructure(files, currentFile, config = {}) {
698
810
  }
699
811
  const linkPath = '/' + file.urlPath;
700
812
  const tooltip = file.summary ? ` data-tooltip="${escapeHtml(file.summary)}"` : '';
813
+ const icon = getIconForStatus(file.status || 'default', false, config);
701
814
  additionalFiles += `
702
- <a href="${linkPath}" class="nav-item${isActive}"${tooltip}><i class="fas fa-file-alt"></i> ${title}</a>`;
815
+ <a href="${linkPath}" class="nav-item${isActive}"${tooltip}>${icon} ${title}</a>`;
703
816
  });
704
817
 
705
818
  // Reconstruct with additional files inserted
@@ -769,9 +882,12 @@ async function getAllMarkdownFiles(dir, baseDir = dir) {
769
882
  .replace(/[-_]/g, ' ')
770
883
  .replace(/\b\w/g, l => l.toUpperCase());
771
884
 
772
- // Read file to extract summary
773
- const content = await fs.readFile(fullPath, 'utf-8');
774
- const summary = extractSummary(content);
885
+ // Read file to extract summary and status
886
+ const rawContent = await fs.readFile(fullPath, 'utf-8');
887
+ const { data: frontMatter, content } = matter(rawContent);
888
+ const summary = frontMatter.description || extractSummary(content);
889
+ const status = detectDocumentStatus(content, frontMatter);
890
+
775
891
 
776
892
  // Check if this file is in the private directory
777
893
  const isPrivate = relativePath.split(path.sep)[0] === 'private' ||
@@ -784,7 +900,10 @@ async function getAllMarkdownFiles(dir, baseDir = dir) {
784
900
  urlPath,
785
901
  displayName,
786
902
  summary,
787
- isPrivate
903
+ isPrivate,
904
+ status,
905
+ frontMatter,
906
+ content
788
907
  });
789
908
  }
790
909
  }
@@ -15,6 +15,7 @@ const emojiToPhosphor = {
15
15
  '⛔': '<i class="ph ph-prohibit" aria-label="prohibited"></i>',
16
16
  'đŸšĢ': '<i class="ph ph-prohibit-inset" aria-label="not allowed"></i>',
17
17
  '🚨': '<i class="ph ph-siren" aria-label="alert"></i>',
18
+ '🚧': '<i class="ph ph-barricade" aria-label="under construction"></i>',
18
19
  '🆘': '<i class="ph ph-first-aid" aria-label="emergency"></i>',
19
20
 
20
21
  // Development & Tech
@@ -80,6 +81,7 @@ const emojiToPhosphor = {
80
81
  '🧭': '<i class="ph ph-compass" aria-label="navigation"></i>',
81
82
  'đŸ—ēī¸': '<i class="ph ph-map-trifold" aria-label="map"></i>',
82
83
  '🌐': '<i class="ph ph-globe" aria-label="global"></i>',
84
+ '🌍': '<i class="ph ph-globe-hemisphere-west" aria-label="world"></i>',
83
85
 
84
86
  // Communication
85
87
  '📧': '<i class="ph ph-envelope" aria-label="email"></i>',
@@ -249,6 +251,20 @@ const emojiToPhosphor = {
249
251
  '📑': '<i class="ph ph-file-text" aria-label="document"></i>',
250
252
  '💀': '<i class="ph ph-skull" aria-label="skull"></i>',
251
253
  '🔤': '<i class="ph ph-textbox" aria-label="letters"></i>',
254
+ '🧱': '<i class="ph ph-wall" aria-label="brick"></i>',
255
+ 'đŸ–ŧī¸': '<i class="ph ph-image" aria-label="picture"></i>',
256
+ '🎂': '<i class="ph ph-cake" aria-label="birthday"></i>',
257
+ 'â†Šī¸': '<i class="ph ph-arrow-u-left" aria-label="return"></i>',
258
+ '📜': '<i class="ph ph-scroll" aria-label="scroll"></i>',
259
+ 'đŸ•°ī¸': '<i class="ph ph-clock" aria-label="clock"></i>',
260
+ '🧮': '<i class="ph ph-calculator" aria-label="calculator"></i>',
261
+ 'đŸŽĢ': '<i class="ph ph-ticket" aria-label="ticket"></i>',
262
+ 'đŸŒŋ': '<i class="ph ph-leaf" aria-label="leaf"></i>',
263
+ 'đŸĨŠ': '<i class="ph ph-boxing-glove" aria-label="boxing"></i>',
264
+ 'đŸŽ›ī¸': '<i class="ph ph-faders" aria-label="controls"></i>',
265
+ 'đŸ—Ŗī¸': '<i class="ph ph-megaphone-simple" aria-label="speaking"></i>',
266
+ '💝': '<i class="ph ph-gift" aria-label="gift with bow"></i>',
267
+ '🐌': '<i class="ph ph-spiral" aria-label="snail"></i>',
252
268
  };
253
269
 
254
270
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowcode/doc-builder",
3
- "version": "1.9.5",
3
+ "version": "1.9.7",
4
4
  "description": "Reusable documentation builder for markdown-based sites with Vercel deployment support",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -8,9 +8,7 @@
8
8
  },
9
9
  "scripts": {
10
10
  "postinstall": "node scripts/setup.js || true",
11
- "test": "echo \"Error: no test specified\" && exit 1",
12
- "publish:npm": "./publish.sh",
13
- "release": "./publish.sh"
11
+ "test": "echo \"Error: no test specified\" && exit 1"
14
12
  },
15
13
  "keywords": [
16
14
  "documentation",
@@ -39,7 +37,8 @@
39
37
  "gray-matter": "^4.0.3",
40
38
  "marked": "^15.0.12",
41
39
  "ora": "5.4.1",
42
- "prompts": "^2.4.2"
40
+ "prompts": "^2.4.2",
41
+ "semver": "^7.7.2"
43
42
  },
44
43
  "engines": {
45
44
  "node": ">=14.0.0"