Skip to content

Commit c82e1e2

Browse files
committed
docs: clarify docs
1 parent 3aef583 commit c82e1e2

File tree

3 files changed

+25
-18
lines changed

3 files changed

+25
-18
lines changed

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ today = ["chrono"]
2020
test_lib = []
2121

2222
[dependencies]
23+
24+
# Template dependencies
2325
chrono = { version = "0.4.31", optional = true }
2426
dhat = { version = "0.3.2", optional = true }
2527
pico-args = "0.5.0"
26-
tinyjson = "2"
28+
tinyjson = "2.5.1"
29+
30+
# Solution dependencies

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Individual solutions live in the `./src/bin/` directory as separate binaries. _I
5252
Every [solution](https://github.com/fspoettel/advent-of-code-rust/blob/main/src/template.txt) has _tests_ referencing its _example_ file in `./data/examples`. Use these tests to develop and debug your solutions against the example input. In VS Code, `rust-analyzer` will display buttons for running / debugging these unit tests above the unit test blocks.
5353

5454
> [!TIP]
55-
> If a day has different example inputs for both parts, you can use the `read_file_part()` helper in your tests instead of `read_file()`. For example, if this applies to day 1, you can create a second example file `01-2.txt` and invoke the helper like `let result = part_two(&advent_of_code::template::read_file_part("examples", DAY, 2));` to read it in `test_part_two`.
55+
> If a day has multiple example inputs, you can use the `read_file_part()` helper in your tests instead of `read_file()`. If this e.g. applies to day 1, you can create a second example file `01-2.txt` and invoke the helper like `let result = part_two(&advent_of_code::template::read_file_part("examples", DAY, 2));`. This supports an arbitrary number of example files.
5656
5757
### ➡️ Download input for a day
5858

@@ -98,7 +98,7 @@ For example, running a benchmarked, optimized execution of day 1 would look like
9898
> [!IMPORTANT]
9999
> This requires [installing the aoc-cli crate](#configure-aoc-cli-integration).
100100
101-
In order to submit part of a solution for checking, append the `--submit <part>` option to the `solve` command.
101+
Append the `--submit <part>` option to the `solve` command to submit your solution for checking.
102102

103103
### ➡️ Run all solutions
104104

@@ -120,7 +120,7 @@ This runs all solutions sequentially and prints output to the command-line. Same
120120

121121
### ➡️ Update readme benchmarks
122122

123-
The template can write benchmark times to the README via the `cargo time` command.
123+
The template can write benchmark times to the readme via the `cargo time` command.
124124

125125
By default, this command checks for missing benchmarks, runs those solutions, and then updates the table. If you want to (re-)time all solutions, run `cargo time --all`. If you want to (re-)time one specific solution, run `cargo time <day>`.
126126

@@ -134,18 +134,6 @@ cargo test
134134

135135
To run tests for a specific day, append `--bin <day>`, e.g. `cargo test --bin 01`. You can further scope it down to a specific part, e.g. `cargo test --bin 01 part_one`.
136136

137-
### ➡️ Format code
138-
139-
```sh
140-
cargo fmt
141-
```
142-
143-
### ➡️ Lint code
144-
145-
```sh
146-
cargo clippy
147-
```
148-
149137
### ➡️ Read puzzle description
150138

151139
> [!IMPORTANT]
@@ -196,12 +184,24 @@ cargo today
196184
# ...the input...
197185
```
198186

187+
### ➡️ Format code
188+
189+
```sh
190+
cargo fmt
191+
```
192+
193+
### ➡️ Lint code
194+
195+
```sh
196+
cargo clippy
197+
```
198+
199199
## Optional template features
200200

201201
### Configure aoc-cli integration
202202

203203
1. Install [`aoc-cli`](https://github.com/scarvalhojr/aoc-cli/) via cargo: `cargo install aoc-cli --version 0.12.0`
204-
2. Create an `.adventofcode.session` file in your home directory and paste your session cookie. To retrieve the session cookie, press F12 anywhere on the Advent of Code website to open your browser developer tools. Look in _Cookies_ under the _Application_ or _Storage_ tab, and copy out the `session` cookie value. [^1]
204+
2. Create the file `<home_directory>/.adventofcode.session` and paste your session cookie into it. To retrieve the session cookie, press F12 anywhere on the Advent of Code website to open your browser developer tools. Look in _Cookies_ under the _Application_ or _Storage_ tab, and copy out the `session` cookie value. [^1]
205205

206206
Once installed, you can use the [download command](#download-input--description-for-a-day), the read command, and automatically submit solutions via the [`--submit` flag](#submitting-solutions).
207207

@@ -229,7 +229,7 @@ Go to the _Variables_ tab in your repository settings and create the following v
229229

230230
✨ You can now run this action manually via the _Run workflow_ button on the workflow page. If you want the workflow to run automatically, uncomment the `schedule` section in the `readme-stars.yml` workflow file or add a `push` trigger.
231231

232-
### Check code formatting / clippy lints in CI
232+
### Enable code formatting / clippy checks in the CI
233233

234234
Uncomment the respective sections in the `ci.yml` workflow.
235235

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
pub mod template;
2+
3+
// Use this file to add helper functions and additional modules.
4+

0 commit comments

Comments
 (0)