Skip to content

Commit dc3513b

Browse files
committed
docs: separate cli and gui docs
1 parent c3412a1 commit dc3513b

File tree

5 files changed

+60
-8
lines changed

5 files changed

+60
-8
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# clipboard [![PkgGoDev](https://pkg.go.dev/badge/golang.design/x/clipboard)](https://pkg.go.dev/golang.design/x/clipboard) ![](https://changkun.de/urlstat?mode=github&repo=golang-design/clipboard) ![clipboard](https://github.com/golang-design/clipboard/workflows/clipboard/badge.svg?branch=main)
22

3-
Cross platform clipboard package in Go
3+
Cross platform (macOS/Linux/Windows/Android/iOS) clipboard package in Go
44

55
```go
66
import "golang.design/x/clipboard"
@@ -12,7 +12,7 @@ import "golang.design/x/clipboard"
1212
- Copy/paste UTF-8 text
1313
- Copy/paste PNG encoded images (Desktop-only)
1414
- Command `gclip` as a demo application
15-
- Mobile app `Gclip` as a demo application
15+
- Mobile app `gclip-gui` as a demo application
1616

1717
## API Usage
1818

@@ -62,6 +62,12 @@ for data := range ch {
6262
}
6363
```
6464

65+
## Demos
66+
67+
- A command line tool `gclip` for command line clipboard accesses, see document [here](./cmd/gclip/README.md).
68+
- A GUI application `gclip-gui` for functionality verifications on mobile systems, see a document [here](./cmd/gclip-gui/README.md).
69+
70+
6571
## Command Usage
6672

6773
`gclip` command offers the ability to interact with the system clipboard

clipboard.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
// Written by Changkun Ou <changkun.de>
66

77
/*
8-
Package clipboard provides three major APIs for manipulating the
9-
clipboard: `Read`, `Write`, and `Watch`. The most common operations are
10-
`Read` and `Write`. To use them:
8+
Package clipboard provides cross platform clipboard access and supports
9+
macOS/Linux/Windows/Android/iOS platform. There are three major APIs
10+
to interact with the clipboard: `Read`, `Write`, and `Watch`.
11+
12+
The most common operations are `Read` and `Write`. To use them:
1113
1214
// write/read text format data of the clipboard, and
1315
// the byte buffer regarding the text are UTF8 encoded.

cmd/gclip-gui/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ provided in the [GoMobile wiki](https://github.com/golang/go/wiki/Mobile) page.
2222

2323
## Screenshots
2424

25-
| macOS | iOS |
26-
|:------:|:---:|
27-
|![](./darwin.png)|![](./ios.png)|
25+
| macOS | iOS | Windows |
26+
|:------:|:---:|:------:|
27+
|![](./darwin.png)|![](./ios.png)|![](./windows.png)
28+
29+
## License
30+
31+
MIT | &copy; 2021 The golang.design Initiative Authors, written by [Changkun Ou](https://changkun.de).

cmd/gclip-gui/windows.png

20.1 KB
Loading

cmd/gclip/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# gclip
2+
3+
`gclip` command offers the ability to interact with the system clipboard
4+
from the shell. To install:
5+
6+
```bash
7+
$ go install golang.design/x/clipboard/cmd/gclip@latest
8+
```
9+
10+
```bash
11+
$ gclip
12+
gclip is a command that provides clipboard interaction.
13+
usage: gclip [-copy|-paste] [-f <file>]
14+
options:
15+
-copy
16+
copy data to clipboard
17+
-f string
18+
source or destination to a given file path
19+
-paste
20+
paste data from clipboard
21+
examples:
22+
gclip -paste paste from clipboard and prints the content
23+
gclip -paste -f x.txt paste from clipboard and save as text to x.txt
24+
gclip -paste -f x.png paste from clipboard and save as image to x.png
25+
cat x.txt | gclip -copy copy content from x.txt to clipboard
26+
gclip -copy -f x.txt copy content from x.txt to clipboard
27+
gclip -copy -f x.png copy x.png as image data to clipboard
28+
```
29+
30+
If `-copy` is used, the command will exit when the data is no longer
31+
available from the clipboard. You can always send the command to the
32+
background using a shell `&` operator, for example:
33+
34+
```bash
35+
$ cat x.txt | gclip -copy &
36+
```
37+
38+
## License
39+
40+
MIT | &copy; 2021 The golang.design Initiative Authors, written by [Changkun Ou](https://changkun.de).

0 commit comments

Comments
 (0)