Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support the documentation of global variables
Following [this feature-request](OpenZeppelin#43), extending the `solidity-docgen` package to support the documentation of global variables, which are implicitly added by the compiler as getter functions in the contract. This should allow users to get the natspec-documentation of their global variables added into the `solidity-docgen` output by extending the input template (hbs) file. For example: ``` {{#if ownVariables}} # Variables: {{#ownVariables}} - [`{{type}} {{name}}`](#{{anchor}}) {{/ownVariables}} {{/if}} {{#ownVariables}} # Variable `{{type}} {{name}}` {#{{anchor~}} } {{#if natspec.devdoc}}{{natspec.devdoc}}{{else}}No description{{/if}} {{/ownVariables}} ``` Note that this PR is incomplete, since the `devdoc` of a global variable is always `undefined`. For this reason, I also had to override function `SolidityContractItem.natspec()` in class `SolidityVariable` with a slightly different implementation (since `this.astNode.documentation === undefined`).
- Loading branch information