@knowcode/doc-builder 1.7.0 → 1.7.1

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 (2) hide show
  1. package/cli.js +59 -0
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -1443,6 +1443,65 @@ This comprehensive guide ensures consistent, high-quality documentation that is
1443
1443
  }
1444
1444
  });
1445
1445
 
1446
+ // Add custom help command that shows settings
1447
+ program
1448
+ .command('settings')
1449
+ .description('Show current tool settings and configuration')
1450
+ .option('-c, --config <path>', 'path to config file (default: doc-builder.config.js)')
1451
+ .action(async (options) => {
1452
+ console.log(chalk.cyan('\nšŸ“‹ Current Tool Settings\n'));
1453
+
1454
+ try {
1455
+ // Load configuration
1456
+ const config = await loadConfig(options.config || 'doc-builder.config.js', {});
1457
+
1458
+ // Display settings in a readable format
1459
+ console.log(chalk.yellow('šŸ“ Directories:'));
1460
+ console.log(` • Documentation source: ${chalk.green(config.docsDir || 'docs')}`);
1461
+ console.log(` • HTML output: ${chalk.green(config.outputDir || 'html')}`);
1462
+
1463
+ console.log(chalk.yellow('\n🌐 Site Information:'));
1464
+ console.log(` • Site name: ${chalk.green(config.siteName || 'Documentation')}`);
1465
+ console.log(` • Description: ${chalk.green(config.siteDescription || 'Documentation site')}`);
1466
+ console.log(` • Favicon: ${chalk.green(config.favicon || '✨')}`);
1467
+
1468
+ console.log(chalk.yellow('\n✨ Features:'));
1469
+ console.log(` • Authentication: ${config.features?.authentication ? chalk.green('Enabled') : chalk.gray('Disabled')}`);
1470
+ console.log(` • Dark mode: ${config.features?.darkMode !== false ? chalk.green('Enabled') : chalk.gray('Disabled')}`);
1471
+ console.log(` • Mermaid diagrams: ${config.features?.mermaid !== false ? chalk.green('Enabled') : chalk.gray('Disabled')}`);
1472
+ console.log(` • Changelog: ${config.features?.changelog !== false ? chalk.green('Enabled') : chalk.gray('Disabled')}`);
1473
+ console.log(` • Phosphor icons: ${config.features?.phosphorIcons !== false ? chalk.green('Enabled') : chalk.gray('Disabled')}`);
1474
+ console.log(` • Title normalization: ${config.features?.normalizeTitle !== false ? chalk.green('Enabled') : chalk.gray('Disabled')}`);
1475
+ console.log(` • PDF download: ${config.features?.showPdfDownload !== false ? chalk.green('Shown') : chalk.gray('Hidden')}`);
1476
+ console.log(` • Menu default: ${config.features?.menuDefaultOpen !== false ? chalk.green('Open') : chalk.gray('Closed')}`);
1477
+
1478
+ if (config.features?.authentication) {
1479
+ console.log(chalk.yellow('\nšŸ” Authentication:'));
1480
+ console.log(` • Username: ${chalk.green(config.auth?.username || 'admin')}`);
1481
+ console.log(` • Password: ${chalk.gray('***' + (config.auth?.password?.slice(-2) || '**'))}`);
1482
+ }
1483
+
1484
+ if (config.seo?.enabled) {
1485
+ console.log(chalk.yellow('\nšŸ” SEO:'));
1486
+ console.log(` • Site URL: ${chalk.green(config.seo.siteUrl || 'Not configured')}`);
1487
+ console.log(` • Author: ${chalk.green(config.seo.author || 'Not set')}`);
1488
+ console.log(` • Keywords: ${chalk.green((config.seo.keywords || []).join(', ') || 'None')}`);
1489
+ }
1490
+
1491
+ console.log(chalk.gray('\nšŸ’” Tip: Use doc-builder build --help to see CLI options'));
1492
+
1493
+ } catch (error) {
1494
+ console.error(chalk.red('Error loading configuration:'), error.message);
1495
+ }
1496
+ });
1497
+
1498
+ // Update the help text to mention the settings command
1499
+ program.addHelpText('after', `
1500
+ ${chalk.cyan('šŸ“‹ View Settings:')}
1501
+ ${chalk.gray('$')} doc-builder settings ${chalk.gray('# Show current configuration')}
1502
+ ${chalk.gray('$')} doc-builder settings --config custom.js ${chalk.gray('# Show specific config file')}
1503
+ `);
1504
+
1446
1505
  // Parse arguments
1447
1506
  program.parse(process.argv);
1448
1507
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowcode/doc-builder",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Reusable documentation builder for markdown-based sites with Vercel deployment support",
5
5
  "main": "index.js",
6
6
  "bin": {