Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ETHEREUM-CONTRACTS] Integrate solidity-docgen for dev branch #383

Closed
hellwolf opened this issue Aug 9, 2021 · 3 comments · Fixed by #880
Closed

[ETHEREUM-CONTRACTS] Integrate solidity-docgen for dev branch #383

hellwolf opened this issue Aug 9, 2021 · 3 comments · Fixed by #880
Assignees
Labels
Type: Documentation Improvements or additions to documentation

Comments

@hellwolf
Copy link
Contributor

hellwolf commented Aug 9, 2021

Summary

In order to make the https://docs.superfluid.finance site an one-stop shop for our developers, we would like to host our reference docs for both ethereum-contracts, generated by solidity-docgen and jsdoc.

Technical Description

(To be finalized)

  1. Our doc site is a gitbook project available at https://github.com/superfluid-finance/superfluid-protocol-docs
  2. Integrate solidity-docgen and jsdoc as part of ci-canary workflow.
  3. Generated docs should be to hosted and referenced in superfluid docs site nicely (how?)

Bounty Info

Bounty Prize: TBD

Bonus question:

  • How about the subgraph reference docs?
@hellwolf hellwolf added the Tag: Bounty Things that has a bounty on them label Aug 9, 2021
@hellwolf hellwolf added the Type: Documentation Improvements or additions to documentation label Aug 9, 2021
@hellwolf hellwolf changed the title [DOC] Integrate solidity-docgen and jsdoc for dev branch [DOCS] Integrate solidity-docgen and jsdoc for dev branch Sep 13, 2021
@hellwolf hellwolf removed the Tag: Bounty Things that has a bounty on them label Feb 17, 2022
@hellwolf hellwolf changed the title [DOCS] Integrate solidity-docgen and jsdoc for dev branch [ETHEREUM-CONTRACTS] Integrate solidity-docgen and jsdoc for dev branch May 11, 2022
@hellwolf hellwolf changed the title [ETHEREUM-CONTRACTS] Integrate solidity-docgen and jsdoc for dev branch [ETHEREUM-CONTRACTS] Integrate solidity-docgen for dev branch May 11, 2022
@d10r
Copy link
Collaborator

d10r commented May 25, 2022

Custom styling can be applied to the output, see e.g. https://docs.uniswap.org/protocol/reference/core/UniswapV3Factory

There was a rewrite of solidity-docgen (between v0.5 and v0.6), see OpenZeppelin/solidity-docgen#350.
Best usage example for v0.6 I found: frangio/hifi@abea0bc

@d10r
Copy link
Collaborator

d10r commented May 25, 2022

Note that the tool will fail if there's @return tags without description. For other tags, that's already flagged by solhint, but not for this one.

Next: figure out what we want to include in the docs (e.g. only interfaces?) and how to style.

First shot with vanilla config

Second shot with this template files

@d10r
Copy link
Collaborator

d10r commented Jun 3, 2022

cmd for quickly iterating on natspec and templates:

cd packages/ethereum-contracts
nodemon -w docs/docgen-templates/ -w contracts/ -e hbs,sol --exec npx hardhat docgen

Issues/improvements partially left after first PR:

  • clarify our use of @notice vs @dev tags and the order in which to show, currently inconsistent (see e.g. registerAppWithKey)
  • (higher order) comment blocks not specific to particular functions (especially in ISuperfluid.sol) are currently lost, they are not natspec items. Need to figure out a way to include them, e.g. by splitting up into sub-interfaces or making them interface-wide doc
  • line breaks in @params and @returns items not supported. Make sure we don't have that
  • if tags stand alone on a line (often the case with @Custom tags), a trailing whitespaces is needed for the parser to catch them. Currently the case, but I'm afraid linters/editors may auto-remove them. Could probably be fixed in the parser.
  • structs doc currently missing (see Context)
  • check if we have custom errors to be included
  • all non-natspec tags (e.g. NOTE, Security) should be @Custom tags.
  • wanted to print the content of @dev tags italic, but that breaks for multi-paragraph items
  • the gitbook search index wasn't cleaned of (re)moved entries. Helpdesk request was sent
  • better separation btw. item type and item name (e.g. "(Fn) distribute", or with colors/grey tone) - see Automated generation and publishing of contract API docs with solidity-docgen #880 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation Improvements or additions to documentation
Projects
None yet
2 participants