or run

npx @tessl/cli init
Log in

Version

Files

docs

cli.mdindex.mdprogrammatic-api.md
tile.json

task.mdevals/scenario-1/

Documentation Filter Tool

Build a tool that generates filtered API documentation from JSDoc-annotated JavaScript files, controlling which elements appear in the output based on their tags and properties.

Requirements

Create a Node.js module that processes JavaScript source files with JSDoc annotations and outputs markdown documentation with configurable filtering.

Your tool should support three filtering modes:

  1. Ignore tag filtering: Exclude elements marked with @ignore from the output
  2. Scope filtering: Filter by access scope (public, private, protected)
  3. Kind filtering: Filter by element type (function, class, property, etc.)

Test Cases

  • Processing files with @ignore tags excludes those elements from output @test
  • Filtering by scope (e.g., public only) excludes private and protected elements @test
  • Filtering by kind (e.g., functions only) includes only function documentation @test

Implementation

@generates

API

/**
 * Generate filtered documentation from JSDoc source files
 * @param {Object} options - Configuration options
 * @param {string|string[]} options.files - Input file path(s) or glob pattern
 * @param {boolean} options.respectIgnore - Whether to exclude @ignore tagged elements
 * @param {string[]} options.scopes - Array of scopes to include (e.g., ['public', 'protected'])
 * @param {string[]} options.kinds - Array of identifier kinds to include (e.g., ['function', 'class'])
 * @returns {Promise<string>} Generated markdown documentation
 */
async function generateFilteredDocs(options) {
  // Implementation
}

module.exports = { generateFilteredDocs };

Dependencies { .dependencies }

jsdoc-to-markdown { .dependency }

Provides JSDoc to markdown conversion with filtering capabilities