UNPKG

vitepress-jsdoc

Version:

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

37 lines 1.54 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parsePluginOptions = void 0; /** * Parses the provided plugin options * * @param {PluginOptions} options - The plugin options to be parsed. * @returns {ParsedPluginOptions} An object containing: * - include: Array of patterns to include. * - exclude: Array of patterns to exclude. * - srcFolder: The source folder path, with './' prefix removed. * - jsDocConfigPath: The path to the JSDoc configuration file. * - codeFolder: The folder where the code resides. * - docsFolder: The destination folder for the generated documentation. * - title: The title for the documentation. * - readme: The path to the README file. * - rmPattern: Array of patterns to remove. * - partials: Array of partial templates. * - helpers: Array of helper functions. */ const parsePluginOptions = (options) => { return { include: (options.include ?? '').split(',').filter(Boolean), exclude: (options.exclude || '').split(',').filter(Boolean), srcFolder: options.source.replace('./', ''), jsDocConfigPath: options.jsDocConfigPath ?? '', codeFolder: options.folder, docsFolder: `${options.dist}/${options.folder}`, title: options.title, readme: options.readme, rmPattern: options.rmPattern ?? [], partials: options.partials || [], helpers: options.helpers || [], }; }; exports.parsePluginOptions = parsePluginOptions; //# sourceMappingURL=plugin-options.js.map