OpenZeppelin / solidity-docgen

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

Natspec-only docs #414

Open theodale opened 1 year ago

theodale commented 1 year ago

Could we have an config option to only generate docs for items with natspec documentation, i.e. contracts, interfaces, libraries, functions, and events. I comment all these accordingly, but often have uncommented internal/private items. As such, the generated docs have many redundant entries. It would be nice to have a natspec only option.

frangio commented 1 year ago

This is an interesting idea. You should be able to implement it in solidity-docgen 0.6 with a custom template that renders conditionally if item.documentation is defined.

d1onys1us commented 1 year ago

This is an interesting idea. You should be able to implement it in solidity-docgen 0.6 with a custom template that renders conditionally if item.documentation is defined.

do you know what would be needed to conditionally render / omit private/internal items? i noticed item.documentation will simply exclude the @dev tags.

frangio commented 1 year ago

Private items should always be omitted automatically. It doesn't make sense to document them as they are not part of the interface.

Internal items you can omit by filter by item.visibility.

Is this related to this issue though? If not, please open another issue I can share more details.

theodale commented 1 year ago

I also think it should be default