Skip to content

Commit 077e0fe

Browse files
authored
Update docs/contracts/README.md and cli.js to take that into account (#308)
1 parent 788ef40 commit 077e0fe

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

docs/contracts/README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
Welcome to the generated documentation!
1+
Welcome to contracts documentation!
22

3-
This directory contains automated documentation generated directly from `.sol` source files.
4-
They include the following info:
3+
This directory includes manual markdown documentation for `contracts` directory.
4+
It follows the directory structure of `contracts` (eg. file `foo/bar.md` documents the `bar` contract in `contracts/foo`).
55

6-
- Gas estimates on constructors & functions.
7-
- Technical information about the exposed public interface of each contract.
8-
- A manual documentation snippet at the top, if available.
6+
Files in this folder will be included in `../generated_docs` (with `yarn docs update`) and merged with automatically generated docs (if available) based on their file name.
7+
*Example: `foo/bar.md` will be merged with automated docs for the contract `bar` in the directory `contracts/foo/`*

scripts/docs/cli.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,13 @@ const clean = (argv,code = 0) => {
8585
*/
8686
const update = (argv) => {
8787
try{
88+
// keep `${argv.output}/README.md`, as we don't want to override it with `${argv.headers}/README.md`
89+
const readme = fs.readFileSync(`${argv.output}/README.md`,'utf-8');
8890
shell.rm('-rf',argv.output);
8991
shell.mkdir(argv.output);
9092
shell.cp('-rf',argv.headers+'/*',argv.output);
93+
// restore `${argv.output}/README.md`
94+
fs.writeFileSync(`${argv.output}/README.md`,readme,'utf-8');
9195
const files = shell.find(argv.input).filter(x => path.extname(x) === '.sol');
9296
print(`Compiling ${files.length} files from ${argv.input} ...`);
9397
const output = compile(files);

0 commit comments

Comments
 (0)