aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-doc
diff options
context:
space:
mode:
authorF. Eugene Aumson <gene@aumson.org>2018-08-30 23:30:43 +0800
committerF. Eugene Aumson <gene@aumson.org>2018-08-30 23:30:43 +0800
commitf55234b4a04a3a26e6eda05a5c77a6bd984571ba (patch)
treef1f55bc1b6387aff556d197f542453a45f132c89 /packages/sol-doc
parentf76c88c5491a9ec3a6b902b291dcfaf8ac64ecd5 (diff)
downloaddexon-sol-tools-f55234b4a04a3a26e6eda05a5c77a6bd984571ba.tar
dexon-sol-tools-f55234b4a04a3a26e6eda05a5c77a6bd984571ba.tar.gz
dexon-sol-tools-f55234b4a04a3a26e6eda05a5c77a6bd984571ba.tar.bz2
dexon-sol-tools-f55234b4a04a3a26e6eda05a5c77a6bd984571ba.tar.lz
dexon-sol-tools-f55234b4a04a3a26e6eda05a5c77a6bd984571ba.tar.xz
dexon-sol-tools-f55234b4a04a3a26e6eda05a5c77a6bd984571ba.tar.zst
dexon-sol-tools-f55234b4a04a3a26e6eda05a5c77a6bd984571ba.zip
comment public interface
Diffstat (limited to 'packages/sol-doc')
-rw-r--r--packages/sol-doc/src/solidity_doc_generator.ts14
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;