# @vcl/doc-gen

> VCL Documentation Generator

Latest version **0.4.6** (published 2019-08-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vcl/doc-gen
pnpm add @vcl/doc-gen
yarn add @vcl/doc-gen
bun add @vcl/doc-gen
```

Provides the command `vcl-doc-gen`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.6 |
| Published | 2019-08-13 |
| First published | 2017-06-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 3.5 MB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| Author | n-fuse GmbH |
| Maintainers | benbruda, dani723, henriarm, vanthome |
| Keywords | vcl, doc-gen |

## Links

- npm: https://www.npmjs.com/package/@vcl/doc-gen
- Issues: https://github.com/vcl/doc-gen/issues
- npm.io page: https://npm.io/package/@vcl/doc-gen

## Dependencies (5)

- [debug](https://npm.io/package/debug.md) ^4.1.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [marked](https://npm.io/package/marked.md) ^0.6.1
- [resolve](https://npm.io/package/resolve.md) ^1.10.0
- [@vcl/preprocessor](https://npm.io/package/@vcl/preprocessor.md) ^0.4.6

## Recent versions

- 0.4.6 (latest) — 2019-08-13
- 0.4.0-beta.3 (next) — 2019-03-22
- 0.4.5 — 2019-07-19
- 0.4.2 — 2019-04-25
- 0.4.0 — 2019-03-22
- 0.4.0-beta.1 — 2019-03-18
- 0.4.0-beta.0 — 2019-03-15
- 0.4.0-1 — 2019-03-14
- 0.4.0-0 — 2019-03-14
- 0.3.0-4 — 2019-03-11
- 0.3.0-3 — 2019-03-11
- 0.3.0-2 — 2019-03-11
- 0.3.0-1 — 2019-02-28
- 0.2.10 — 2018-10-09
- 0.2.9 — 2018-10-02
- … 7 more at https://npm.io/package/@vcl/doc-gen/versions

## README

# VCL Documentation Generator

A documentation generator for the VCL based on a set of modules or an entry
point `package.json` and its recursive dependencies.
In most cases you want the doc-gen to use a single `package.json`
listing all dependencies from your project.
The output will look like [the VCL's module browser](https://vcl.github.com/).

## Under the Hood

The main purpose of this module is to generate a JSON data structure
in which all information is held.
Modules considered need to have a `vcl` property in the `package.json` file
according to the structure
[explained here](https://github.com/vcl/doc/blob/master/DEVELOPMENT.md#packagejson).

Each module's documentation file (default is `README.md`) is picked and
copied into the JSON structure as well as the meta data from `package.json`.

The JSON data is rendered into a browsable documentation based on HTML by
the [vcl-doc-client](https://github.com/vcl/doc-client)
module.

## Usage

### CLI

```Shell
npm -g i @vcl/doc-gen
cd someProject
vcl-doc-gen --entry ./package.json --output doc.html
```

#### Arguments

All arguments are optional.

Option      | Default                 | Description
 ---        | ---                     | ---
`--name`    | `VCL Documentation`     | Browser Title & Main heading
`--output`  | `vcl-documentation.html`| Output HTML file
`--entry`   | `./package.json`        | Entry file.
`--basePath`| current working dir     |

See [Options](https://github.com/vcl/doc-gen#options) for a more detailed description.

#### Local CLI

```sh
npm install --save-dev @vcl/doc-gen
./node_modules/.bin/vcl-doc-gen
```

### Generate HTML

```sh
var docGenerator = require('@vcl/doc-gen');

docGenerator.generateHtml({
  name: 'VCL Documentation',
  entryPackage: './package.json',
  output: './documentation.html'
});
```

### Generate JSON

```js
var docGenerator = require('@vcl/doc-gen');

docGenerator.generate({
  name: 'VCL Documentation',
  entryPackage: './package.json',
  output: './doc.json'
});
```

## Options

### `name`

The name of the documentation. When using `vcl-doc-client` this will be
displayed in the header and set as the page title.

**Default:** `name: 'VCL Documentation'`

### `entryPackage`

The package that the doc-gen should parse to find all VCL dependencies and
generate the documentation from.

**Example:** `entryPackage: './package.json'`

### `packages`

You can put a list of paths to additional packages here or use this as an
alternative to the `entryPackage` option and set your packages manually.

**Example:** `packages: ['../vcl-test', './some/package']`

### `output`

The file to output the finished JSON doc.

**Default:** `output: './doc.json'`

### `removeTopHeading`

With this option, all level 1 headings from the package readme files are removed.
Defaults to `true`, because most packages have the package name as the first
heading and the `vcl-doc-client` does already display the package name
above the readme.

**Default:** `removeTopHeading: true`

### `basePath`

The base path.

**Example:** `basePath: './my-project'`

---
_Source: https://npm.io/package/@vcl/doc-gen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
