Skip to content

Commit

Permalink
Advice: copying the output of the tool directly from CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
TrifanBogdan24 committed Oct 25, 2024
1 parent 7d0d8df commit 797bcad
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ $ html_md_youtube_card https://www.youtube.com/shorts/Nl9pcj79byY?feature=share

- STEP 3: Remove the temporary file


```bash
$ rm -f tmp.md
```
Expand All @@ -252,3 +253,49 @@ $ rm -f tmp.md
> Give it more tries.
> It might not work as expected in the first place.


## Copying the output of the CLI tool directly to `clipboard`


An alternative approach for the above advice would to
use an additional **command line tool**, that
being **piped** the output of `html_md_youtube_card`,
it will copy it directly to **clipboard**.


On Linux, you can use `xclip`:
```bash
$ sudo apt-get install xclip


$ html_md_youtube_card $ULR | xclip -selection clipboard
$ python3 html_md_youtube_card.py $URL | xclip -selection clipboard


# It's a great ideea to alias it and place it in your configuration file
$ echo "alias clip='xclip -selection clipboard'" >> ~/.bashrc
$ source ~/.bahrc
$ type clip
```




On MacOS, you can use `pbcopy`:
```sh
$ html_md_youtube_card $URL | pbcopy
$ python3 html_md_youtube_card.py $URL | pbcopy
```


On Windows, you can use `clip`
```powershell
> html_md_youtube_card $URL | clip
> python3 html_md_youtube_card.py $URL | clip
```




> Source of inspiration: <https://medium.com/@brianislevu/navigating-with-the-keyboard-4528267ce6b3>

0 comments on commit 797bcad

Please sign in to comment.