Draft Viewer trait for markdown
This commit is contained in:
parent
c02ae0c4a4
commit
5655998761
9 changed files with 588 additions and 234 deletions
|
|
@ -267,25 +267,21 @@ impl Generator {
|
|||
} => {
|
||||
let details = {
|
||||
let title = rich_text![
|
||||
span(&pull_request.title).size(24).link(
|
||||
Message::OpenPullRequest(pull_request.id)
|
||||
),
|
||||
span(&pull_request.title)
|
||||
.size(24)
|
||||
.link(pull_request.id),
|
||||
span(format!(" by {}", pull_request.author))
|
||||
.font(Font {
|
||||
style: font::Style::Italic,
|
||||
..Font::default()
|
||||
}),
|
||||
]
|
||||
.on_link_clicked(Message::OpenPullRequest)
|
||||
.font(Font::MONOSPACE);
|
||||
|
||||
let description = markdown::view(
|
||||
description,
|
||||
markdown::Settings::default(),
|
||||
markdown::Style::from_palette(
|
||||
self.theme().palette(),
|
||||
),
|
||||
)
|
||||
.map(Message::UrlClicked);
|
||||
let description =
|
||||
markdown::view(&self.theme(), description)
|
||||
.map(Message::UrlClicked);
|
||||
|
||||
let labels =
|
||||
row(pull_request.labels.iter().map(|label| {
|
||||
|
|
@ -349,11 +345,11 @@ impl Generator {
|
|||
container(
|
||||
scrollable(
|
||||
markdown::view(
|
||||
preview,
|
||||
markdown::Settings::with_text_size(12),
|
||||
markdown::Style::from_palette(
|
||||
self.theme().palette(),
|
||||
markdown::Settings::with_text_size(
|
||||
12,
|
||||
&self.theme(),
|
||||
),
|
||||
preview,
|
||||
)
|
||||
.map(Message::UrlClicked),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue