@knowcode/doc-builder 1.1.9 → 1.1.10

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/CHANGELOG.md CHANGED
@@ -5,6 +5,22 @@ All notable changes to @knowcode/doc-builder will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.1.10] - 2025-07-19
9
+
10
+ ### Fixed
11
+ - Fixed navigation for flat file structures (no folders)
12
+ - Added proper CSS styling for flat navigation layouts
13
+ - Navigation now works correctly when all files are in root directory
14
+
15
+ ### Added
16
+ - Flat navigation detection and handling
17
+ - Specific CSS classes for flat vs collapsible navigation
18
+ - Improved navigation styling for simple project structures
19
+
20
+ ### Improved
21
+ - Better navigation experience for projects without folder hierarchies
22
+ - Consistent navigation styling across all project structures
23
+
8
24
  ## [1.1.9] - 2025-07-19
9
25
 
10
26
  ### Fixed
@@ -1459,4 +1459,35 @@ tr:hover {
1459
1459
  [data-tooltip]::after {
1460
1460
  display: none;
1461
1461
  }
1462
+ }
1463
+
1464
+ /* Navigation: Flat vs Collapsible */
1465
+ .nav-flat .nav-folder-toggle {
1466
+ display: none;
1467
+ }
1468
+
1469
+ .nav-flat li {
1470
+ margin-bottom: var(--space-0-5);
1471
+ }
1472
+
1473
+ .nav-flat .nav-link {
1474
+ display: block;
1475
+ padding: var(--space-1) var(--space-2);
1476
+ color: var(--color-text-secondary);
1477
+ text-decoration: none;
1478
+ border-radius: var(--border-radius-md);
1479
+ transition: all 0.2s ease;
1480
+ font-size: var(--text-sm);
1481
+ font-weight: 400;
1482
+ }
1483
+
1484
+ .nav-flat .nav-link:hover {
1485
+ background: var(--color-bg-hover);
1486
+ color: var(--color-text-primary);
1487
+ }
1488
+
1489
+ .nav-flat .nav-link.active {
1490
+ background: var(--color-accent-blue-bg);
1491
+ color: var(--color-accent-blue);
1492
+ font-weight: 500;
1462
1493
  }
@@ -208,7 +208,19 @@ function buildNavigationStructure(files, currentFile) {
208
208
  return Object.values(node.folders).some(folder => checkActiveChild(folder, currentFile));
209
209
  };
210
210
 
211
- return `<ul class="nav-list">${generateNavHTML(tree)}</ul>`;
211
+ const navHTML = generateNavHTML(tree);
212
+
213
+ // If there are no folders (flat structure), wrap in a simple nav-list
214
+ // If there are folders, use collapsible navigation
215
+ const hasFolders = Object.keys(tree.folders).length > 0;
216
+
217
+ if (!hasFolders) {
218
+ // Simple flat navigation
219
+ return `<ul class="nav-list nav-flat">${navHTML}</ul>`;
220
+ } else {
221
+ // Collapsible navigation with folders
222
+ return `<ul class="nav-list nav-collapsible">${navHTML}</ul>`;
223
+ }
212
224
  }
213
225
 
214
226
  // Process single markdown file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowcode/doc-builder",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "description": "Reusable documentation builder for markdown-based sites with Vercel deployment support",
5
5
  "main": "index.js",
6
6
  "bin": {