UNPKG

vitepress-jsdoc

Version:

A bridge between Vitepress and JSDoc-style commented codebases for hassle-free documentation.

64 lines 2.69 kB
#!/usr/bin/env node "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * @vitepress * --- * headline: CLI interface * --- */ const commander_1 = require("commander"); const index_js_1 = require("./index.js"); /** * @file This module provides the main CLI interface for generating markdown files for VitePress. */ /** * Configures the main details of the CLI program. * * @function * */ function configureProgram() { commander_1.program.description('a CLI Tool to generate markdown files for vitepress'); } /** * Configures the available options for the CLI tool. * * @function */ function configureOptions() { commander_1.program .description('CLI Tool to generate markdown files for VitePress from source files.') // Source and Destination .option('-s, --source <path>', 'Specify the source folder containing .js or .js files. Default: ./src') .option('-d, --dist <path>', 'Specify the destination folder for generated markdown files. Default: ./docs') // Documentation Structure .option('-f, --folder <name>', 'Name of the folder inside the destination. This folder gets overwritten every time. Default: code') .option('-t, --title <text>', 'Set the title for your documentation. Default: API') // Customization .option('-r, --readme <path>', 'Provide a path to your custom README file.') .option('-i, --include <patterns>', 'Specify patterns to include specific files/folders. Separate multiple patterns with commas (e.g., *.test.js,include.js).') .option('-e, --exclude <patterns>', 'Specify patterns to exclude specific files/folders. Separate multiple patterns with commas (e.g., *.test.js,exclude.js).') // Advanced Options .option('-w, --watch', 'Enable watch mode to monitor changes in source files.') .option('-rm, --rmPattern [patterns...]', 'Specify patterns for removing files. You can exclude or include files using glob patterns.') .option('-p, --partials [files...]', 'Provide jsdoc2markdown partial templates. This will overwrite the default templates.') .option('-h, --helpers [files...]', 'Provide jsdoc2markdown helpers. This will overwrite the default helpers.') .option('-c, --jsDocConfigPath <path>', 'Specify the path to the JSDoc configuration file.') // Action to Execute .action(index_js_1.generate); } /** * Initializes and runs the CLI tool. * * @function * */ const bootAndRun = () => { const args = process.argv; configureProgram(); configureOptions(); commander_1.program.parse(args); }; bootAndRun(); //# sourceMappingURL=bin.js.map