generate-docs
v1.1.1
Published
function to generate a documentation file from source files.
Downloads
16
Readme
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