Hi,
I just installed solc with homebrew on macOS Catalina because I want to make use of the Documentation Output generatorsolc --userdoc --devdoc . (And because I was to lazy to get openzeppelin’s solidity-docgen working. The command seems to be broken/unlinked:
Back to the solc problem:
However, solc seems to have problems with the @openzeppelinimport statements.
pragma solidity ^0.5.0;
import "@openzeppelin/upgrades/contracts/Initializable.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20Detailed.sol";
/**
* @title SimpleToken
* @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator.
* Note they can later distribute these tokens as they wish using `transfer` and other
* `ERC20` functions.
*/
contract Token is Initializable, ERC20, ERC20Detailed {
/**
* @dev initialize that gives msg.sender all of existing tokens.
*/
function initialize(address sender) public initializer {
ERC20Detailed.initialize("Token", "TKN", 18);
_mint(sender, 1000000 * (10 ** uint256(decimals())));
}
}
Hey there! I understand that solidity-docgen is a bit hard to use right now due to lack of documentation, but I’m willing to help you get it set up and customized. It fixes many shortcomings of solc’s native natspec support and gives you a lot of flexibility to achieve whatever kind of documentation you want. The output is completely customizable using Handlebars templates.
@abcoathup’s instructions should get you started. If you want to do any sort of customization of the output, let me know and I’ll guide you through it.
The only thing I’d add to @abcoathup is that it’s possible to use a shorter command since all of our packages share the @openzeppelin prefix:
Hi everyone. The latest solidity-docgen includes out of the box support for dependencies. I haven’t tested it extensively myself so please give it a shot and let me know how it goes.