Skip to content

Commit

Permalink
Add tip about diff code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
annakrystalli committed Jul 23, 2024
1 parent 7255671 commit d7cd67f
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,31 @@ diff -u --color=always $(ls -d */ | sort | tail -n 2 | head -n 1)admin-schema.js
diff -u --color=always $(ls -d */ | sort | tail -n 2 | head -n 1)tasks-schema.json $(ls -d */ | sort | tail -n 1)tasks-schema.json
```

> ### :bulb: Tip
> ### :bulb: Tips
>
> #### Show diff colours in PR
> To show the colour of the diffs in the PR, wrap the output of the commands in a `diff` code block, e.g.
>
> \```diff
> \- old line
> \+ new line
> \```
> is rendered in the PR renders as:
>
> ```diff
> - old line
> + new line
> ```
>
> #### Send output directly to clipboard
> Depending on your system (macOS or Linux), you can pipe the output of the above commands directly to the clipboard. See examples below:
>
> #### macOS:
> ##### macOS:
> ```bash
> diff $(ls -d */ | sort | tail -n 2 | head -n 1)tasks-schema.json $(ls -d */ | sort | tail -n 1)tasks-schema.json | pbcopy
>```
>
> #### Linux:
> ##### Linux:
> Make sure `xclip` is installed. You can install it using your package manager, e.g., `sudo apt-get install xclip` on Debian-based systems.
> ```bash
> diff $(ls -d */ | sort | tail -n 2 | head -n 1)tasks-schema.json $(ls -d */ | sort | tail -n 1)tasks-schema.json | xclip -selection clipboard
Expand Down

0 comments on commit d7cd67f

Please sign in to comment.