Flesh out the markdown example a bit more
This commit is contained in:
parent
910eb72a06
commit
904704d7c1
10 changed files with 435 additions and 141 deletions
|
|
@ -267,12 +267,24 @@ impl<'a, Font> Span<'a, Font> {
|
|||
self
|
||||
}
|
||||
|
||||
/// Sets the font of the [`Span`], if any.
|
||||
pub fn font_maybe(mut self, font: Option<impl Into<Font>>) -> Self {
|
||||
self.font = font.map(Into::into);
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets the [`Color`] of the [`Span`].
|
||||
pub fn color(mut self, color: impl Into<Color>) -> Self {
|
||||
self.color = Some(color.into());
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets the [`Color`] of the [`Span`], if any.
|
||||
pub fn color_maybe(mut self, color: Option<impl Into<Color>>) -> Self {
|
||||
self.color = color.map(Into::into);
|
||||
self
|
||||
}
|
||||
|
||||
/// Turns the [`Span`] into a static one.
|
||||
pub fn to_static(self) -> Span<'static, Font> {
|
||||
Span {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue