Add Copy action to code blocks in markdown example
This commit is contained in:
parent
387abafa3a
commit
e8020f3eaf
9 changed files with 93 additions and 12 deletions
15
examples/markdown/src/icon.rs
Normal file
15
examples/markdown/src/icon.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Generated automatically by iced_fontello at build time.
|
||||
// Do not edit manually. Source: ../fonts/markdown-icons.toml
|
||||
// dcd2f0c969d603e2ee9237a4b70fa86b1a6e84d86f4689046d8fdd10440b06b9
|
||||
use iced::widget::{text, Text};
|
||||
use iced::Font;
|
||||
|
||||
pub const FONT: &[u8] = include_bytes!("../fonts/markdown-icons.ttf");
|
||||
|
||||
pub fn copy<'a>() -> Text<'a> {
|
||||
icon("\u{F0C5}")
|
||||
}
|
||||
|
||||
fn icon(codepoint: &str) -> Text<'_> {
|
||||
text(codepoint).font(Font::with_name("markdown-icons"))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue