# hardhat-docgen

> Generate NatSpec documentation automatically on compilation

Latest version **1.3.0** (published 2021-12-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install hardhat-docgen
pnpm add hardhat-docgen
yarn add hardhat-docgen
bun add hardhat-docgen
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2021-12-30 |
| First published | 2021-01-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14.14.0 |
| Dependencies | 7 |
| Unpacked size | 18.9 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 47 |
| Author | Nick Barry |
| Maintainers | itsnickbarry |
| Keywords | hardhat, natspec, documentation, devdoc, userdoc, buidler, solidity, solc, smart-contracts, ethereum, blockchain, wow |

## Links

- npm: https://www.npmjs.com/package/hardhat-docgen
- Repository: https://github.com/ItsNickBarry/hardhat-docgen
- Homepage: https://github.com/ItsNickBarry/hardhat-docgen#readme
- Issues: https://github.com/ItsNickBarry/hardhat-docgen/issues
- npm.io page: https://npm.io/package/hardhat-docgen

## Dependencies (7)

- [vue](https://npm.io/package/vue.md) ^2.6.14
- [webpack](https://npm.io/package/webpack.md) ^5.65.0
- [css-loader](https://npm.io/package/css-loader.md) ^6.5.1
- [vue-loader](https://npm.io/package/vue-loader.md) ^15.9.8
- [vue-router](https://npm.io/package/vue-router.md) ^3.5.3
- [html-webpack-plugin](https://npm.io/package/html-webpack-plugin.md) ^5.5.0
- [vue-template-compiler](https://npm.io/package/vue-template-compiler.md) ^2.6.14

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2021-12-30
- 1.2.1 — 2021-12-14
- 1.2.0 — 2021-10-31
- 1.1.3 — 2021-10-31
- 1.1.2 — 2021-08-27
- 1.1.1 — 2021-04-22
- 1.1.0 — 2021-03-13
- 1.0.3 — 2021-02-05
- 1.0.2 — 2021-02-05
- 1.0.1 — 2021-02-04
- 1.0.0 — 2021-01-18
- 0.0.0 — 2021-01-09

## README

# Hardhat Docgen

Generate a static documentation site from NatSpec comments automatically on compilation with Hardhat.

## Installation

```bash
yarn add --dev hardhat-docgen
```

## Usage

Load plugin in Hardhat config:

```javascript
require('hardhat-docgen');
```

Add configuration under the `docgen` key:

| option | description | default |
|-|-|-|
| `path` | path to HTML export directory (relative to Hardhat root) | `'./docgen'`
| `clear` | whether to delete old files in `path` on documentation generation  | `false` |
| `runOnCompile` | whether to automatically generate documentation during compilation | `false` |
| `only` | `Array` of `String` matchers used to select included contracts, defaults to all contracts if `length` is 0 | `['^contracts/']` (dependent on Hardhat `paths` configuration) |
| `except` | `Array` of `String` matchers used to exclude contracts | `[]` |

```javascript
docgen: {
  path: './docs',
  clear: true,
  runOnCompile: true,
}
```

The included Hardhat task may be run manually:

```bash
yarn run hardhat docgen
```

By default, the hardhat `compile` task is run before generating documentation.  This behavior can be disabled with the `--no-compile` flag:

```bash
yarn run hardhat docgen --no-compile
```

The `path` directory will be created if it does not exist.

The `clear` option is set to `false` by default because it represents a destructive action, but should be set to `true` in most cases.

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