@knowcode/doc-builder 1.9.12 → 1.9.14
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/assets/css/notion-style.css +102 -1
- package/lib/config.js +25 -2
- package/lib/core-builder.js +8 -4
- package/package.json +1 -1
|
@@ -459,6 +459,43 @@ pre code {
|
|
|
459
459
|
color: var(--color-text-primary);
|
|
460
460
|
}
|
|
461
461
|
|
|
462
|
+
/* Banner types */
|
|
463
|
+
.banner-warning {
|
|
464
|
+
background: var(--color-accent-yellow-bg);
|
|
465
|
+
border-bottom: 1px solid var(--color-accent-yellow);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.banner-warning .banner-icon {
|
|
469
|
+
color: var(--color-accent-yellow);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.banner-info {
|
|
473
|
+
background: var(--color-accent-blue-bg);
|
|
474
|
+
border-bottom: 1px solid var(--color-accent-blue);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
.banner-info .banner-icon {
|
|
478
|
+
color: var(--color-accent-blue);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.banner-success {
|
|
482
|
+
background: var(--color-accent-green-bg);
|
|
483
|
+
border-bottom: 1px solid var(--color-accent-green);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.banner-success .banner-icon {
|
|
487
|
+
color: var(--color-accent-green);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.banner-error {
|
|
491
|
+
background: var(--color-accent-red-bg);
|
|
492
|
+
border-bottom: 1px solid var(--color-accent-red);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.banner-error .banner-icon {
|
|
496
|
+
color: var(--color-accent-red);
|
|
497
|
+
}
|
|
498
|
+
|
|
462
499
|
/* Breadcrumbs - definition moved to line 888 to avoid duplication */
|
|
463
500
|
|
|
464
501
|
.breadcrumb-item {
|
|
@@ -2245,5 +2282,69 @@ body.has-private-access .private-nav {
|
|
|
2245
2282
|
padding: var(--space-2) var(--space-3);
|
|
2246
2283
|
}
|
|
2247
2284
|
}
|
|
2248
|
-
|
|
2285
|
+
|
|
2286
|
+
/* Print styles - hide breadcrumbs and other UI elements for clean PDF output */
|
|
2287
|
+
@media print {
|
|
2288
|
+
/* Hide breadcrumbs completely when printing */
|
|
2289
|
+
.breadcrumbs {
|
|
2290
|
+
display: none !important;
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
/* Hide navigation and header elements for clean printing */
|
|
2294
|
+
.navigation,
|
|
2295
|
+
.menu-toggle,
|
|
2296
|
+
.theme-toggle,
|
|
2297
|
+
.auth-btn,
|
|
2298
|
+
.header {
|
|
2299
|
+
display: none !important;
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
/* Adjust main content area for printing without breadcrumbs */
|
|
2303
|
+
.main-content {
|
|
2304
|
+
margin-top: 0 !important;
|
|
2305
|
+
min-height: auto !important;
|
|
2306
|
+
padding-top: var(--space-4);
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2309
|
+
/* Ensure content takes full width for printing */
|
|
2310
|
+
.content-area {
|
|
2311
|
+
max-width: none !important;
|
|
2312
|
+
padding: 0;
|
|
2313
|
+
margin: 0;
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
/* Optimize text for printing */
|
|
2317
|
+
body {
|
|
2318
|
+
background: white !important;
|
|
2319
|
+
color: black !important;
|
|
2320
|
+
font-size: 12pt;
|
|
2321
|
+
line-height: 1.4;
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2324
|
+
/* Hide interactive elements */
|
|
2325
|
+
.image-modal,
|
|
2326
|
+
.tooltip,
|
|
2327
|
+
button:not(.copy-btn) {
|
|
2328
|
+
display: none !important;
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
/* Ensure code blocks print well */
|
|
2332
|
+
pre, code {
|
|
2333
|
+
background: #f5f5f5 !important;
|
|
2334
|
+
border: 1px solid #ddd !important;
|
|
2335
|
+
page-break-inside: avoid;
|
|
2336
|
+
}
|
|
2337
|
+
|
|
2338
|
+
/* Page break optimization */
|
|
2339
|
+
h1, h2, h3, h4, h5, h6 {
|
|
2340
|
+
page-break-after: avoid;
|
|
2341
|
+
color: black !important;
|
|
2342
|
+
}
|
|
2343
|
+
|
|
2344
|
+
/* Avoid breaking images */
|
|
2345
|
+
img {
|
|
2346
|
+
page-break-inside: avoid;
|
|
2347
|
+
max-width: 100% !important;
|
|
2348
|
+
height: auto !important;
|
|
2349
|
+
}
|
|
2249
2350
|
}
|
package/lib/config.js
CHANGED
|
@@ -39,7 +39,8 @@ const defaultConfig = {
|
|
|
39
39
|
attachments: true, // Copy attachments (Excel, PDF, etc.) to output
|
|
40
40
|
dynamicNavIcons: true, // Use status-based icons in navigation
|
|
41
41
|
subtleColors: true, // Apply subtle colors to status icons
|
|
42
|
-
privateDirectoryAuth: false // Enable auth for private directories only (auto-detected)
|
|
42
|
+
privateDirectoryAuth: false, // Enable auth for private directories only (auto-detected)
|
|
43
|
+
banner: false // Show preview banner at top of pages
|
|
43
44
|
},
|
|
44
45
|
|
|
45
46
|
// Authentication - Supabase only (basic auth removed for security)
|
|
@@ -54,6 +55,15 @@ const defaultConfig = {
|
|
|
54
55
|
enabled: true
|
|
55
56
|
},
|
|
56
57
|
|
|
58
|
+
// Banner configuration
|
|
59
|
+
banner: {
|
|
60
|
+
enabled: false,
|
|
61
|
+
text: 'This documentation is a preview version - some content may be incomplete',
|
|
62
|
+
icon: 'fas fa-exclamation-triangle',
|
|
63
|
+
type: 'warning', // warning, info, success, error
|
|
64
|
+
dismissible: true
|
|
65
|
+
},
|
|
66
|
+
|
|
57
67
|
// Navigation configuration
|
|
58
68
|
folderOrder: [],
|
|
59
69
|
folderDescriptions: {},
|
|
@@ -127,7 +137,8 @@ const notionInspiredPreset = {
|
|
|
127
137
|
normalizeTitle: true,
|
|
128
138
|
showPdfDownload: true,
|
|
129
139
|
menuDefaultOpen: true,
|
|
130
|
-
attachments: true
|
|
140
|
+
attachments: true,
|
|
141
|
+
banner: false // Show preview banner at top of pages
|
|
131
142
|
},
|
|
132
143
|
|
|
133
144
|
auth: {
|
|
@@ -140,6 +151,15 @@ const notionInspiredPreset = {
|
|
|
140
151
|
enabled: true
|
|
141
152
|
},
|
|
142
153
|
|
|
154
|
+
// Banner configuration
|
|
155
|
+
banner: {
|
|
156
|
+
enabled: false,
|
|
157
|
+
text: 'This documentation is a preview version - some content may be incomplete',
|
|
158
|
+
icon: 'fas fa-exclamation-triangle',
|
|
159
|
+
type: 'warning',
|
|
160
|
+
dismissible: true
|
|
161
|
+
},
|
|
162
|
+
|
|
143
163
|
// Folder descriptions from existing code
|
|
144
164
|
folderDescriptions: {
|
|
145
165
|
'product-roadmap': 'Strategic vision, timeline, and feature planning',
|
|
@@ -296,6 +316,9 @@ function migrateConfig(userConfig, targetVersion) {
|
|
|
296
316
|
if (!userConfig.features?.phosphorSize) {
|
|
297
317
|
newFeatures.push('Phosphor icon sizing');
|
|
298
318
|
}
|
|
319
|
+
if (userConfig.features?.banner === undefined) {
|
|
320
|
+
newFeatures.push('Configurable preview banner');
|
|
321
|
+
}
|
|
299
322
|
|
|
300
323
|
if (newFeatures.length > 0) {
|
|
301
324
|
console.log(chalk.green(`✨ Added new features: ${newFeatures.join(', ')}`));
|
package/lib/core-builder.js
CHANGED
|
@@ -548,16 +548,20 @@ ${seoTags}
|
|
|
548
548
|
</div>
|
|
549
549
|
</header>
|
|
550
550
|
|
|
551
|
+
${config.banner?.enabled || config.features?.banner ? `
|
|
551
552
|
<!-- Preview Banner -->
|
|
552
|
-
<div id="preview-banner" class="preview-banner">
|
|
553
|
+
<div id="preview-banner" class="preview-banner banner-${config.banner?.type || 'warning'}">
|
|
553
554
|
<div class="banner-content">
|
|
554
|
-
<i class="fas fa-exclamation-triangle banner-icon"></i>
|
|
555
|
-
<span class="banner-text"
|
|
555
|
+
<i class="${config.banner?.icon || 'fas fa-exclamation-triangle'} banner-icon"></i>
|
|
556
|
+
<span class="banner-text">${config.banner?.text || 'This documentation is a preview version - some content may be incomplete'}</span>
|
|
557
|
+
${config.banner?.dismissible !== false ? `
|
|
556
558
|
<button id="dismiss-banner" class="banner-dismiss" aria-label="Dismiss banner">
|
|
557
559
|
<i class="fas fa-times"></i>
|
|
558
560
|
</button>
|
|
561
|
+
` : ''}
|
|
559
562
|
</div>
|
|
560
563
|
</div>
|
|
564
|
+
` : ''}
|
|
561
565
|
|
|
562
566
|
<!-- Breadcrumbs -->
|
|
563
567
|
<nav class="breadcrumbs" id="breadcrumbs">
|
|
@@ -570,7 +574,7 @@ ${seoTags}
|
|
|
570
574
|
<aside class="sidebar">
|
|
571
575
|
<div class="sidebar-header">
|
|
572
576
|
<div class="filter-box">
|
|
573
|
-
<input type="text" placeholder="
|
|
577
|
+
<input type="text" placeholder="Search menu..." class="filter-input" id="nav-filter">
|
|
574
578
|
<i class="fas fa-search filter-icon"></i>
|
|
575
579
|
</div>
|
|
576
580
|
</div>
|