diff options
author | F. Eugene Aumson <gene@aumson.org> | 2018-08-30 23:30:43 +0800 |
---|---|---|
committer | F. Eugene Aumson <gene@aumson.org> | 2018-08-30 23:30:43 +0800 |
commit | f55234b4a04a3a26e6eda05a5c77a6bd984571ba (patch) | |
tree | f1f55bc1b6387aff556d197f542453a45f132c89 /packages/sol-doc/src | |
parent | f76c88c5491a9ec3a6b902b291dcfaf8ac64ecd5 (diff) | |
download | dexon-0x-contracts-f55234b4a04a3a26e6eda05a5c77a6bd984571ba.tar.gz dexon-0x-contracts-f55234b4a04a3a26e6eda05a5c77a6bd984571ba.tar.zst dexon-0x-contracts-f55234b4a04a3a26e6eda05a5c77a6bd984571ba.zip |
comment public interface
Diffstat (limited to 'packages/sol-doc/src')
-rw-r--r-- | packages/sol-doc/src/solidity_doc_generator.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/packages/sol-doc/src/solidity_doc_generator.ts b/packages/sol-doc/src/solidity_doc_generator.ts index a4eb403a8..f6bbf52ba 100644 --- a/packages/sol-doc/src/solidity_doc_generator.ts +++ b/packages/sol-doc/src/solidity_doc_generator.ts @@ -7,8 +7,16 @@ import { logUtils } from '@0xproject/utils'; import { SolidityDocFormat } from './solidity_doc_format'; +/** + * Compiles solidity files to both their ABI and devdoc outputs, and transforms + * those outputs into the types that feed into documentation generation tools. + */ export class SolidityDocGenerator { private readonly _compilerOptions: CompilerOptions; + /** + * Instantiate the generator. + * @param contractsDir the directory in which to find the contracts to be compiled + */ constructor(contractsDir: string) { // instantiate sol-compiler, passing in options to say we want abi and devdoc this._compilerOptions = { @@ -23,7 +31,11 @@ export class SolidityDocGenerator { }, }; } - /// run `contractsToCompile` through compiler, gathering output + /** + * Invoke the compiler and transform its outputs. + * @param contractsToCompile list of contracts for which to generate doc objects + * @return doc objects for use with documentation generation tools. + */ public async generateAsync(contractsToCompile: string[]): Promise<SolidityDocFormat> { if (!_.isUndefined(contractsToCompile)) { this._compilerOptions.contracts = contractsToCompile; |