Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Latest commit

 

History

History
31 lines (25 loc) · 851 Bytes

documentation_generator.md

File metadata and controls

31 lines (25 loc) · 851 Bytes

Documentation Generator

deno doc followed by a list of one or more source files will print the JSDoc documentation for each of the module's exported members.

For example, given a file add.ts with the contents:

/**
 * Adds x and y.
 * @param {number} x
 * @param {number} y
 * @returns {number} Sum of x and y
 */
export function add(x: number, y: number): number {
  return x + y;
}

Running the Deno doc command, prints the function's JSDoc comment to stdout:

deno doc add.ts
function add(x: number, y: number): number
  Adds x and y. @param {number} x @param {number} y @returns {number} Sum of x and y

Use the --json flag to output the documentation in JSON format. This JSON format is consumed by the deno doc website and is used to generate module documentation.