Fundamentals of Programming
Documenting JavaScript Programs

Documenting JavaScript Programs

JSDoc

JSDoc is an API documentation generator for JavaScript, similar to Javadoc. You add documentation comments directly to your source code, right alongside the code itself. The JSDoc tool will scan your source code and generate an HTML documentation website for you.

jsdoc-to-markdown

jsdoc-to-markdown (opens in a new tab) generates markdown API documentation from jsdoc (opens in a new tab) annotated source code. Useful for injecting API docs into project README files.

1. Document your code using valid jsdoc comments.

/**
 * A quite wonderful function.
 * @param {object} - Privacy gown
 * @param {object} - Security
 * @returns {survival}
 */
function protection (cloak, dagger) {}

2. Run a command.

$ jsdoc2md example.js

3. Get markdown output.

 
## protection `(cloak, dagger) ⇒ <code>survival</code>`
A quite wonderful function.
 
**Kind**: global function
 
| Param  | Type                | Description  |
| ------ | ------------------- | ------------ |
| cloak  | `object`            | Privacy gown |
| dagger | `object`            | Security     |
 

See also

Vuepress Autodoc Plugin

See https://bprinty.github.io/vuepress-plugin-autodoc/#overview (opens in a new tab)

Docco

How to Make Man pages

The module documentation.js

!!!include(/topics/introduction-to-javascript/documentation-guide.md)!!!

References about Documentación.js

Example: ULL-ESIT-DSI-1617/scapegoat