Skip to content

Commit

Permalink
change @note and @warning to form blockquotes
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Feb 24, 2023
1 parent b8c72dc commit 6642c51
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/builder/comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,10 +659,9 @@ impl<'e> JSDocComment<'e> {
self.notes
.iter()
.map(|note| {
HtmlElement::new("section")
.with_class("note")
.with_child(Html::span(&["title"], "Note"))
.with_child(Html::div(note.clone()))
HtmlElement::new("blockquote")
.with_class("info")
.with_child(Html::p(format!("ℹ {}", note)))
.into()
})
.collect(),
Expand All @@ -671,10 +670,9 @@ impl<'e> JSDocComment<'e> {
self.warnings
.iter()
.map(|warning| {
HtmlElement::new("section")
HtmlElement::new("blockquote")
.with_class("warning")
.with_child(Html::span(&["title"], "Warning"))
.with_child(Html::div(warning.clone()))
.with_child(Html::p(format!("⚠️ {}", warning)))
.into()
})
.collect(),
Expand Down
4 changes: 4 additions & 0 deletions templates/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,10 @@ details.entity-desc[open] > summary .feather-chevron-right {
display: inline;
}

.description blockquote:not(.warning) {
background-color: var(--flash-dark);
}

.no-desc {
color: var(--flash-light);
}
Expand Down

0 comments on commit 6642c51

Please sign in to comment.