From 6642c516ad94107cb6047acfc8683eceadb1405f Mon Sep 17 00:00:00 2001 From: HJfod <60038575+HJfod@users.noreply.github.com> Date: Fri, 24 Feb 2023 11:03:54 +0200 Subject: [PATCH] change @note and @warning to form blockquotes --- src/builder/comment.rs | 12 +++++------- templates/content.css | 4 ++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/builder/comment.rs b/src/builder/comment.rs index 4042a18..365fcec 100644 --- a/src/builder/comment.rs +++ b/src/builder/comment.rs @@ -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(), @@ -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(), diff --git a/templates/content.css b/templates/content.css index f877fdb..daf436f 100644 --- a/templates/content.css +++ b/templates/content.css @@ -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); }