Skip to content

Commit 8095aeb

Browse files
committed
fix: improve formatting of example code blocks in apply-diff-file.md and README generation for better readability
1 parent 658e620 commit 8095aeb

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

contents/apply-diff-file.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,25 @@
44

55
# Apply Diff File
66

7-
87
![Category: Patch & Diff](https://img.shields.io/badge/Category-Patch%20%26%20Diff-blue)
98

109
#### Command
10+
1111
```sh
1212
git apply changes.diff
1313
```
1414

1515
#### Examples
16+
1617
- **Apply a diff file of uncommitted changes.**
1718

1819
```sh
19-
git apply changes.diff```
20+
git apply changes.diff
21+
```
22+
2023
- **Show what would change if the diff were applied.**
2124

22-
```sh
25+
````sh
2326
git apply --stat changes.diff```
2427
2528
@@ -32,3 +35,4 @@ git apply --stat changes.diff```
3235
---
3336

3437
_Author: mike-rambil • Updated: 2024-06-10 • Tags: diff, apply, uncommitted_
38+
````

scripts/generate-readme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function renderExamples(examples) {
9797
if (!examples || !examples.length) return '';
9898
let out = '';
9999
examples.forEach((ex) => {
100-
out += `- **${ex.description || ''}**\n\n\`\`\`sh\n${ex.code}\`\`\`\n`;
100+
out += `- **${ex.description || ''}** \n\n \`\`\`sh\n${ex.code}\`\`\`\n`;
101101
});
102102
return renderSection('Examples', out);
103103
}

0 commit comments

Comments
 (0)