Skip to content

Commit

Permalink
Added structs to docs output
Browse files Browse the repository at this point in the history
  • Loading branch information
asselstine committed Dec 17, 2021
1 parent 511e016 commit f78cda0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "GPL-3.0",
"scripts": {
"clean": "rm -rf cache/ artifacts/",
"docs": "solidity-docgen --solc-module solc -i contracts -o docs -t templates",
"docs": "solidity-docgen --solc-module solc-0.8 -i contracts -o docs -t templates",
"compile": "mkdir -p abis && hardhat --show-stack-traces --max-memory 8192 compile",
"coverage": "HIDE_DEPLOY_LOG=true OPTIMIZER_DISABLED=true hardhat coverage",
"coverage:file": "HIDE_DEPLOY_LOG=true OPTIMIZER_DISABLED=true hardhat coverage --testfiles",
Expand Down Expand Up @@ -64,6 +64,7 @@
"prettier": "2.4.1",
"prettier-plugin-solidity": "1.0.0-beta.18",
"solc": "0.8.6",
"solc-0.8": "npm:solc@0.8.6",
"solhint": "3.3.3",
"solidity-coverage": "0.7.16",
"solidity-docgen": "0.5.15",
Expand Down
20 changes: 20 additions & 0 deletions templates/contract.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
{{{natspec.userdoc}}}
{{{natspec.devdoc}}}

{{#each ownStructs}}
### `{{name}}`

{{#each members}}
- {{type}} {{name}}
{{/each}}

{{/each}}

{{#each ownEnums}}
### `{{name}}`

All members: {{members}}

{{#each members}}
- {{.}}
{{/each}}

{{/each}}
{{#if functions}}
## Functions
{{/if}}
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8368,10 +8368,10 @@ snapdragon@^0.8.1:
source-map-resolve "^0.5.0"
use "^3.1.0"

solc@0.7.3:
version "0.7.3"
resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a"
integrity sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA==
"solc-0.8@npm:solc@0.8.6", solc@0.8.6:
version "0.8.6"
resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.6.tgz#e4341fa6780137df97b94a0cfbd59b3f2037d0e0"
integrity sha512-miiDaWdaUnD7A6Cktb/2ug9f+ajcOCDYRr7vgbPEsMoutSlBtp5rca57oMg8iHSuM7jilwdxePujWI/+rbNftQ==
dependencies:
command-exists "^1.2.8"
commander "3.0.2"
Expand All @@ -8383,10 +8383,10 @@ solc@0.7.3:
semver "^5.5.0"
tmp "0.0.33"

solc@0.8.6:
version "0.8.6"
resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.6.tgz#e4341fa6780137df97b94a0cfbd59b3f2037d0e0"
integrity sha512-miiDaWdaUnD7A6Cktb/2ug9f+ajcOCDYRr7vgbPEsMoutSlBtp5rca57oMg8iHSuM7jilwdxePujWI/+rbNftQ==
solc@0.7.3:
version "0.7.3"
resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a"
integrity sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA==
dependencies:
command-exists "^1.2.8"
commander "3.0.2"
Expand Down

0 comments on commit f78cda0

Please sign in to comment.