Skip to content

Commit 6c30330

Browse files
authored
Run markdown files through Prettier (#292)
1 parent 32d24ff commit 6c30330

File tree

14 files changed

+73
-72
lines changed

14 files changed

+73
-72
lines changed

.github/workflows/run-configlet-sync.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Run Configlet Sync
33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: '0 0 15 * *'
6+
- cron: "0 0 15 * *"
77

88
jobs:
99
call-gha-workflow:

.prettierignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22
# - install it in the track root dir: `npm install prettier`
33
# - note the .gitignore file
44
# - check the status without writing changes: `npx prettier --check .`
5-
# - the above, verbosely: `npx prettier --check --loglevel debug .`
5+
# - the above, verbosely: `npx prettier --check --log-level debug .`
66
# - preview the changes: (using https://dandavison.github.io/delta/)
77
# - fish: `set f some.file; delta $f (npx prettier $f | psub)`
88
# - bash: `f="some.file"; delta "$f" <(npx prettier "$f")`
99
# - write the changes: `npx prettier --write .`
1010

11+
# prettier wants to convert exercism markdown admonition blocks to code fences.
12+
# from: ~~~~exercism/note
13+
# to: ```exercism/note
14+
# I don't know how to configure this behaviour away.
15+
# Don't write those changes into git.
16+
1117
# ignore files written by configlet or Exercism org-wide files
1218
exercises/practice/*/.meta/config.json
1319
exercises/practice/*/.docs/instructions.md
@@ -17,3 +23,6 @@ CODE_OF_CONDUCT.md
1723
generate_tests.json
1824
.github/pull_request_template.md
1925
exercises/concept/*/.meta/config.json
26+
config.json
27+
exercises/practice/*/.docs/introduction.md
28+
exercises/practice/*/.docs/instructions.md

concepts/basics/about.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ Without going into great depth (functions will be a topic for another exercise),
340340
- [`select`][man-select]
341341

342342
Given _some_ input and a filter as an argument:
343-
344343
- if the filter applied to the argument results in a _true_ value, output the input unchanged
345344
- otherwise, output _nothing_ (not the `null` value, truly no output)
346345

@@ -362,7 +361,6 @@ Without going into great depth (functions will be a topic for another exercise),
362361
There are a couple of ways to do this.
363362

364363
With the input `["Anne", "Bob", "Cathy", "Dave"]`, select the names having length 4.
365-
366364
- use `map` and `select` together
367365

368366
```jq

concepts/basics/introduction.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ Without going into great depth (functions will be a topic for another exercise),
290290
- `select`
291291

292292
Given _some_ input and a filter as an argument:
293-
294293
- if the filter applied to the argument results in a _true_ value, output the input unchanged
295294
- otherwise, output _nothing_ (not the `null` value, truly no output)
296295

@@ -312,7 +311,6 @@ Without going into great depth (functions will be a topic for another exercise),
312311
There are a couple of ways to do this.
313312

314313
With the input `["Anne", "Bob", "Cathy", "Dave"]`, select the names having length 4.
315-
316314
- use `map` and `select` together
317315

318316
```jq

concepts/conditionals/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if A then B else . end
2727
if A then B end
2828
```
2929
30-
The `else` clause is **mandatory** in the previous v1.6 release.
30+
The `else` clause is **mandatory** in the previous v1.6 release.
3131
Omitting it produces errors.
3232
3333
```sh

concepts/conditionals/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if A then B else . end
2727
if A then B end
2828
```
2929
30-
The `else` clause is **mandatory** in the previous v1.6 release.
30+
The `else` clause is **mandatory** in the previous v1.6 release.
3131
~~~~
3232

3333
## Nested If-Statements

docs/DEBUGGING.md

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,49 +10,48 @@ The second element depends on how you invoke `debug`.
1010

1111
1. the zero-arity debug function puts a compact representation of the input into the debug array:
1212

13-
```sh
14-
jq -n '[11, 22, 33] | debug | map(. * 2)'
15-
```
13+
```sh
14+
jq -n '[11, 22, 33] | debug | map(. * 2)'
15+
```
1616

17-
outputs
17+
outputs
1818

19-
```none
20-
["DEBUG:",[11,22,33]]
21-
[
22-
22,
23-
44,
24-
66
25-
]
26-
```
19+
```none
20+
["DEBUG:",[11,22,33]]
21+
[
22+
22,
23+
44,
24+
66
25+
]
26+
```
2727

2828
2. the one-arity version pipes the input through the given filter:
2929

30-
```sh
31-
jq -n '[11, 22, 33] | debug("length: \(length), last: \(.[-1])") | map(. * 2)'
32-
```
33-
34-
```none
35-
["DEBUG:","length: 3, last: 33"]
36-
[
37-
22,
38-
44,
39-
66
40-
]
41-
```
42-
43-
The filter doesn't need to be a string.
44-
It can be anything, including multiple comma-separated expressions for "multi-line" debug output:
45-
46-
```sh
47-
jq -n '[11, 22, 33] as $a | 44 | debug("I am here:", $a, .)'
48-
```
49-
50-
```none
51-
["DEBUG:","I am here:"]
52-
["DEBUG:",[11,22,33]]
53-
["DEBUG:",44]
54-
44
55-
```
56-
30+
```sh
31+
jq -n '[11, 22, 33] | debug("length: \(length), last: \(.[-1])") | map(. * 2)'
32+
```
33+
34+
```none
35+
["DEBUG:","length: 3, last: 33"]
36+
[
37+
22,
38+
44,
39+
66
40+
]
41+
```
42+
43+
The filter doesn't need to be a string.
44+
It can be anything, including multiple comma-separated expressions for "multi-line" debug output:
45+
46+
```sh
47+
jq -n '[11, 22, 33] as $a | 44 | debug("I am here:", $a, .)'
48+
```
49+
50+
```none
51+
["DEBUG:","I am here:"]
52+
["DEBUG:",[11,22,33]]
53+
["DEBUG:",44]
54+
44
55+
```
5756

5857
[debug]: https://jqlang.github.io/jq/manual/#debug

exercises/concept/shopping/.docs/introduction.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ Without going into great depth (functions will be a topic for another exercise),
292292
- `select`
293293

294294
Given _some_ input and a filter as an argument:
295-
296295
- if the filter applied to the argument results in a _true_ value, output the input unchanged
297296
- otherwise, output _nothing_ (not the `null` value, truly no output)
298297

@@ -314,7 +313,6 @@ Without going into great depth (functions will be a topic for another exercise),
314313
There are a couple of ways to do this.
315314

316315
With the input `["Anne", "Bob", "Cathy", "Dave"]`, select the names having length 4.
317-
318316
- use `map` and `select` together
319317

320318
```jq

exercises/concept/vehicle-purchase/.docs/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ if A then B else . end
109109
if A then B end
110110
```
111111
112-
The `else` clause is **mandatory** in the previous v1.6 release.
112+
The `else` clause is **mandatory** in the previous v1.6 release.
113113
~~~~
114114

115115
### Nested If-Statements

exercises/practice/flatten-array/.docs/instructions.append.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Try to solve this yourself without using the builtin `flatten` function to get t
77

88
<details><summary>Click here for hints:</summary>
99

10-
* A recursive function can be useful.
10+
- A recursive function can be useful.
1111
Learn more about recursion in the [Recursion lesson][recur].
12-
* The [`type`][type] function can help.
12+
- The [`type`][type] function can help.
1313
</details>
1414

1515
[flatten]: https://jqlang.github.io/jq/manual/v1.7/#flatten

0 commit comments

Comments
 (0)