1.1.1 • Published 6 years ago

generate-docs v1.1.1

Weekly downloads
7
License
ISC
Repository
github
Last release
6 years ago

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