or run

npx @tessl/cli init
Log in

Version

Files

docs

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

task.mdevals/scenario-7/

Documentation Multi-Format Generator

Build a documentation generator that processes JavaScript source files once and produces multiple markdown documentation formats with different styling preferences.

Requirements

Your solution should:

  1. Accept one or more JavaScript source files as input (files will contain JSDoc annotations)

  2. Parse the JSDoc annotations once to extract documentation data

  3. Generate three different markdown documentation variants from the same parsed data:

    • A verbose format with heading depth starting at level 2 (##) and horizontal separators between identifiers
    • A compact format with heading depth starting at level 3 (###) without separators
    • A table format with parameter lists rendered as tables and heading depth at level 2
  4. Output all three documentation variants as separate strings

The solution must efficiently reuse the parsed documentation data rather than re-parsing the source files for each output format.

@generates

API

/**
 * Generates three different markdown documentation formats from JavaScript source files.
 *
 * @param {string|string[]} files - Path(s) to JavaScript source file(s) to document
 * @returns {Promise<{verbose: string, compact: string, table: string}>} Object containing three documentation formats
 */
async function generateMultiFormatDocs(files) {
  // IMPLEMENTATION HERE
}

module.exports = { generateMultiFormatDocs };

Test Cases

  • Given a JavaScript file with JSDoc annotations for a single function, generating multi-format docs returns an object with three distinct markdown outputs that all document the same function @test

  • Given a JavaScript file with a class containing multiple methods, the verbose format includes horizontal separators while the compact format does not @test

  • Given a JavaScript file with functions that have parameters, the table format renders parameters as tables while other formats use lists @test

  • The heading depth in the verbose format starts at level 2 (##), while the compact format starts at level 3 (###) @test

Dependencies { .dependencies }

jsdoc-to-markdown { .dependency }

Provides markdown documentation generation from JSDoc annotations.