evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a tool that generates API documentation from JSDoc-annotated JavaScript source code with platform-specific line ending requirements.
Your team works on an open-source project where contributors use different operating systems. Documentation must be generated with consistent line endings for version control, and the output format needs to work across multiple markdown platforms (GitHub, npmjs.org, generic markdown viewers).
Create a Node.js script that:
Accepts configuration options to specify:
Generates markdown documentation from the input JavaScript files with the specified line ending format
Writes the generated documentation to the output file
Given a JavaScript file with JSDoc comments, generates markdown documentation with POSIX line endings when the line ending style is "posix" @test
Given a JavaScript file with JSDoc comments, generates markdown documentation with Windows line endings when the line ending style is "windows" @test
Given a JavaScript file with JSDoc comments, generates generic markdown (non-GitHub-flavored) documentation when generic markdown is specified @test
/**
* Generates platform-specific API documentation from JSDoc-annotated JavaScript files.
*
* @param {Object} options - Configuration options
* @param {string|string[]} options.files - Path(s) to JavaScript file(s) to document
* @param {string} options.output - Path where the generated documentation will be saved
* @param {string} options.lineEndings - Line ending style: "posix" or "windows"
* @param {boolean} options.useGithubMarkdown - Whether to use GitHub-flavored markdown (true) or generic markdown (false)
* @returns {Promise<void>}
*/
async function generateDocumentation(options) {
// IMPLEMENTATION HERE
}
module.exports = { generateDocumentation };Provides markdown documentation generation from JSDoc annotations.