Package Exports
- hardhat-docgen
- hardhat-docgen/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hardhat-docgen) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Hardhat Docgen
Generate a static documentation site from NatSpec comments automatically on compilation with Hardhat.
Installation
yarn add --dev hardhat-docgenUsage
Load plugin in Hardhat config:
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 |
[] |
docgen: {
path: './docs',
clear: true,
runOnCompile: true,
}The included Hardhat task may be run manually:
yarn run hardhat docgenBy default, the hardhat compile task is run before generating documentation. This behavior can be disabled with the --no-compile flag:
yarn run hardhat docgen --no-compileThe 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.