Skip to content

Commit

Permalink
Add missing markdown fixes
Browse files Browse the repository at this point in the history
Found via this command:

    markdownlint *.md --disable MD024
  • Loading branch information
kianmeng authored and complexspaces committed Sep 16, 2022
1 parent fd30758 commit 2042cef
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 14 deletions.
21 changes: 17 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,45 @@
# Changelog

## v2.1.1 on 2022-18-05

### Changed
- Fix compilation on FreeBSD

- Fix compilation on FreeBSD
- Internal cleanup and documentation fixes
- Remove direct dependency on the `once_cell` crate.
- Fixed crates.io repository link

## v2.1.0 on 2022-09-03

### Changed

- Updated most dependencies
- Removed crate deprecation
- Fixed soundness bug in Windows clipboard

## v2.0.1 on 2021-11-05

### Changed

- On X11, re-assert clipboard ownership every time the data changes.

## v2.0.0 on 2021-08-07

### Changed

- Update dependency on yanked crate versions
- Make the image operations an optional feature

### Added

- Support selecting which linux clipboard is used

## v1.2.1 on 2021-05-04

### Changed
- Fixed a bug that caused the `set_image` function on Windows to distort the image colors.

- Fixed a bug that caused the `set_image` function on Windows to distort the
image colors.

## v1.2.0 on 2021-04-06

Expand All @@ -41,9 +50,13 @@
## v1.1.0 on 2020-12-29

### Changed
- The `set_image` function on Windows now also provides the image in `CF_BITMAP` format.

- The `set_image` function on Windows now also provides the image in
`CF_BITMAP` format.

## v1.0.2 on 2020-10-29

### Changed
- Fixed the clipboard contents sometimes not being preserved after the program exited.

- Fixed the clipboard contents sometimes not being preserved after the program
exited.
40 changes: 30 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,52 @@
# Arboard (Arthur's Clipboard)

[![Latest version](https://img.shields.io/crates/v/arboard?color=mediumvioletred)](https://crates.io/crates/arboard)
[![Documentation](https://docs.rs/arboard/badge.svg)](https://docs.rs/arboard)

## General

This is a cross-platform library for interacting with the clipboard. It allows to copy and paste both text and image data in a platform independent way on Linux, Mac, and Windows.
This is a cross-platform library for interacting with the clipboard. It allows
to copy and paste both text and image data in a platform independent way on
Linux, Mac, and Windows.

## Linux
## GNU/Linux

The Linux implementation uses the X protocol by default for managing the clipboard but *fear not* because Wayland works with the X11 protocol just as well. Furthermore this implementation uses the Clipboard selection (as opposed to the primary selection) and it sends the data to the clipboard manager when the application exits so that the data placed onto the clipboard with your application remains to be available after exiting.
The GNU/Linux implementation uses the X protocol by default for managing the
clipboard but *fear not* because Wayland works with the X11 protocol just as
well. Furthermore this implementation uses the Clipboard selection (as opposed
to the primary selection) and it sends the data to the clipboard manager when
the application exits so that the data placed onto the clipboard with your
application remains to be available after exiting.

There's also an optional wayland data control backend through the `wl-clipboard-rs` crate. This can be enabled using the `wayland-data-control` feature. When enabled this will be prioritized over the X11 backend, but if the initialization fails, the implementation falls back to using the X11 protocol automatically. Note that in my tests the wayland backend did not keep the clipboard contents after the process exited. (Although neither did the X11 backend on my Wayland setup).
There's also an optional wayland data control backend through the
`wl-clipboard-rs` crate. This can be enabled using the `wayland-data-control`
feature. When enabled this will be prioritized over the X11 backend, but if the
initialization fails, the implementation falls back to using the X11 protocol
automatically. Note that in my tests the wayland backend did not keep the
clipboard contents after the process exited. (Although neither did the X11
backend on my Wayland setup).

## Example

```rust
use arboard::Clipboard;

fn main() {
let mut clipboard = Clipboard::new().unwrap();
println!("Clipboard text was: {}", clipboard.get_text().unwrap());
let mut clipboard = Clipboard::new().unwrap();
println!("Clipboard text was: {}", clipboard.get_text().unwrap());

let the_string = "Hello, world!";
clipboard.set_text(the_string.into()).unwrap();
println!("But now the clipboard text should be: \"{}\"", the_string);
let the_string = "Hello, world!";
clipboard.set_text(the_string.into()).unwrap();
println!("But now the clipboard text should be: \"{}\"", the_string);
}
```

## Yet another clipboard crate

This is a fork of `rust-clipboard`. The reason for forking instead of making a PR is that `rust-clipboard` is not being maintained anymore. Furthermore note that the API of this crate is considerably different from that of `rust-clipboard`. There are already a ton of clipboard crates out there which is a bit unfortunate; I don't know why this is happening but while it is, we might as well just start naming the clipboard crates after ourselves. This one is arboard which stands for Artur's clipboard.
This is a fork of `rust-clipboard`. The reason for forking instead of making a
PR is that `rust-clipboard` is not being maintained any more. Furthermore note
that the API of this crate is considerably different from that of
`rust-clipboard`. There are already a ton of clipboard crates out there which
is a bit unfortunate; I don't know why this is happening but while it is, we
might as well just start naming the clipboard crates after ourselves. This one
is arboard which stands for Artur's clipboard.

0 comments on commit 2042cef

Please sign in to comment.