Skip to content

Convert NatSpec comments to a static documentation site automatically on contract compilation πŸ“

License

Notifications You must be signed in to change notification settings

thesandboxgame/hardhat-docgen

This branch is 6 commits ahead of, 20 commits behind ItsNickBarry/hardhat-docgen:master.

Repository files navigation

Hardhat Docgen

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

Installation

yarn add --dev hardhat-docgen

Usage

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 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.

The included Hardhat task may be run manually; however, it is imperative that the compile task be run at least once after plugin installation to ensure that the correct compiler options are set:

yarn run hardhat docgen

About

Convert NatSpec comments to a static documentation site automatically on contract compilation πŸ“

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 63.5%
  • Vue 35.1%
  • HTML 1.4%