OpenZeppelin / solidity-docgen

Documentation generator for Solidity projects
MIT License
450 stars 118 forks source link

Support for Foundry #427

Closed PaulRBerg closed 1 year ago

PaulRBerg commented 1 year ago

It is currently not possible to use solidity-docgen in a Foundry-based project - or at least, it is not possible to change the default settings.

frangio commented 1 year ago

It should be possible to wire it up for use with Foundry by passing in the solc output as described here in the readme.

What would you expect usage with Foundry to look like? I'm not familiar with extending Foundry so I don't know if it would be some sort of plugin or a Solidity library or what.

PaulRBerg commented 1 year ago

I think what I was getting at is to turn this into a CLI, so that solidity-docgen can be run from the command-line and users don't have to import it in a Node.js environment anymore.

In Foundry, there is the ffi cheatcode, which lets users run arbitrary shell commands from within Solidity.

samlaf commented 1 year ago

I managed to get solidity-docgen to work with Foundry by using https://book.getfoundry.sh/config/hardhat

PaulRBerg commented 1 year ago

I just found out that Foundry offers a similar functionality to solidity-docgen natively.

There is forge cmd, which parses NatSpec comments to autogenerate documentation.

I will close this issue.