pub enum TextStyle {
Heading {
depth: u8,
},
HeadingRule {
depth: u8,
},
Rule,
TableBorder,
Bold,
Italic,
Emphasis,
Underline,
Monospace,
SmallCaps,
Verbatim,
Link {
href: String,
},
}Expand description
What a style mark (TextStyleMark) says about the printed range it
covers: a property of the content that plain text cannot show, such as
bold weight or the address of a link, or the characters the text output
draws to set content apart, such as the rule under a heading.
The emitter records one for each presentation node that carries such a
property, and one for each such drawing (the
module documentation
lists them). A program that writes the text to a medium able to show the
property reads the style marks: the extension profile-tty, which is
compiled into the flm program, paints them with terminal escape
sequences.
§Examples
use flm_core::stdlib::backends::text::TextStyle;
assert_eq!(TextStyle::Bold.name(), "bold");
let link = TextStyle::Link { href: String::from("https://example.com") };
assert_eq!(link.name(), "link");Variants§
Heading
The title of a heading, block or run-in.
Fields
depth: u8How deep the heading is below the root heading level, as
heading_depth counts it: 0 for a heading at the root level
(TextRenderOptions::root_heading_level), 1 for one level
deeper, and so on; 0 for a heading above the root level.
HeadingRule
The characters the text output draws to mark a heading: the rule
under a heading at depth 0 or 1, and the # characters in front of a
deeper heading, with the space after them.
Rule
A rule line the text output draws above or under the body of a
flm.pres.text.ruled node, such as the
rules around a document’s title. The emitter records one mark for each
rule line.
TableBorder
The characters the text output draws for a table: its frame, or the
rule of - under its header rows
(TextRenderOptions::table_frame).
The emitter records one mark for each maximal run of such characters on
a line: a whole rule or frame line, and each bar before, between and
after the cells on its own; the padding spaces around the cells are
outside them.
Bold
A span of bold weight (\textbf).
Italic
A span of italic shape (\textit).
Emphasis
A span of semantic emphasis (\emph).
Underline
An underlined span.
Monospace
A span in a monospaced face (\texttt).
SmallCaps
A span in small capitals.
Verbatim
Verbatim content, inline or as a block.
Link
The content of a link, without the address the text output may print after it.
Fields
href: StringThe link’s target exactly as the link’s payload holds it
(LinkPayload::href):
# followed by an anchor for a place inside the document, an
address otherwise.
Implementations§
Trait Implementations§
impl Eq for TextStyle
impl StructuralPartialEq for TextStyle
Auto Trait Implementations§
impl Forget for TextStyle
impl Freeze for TextStyle
impl Move for TextStyle
impl RefUnwindSafe for TextStyle
impl Send for TextStylewhere
RawVecInner: Send,
impl Sync for TextStylewhere
RawVecInner: Sync,
impl Unpin for TextStyle
impl UnsafeUnpin for TextStyle
impl UnwindSafe for TextStylewhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more