-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
32,895 additions
and
6,697 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
root: ./docgen/docs | ||
|
||
structure: | ||
readme: README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 1inch limit order protocol | ||
|
||
https://github.com/1inch/limit-order-protocol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# {{{name}}} | ||
|
||
{{{title}}} | ||
{{{natspec.userdoc}}} | ||
{{{natspec.devdoc}}} | ||
|
||
{{#if ownFunctions}} | ||
## Functions | ||
{{/if}} | ||
|
||
{{#ownFunctions}} | ||
### `{{name}}({{args}}){{#if outputs}} → {{outputs}}{{/if}}` | ||
{{#if natspec.devdoc}}{{natspec.devdoc}}{{else}}{{#if natspec.userdoc}}{{natspec.userdoc}}{{else}}No description{{/if}}{{/if}} | ||
|
||
{{#if natspec.params}} | ||
#### Parameters: | ||
{{#natspec.params}} | ||
- `{{param}}`: {{description}} | ||
{{/natspec.params}} | ||
{{/if}} | ||
{{#if natspec.returns}} | ||
#### Return Values: | ||
{{#natspec.returns}} | ||
- {{param}} {{description}} | ||
{{/natspec.returns}} | ||
{{/if}} | ||
|
||
{{/ownFunctions}} | ||
|
||
|
||
{{#if ownEvents}} | ||
## Events | ||
{{/if}} | ||
|
||
{{#ownEvents}} | ||
### `{{name}}({{args}})` | ||
{{#if natspec.devdoc}}{{natspec.devdoc}}{{else}}No description{{/if}} | ||
|
||
{{#if natspec.params}} | ||
#### Parameters: | ||
{{#natspec.params}} | ||
- `{{param}}`: {{description}} | ||
{{/natspec.params}} | ||
{{/if}} | ||
{{/ownEvents}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const INPUT_DIR = "contracts"; | ||
const BASE_DIR = "docgen"; | ||
const OUTPUT_DIR = "docgen/docs"; | ||
const SOLC_NPM_NAME = "solc"; | ||
|
||
const fs = require("fs"); | ||
const path = require("path"); | ||
const spawn = require('cross-spawn') | ||
|
||
function runProcess(name, args) { | ||
console.log(`running ${name} with args ${JSON.stringify(args)}`); | ||
const result = spawn.sync(name, args, {stdio: ["inherit", "inherit", "pipe"]}); | ||
if (result.stderr.length > 0) | ||
throw new Error(result.stderr); | ||
} | ||
|
||
function generateGitbookFiles() { | ||
fs.copyFileSync(path.join(BASE_DIR, "README.md"), path.join(OUTPUT_DIR, "README.md")) | ||
} | ||
|
||
const solidityDocgenArgs = [ | ||
"solidity-docgen", | ||
"-i", | ||
INPUT_DIR, | ||
"-o", | ||
OUTPUT_DIR, | ||
"--solc-module", | ||
SOLC_NPM_NAME, | ||
"--solc-settings", | ||
JSON.stringify({optimizer: {enabled: false}}), | ||
"--templates", | ||
BASE_DIR | ||
]; | ||
|
||
runProcess("npx", solidityDocgenArgs); | ||
generateGitbookFiles(); |
Oops, something went wrong.