generate-docs

1.1.1 • Public • Published

generate-docs

function to generate a documentation file from source files.

any jsdoc-style comment (starts with /**) is extracted and concatenated into the output file.

example:

// docs.js
 
const generateDocs = require("generate-docs").default;
 
generateDocs({
  paths: ["readme.src.md", "*.js"],
  output: "README.md"
});
<!-- readme.src.md -->
 
My Cool Project
 
## API
 
<!-- TOC -->
// index.js
 
/**
 * ## add
 * add(1, 2) // => 3
 */
 
const add = (a, b) => a + b;
<!-- README.md -->
 
My Cool Project
 
## API
 
<!-- toc -->
 
* [add](#add)
 
<!-- tocstop -->
 
## add
 
add(1, 2) // => 3

Readme

Keywords

none

Package Sidebar

Install

npm i generate-docs

Weekly Downloads

9

Version

1.1.1

License

ISC

Unpacked Size

3.93 kB

Total Files

4

Last publish

Collaborators

  • amonks