Skip to content

Commit

Permalink
chore: update terminal output (#171)
Browse files Browse the repository at this point in the history
* chore: update terminal output

* forge install: ds-test

* refactor: use includes

* chore: remove accidental submodule

* chore: output in script

* chore: slim down project deps

* chore: move output to a shared folder

* chore: automate output for forge-std

* chore: use temp dir for basic project

* chore: convert more chapters

* chore: remove outdated note

* chore: hide draft chapters for now

* chore: convert more chapters

* chore: remove unused `.gitignore`s

* chore: convert more chapters

* chore: convert last chapters

* refactor: split script

* docs: document what the new dirs are

* docs: style guidelines in contributing

* chore: convert final chapter

* chore: final output generation
  • Loading branch information
onbjerg authored Apr 6, 2022
1 parent c7c5c1e commit 4e40e70
Show file tree
Hide file tree
Showing 65 changed files with 5,511 additions and 432 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
book
out
cache
60 changes: 54 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,60 @@ When your pull request is open, other contributors will take a look and may requ

If your pull request is merged, or your issue was addressed, feel free to ping @all-contributors to be added to the README. More information here: https://allcontributors.org/docs/en/bot/overview

### Writing Style
### Writing style

This section documents a few standards for writing used throughout the book.

- Provide console output along with commands, in this format:
#### Chapters start with a second level heading

We use:

```md
## Some Page
```

We do not use:

```md
# Some Page
```

This is largely a stylistic choice.

#### Always use "we" and not "I"

Pretend like you are explaining Foundry to a friend!

#### Where possible, use auto-generated CLI output

As a small change in the Foundry CLIs can have a large impact on the book, most of the CLI output is auto-generated.

Each output file has three anchors you can use:

**Display the command *and* the output**

```handlebars
{{#include ../output/abc/xyz:all}}
```

**Display just the command**

```handlebars
{{#include ../output/abc/xyz:command}}
```

**Display just the output**

```handlebars
{{#include ../output/abc/xyz:output}}
```

You can learn more about auto-generated CLI output in the [output folder](./src/output).

#### Where possible, do NOT in-line Solidity code

In the same vein as the previous style guideline, opt to include source files, or parts of source files, from the [projects folder](./projects).

This allows us to quickly iterate and improve on our examples without having to change multiple pages.

```bash
$ command --goes "here"
Output goes here
```
You can learn more about including files in the [mdbook documentation](https://rust-lang.github.io/mdBook/format/mdbook.html).
3 changes: 3 additions & 0 deletions projects/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Projects

These projects are used to auto-generate CLI output, and for source snippets, throughout the book.
6 changes: 6 additions & 0 deletions projects/cheatcodes/foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[default]
src = 'src'
out = 'out'
libs = ['lib']

# See more config options https://github.com/gakonst/foundry/tree/master/config
674 changes: 674 additions & 0 deletions projects/cheatcodes/lib/ds-test/LICENSE

Large diffs are not rendered by default.

Loading

0 comments on commit 4e40e70

Please sign in to comment.