or run

npx @tessl/cli init
Log in

Version

Files

docs

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

task.mdevals/scenario-4/

Custom Parameter Formatter

Build a documentation generator that customizes how parameter lists are displayed in the output while keeping all other documentation sections in their default format.

Requirements

Create a Node.js script that generates API documentation from JSDoc-annotated source code. The script should:

  1. Accept a source file path as a command-line argument
  2. Generate markdown documentation from the JSDoc comments in that file
  3. Customize only the parameter list formatting to display: **paramName** (*type*) - description
    • Parameter name should be bold
    • Type should be italic
    • Followed by a dash and the description
  4. All other sections (function names, descriptions, return values, etc.) should use default formatting

Write the generated documentation to API.md in the current directory.

Test Cases

Given this source file calculator.js:

/**
 * Performs mathematical operations
 * @param {number} a - First operand
 * @param {number} b - Second operand
 * @param {string} operation - The operation to perform (add, subtract, multiply, divide)
 * @returns {number} The result of the operation
 */
function calculate(a, b, operation) {
  // implementation
}
  • The generated documentation should include parameter information formatted as **a** (*number*) - First operand @test
  • The generated documentation should include all three parameters with custom formatting @test
  • The generated documentation should include the function description and return value information in default format @test

Implementation

@generates

API

/**
 * Generates API documentation with custom parameter formatting
 * @param {string} sourceFilePath - Path to the source file to document
 * @returns {Promise<void>} Resolves when documentation is written to API.md
 */
async function generateDocs(sourceFilePath) {
  // IMPLEMENTATION HERE
}

module.exports = { generateDocs };

Dependencies { .dependencies }

jsdoc-to-markdown { .dependency }

Generates markdown API documentation from JSDoc-annotated source code with template customization support.

@satisfied-by