-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the
.set_html()
method (#69)
Implement the `.set_html()` method
- Loading branch information
Showing
7 changed files
with
277 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use arboard::Clipboard; | ||
use simple_logger::SimpleLogger; | ||
use std::{thread, time::Duration}; | ||
|
||
fn main() { | ||
SimpleLogger::new().init().unwrap(); | ||
let mut ctx = Clipboard::new().unwrap(); | ||
|
||
let html = r#"<h1>Hello, World!</h1> | ||
<b>Lorem ipsum</b> dolor sit amet,<br> | ||
<i>consectetur adipiscing elit</i>."#; | ||
|
||
let alt_text = r#"Hello, World! | ||
Lorem ipsum dolor sit amet, | ||
consectetur adipiscing elit."#; | ||
|
||
ctx.set_html(html, Some(alt_text)).unwrap(); | ||
thread::sleep(Duration::from_secs(5)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.