Closed gruvin closed 4 months ago
In fact, why not simply reverse the logic to only include 'public'?
This is configurable.
Create a docs-templates
directory and configure the plugin to use it in hardhat.config.js
:
docgen: {
templates: 'docs-templates',
}
Add docs-templates/contract.hbs
:
{{>common}}
{{#each items}}
{{#unless (eq visibility "internal")}}
{{#hsection}}
{{>item}}
{{/hsection}}
{{/unless}}
{{/each}}
Oh! Thanks for that.
I tried to find such a think in the source code, since there doesn't seem to be any documentation yet but I'm too n00bish. ;-)
Functions with visibility 'private' are currently hard-coded to be excluded. I note that others also would like this not to be the case at times.
I wish to also exclude 'internal' functions from public facing documentation.
I use 'internal' over 'private' in cases where functions or state variables are not 'public' but I need to audit their values or effects by sub-classing (extending) the main contract with utility test functions. Derived contract (those extended from others) cannot access private variables or override private functions but can do so with 'internal' variants. In either case, I have no desire for public facing documentation to include private or internal functions.
Thanks! :-)