nano-ui
Safe HaskellNone
LanguageGHC2024

NanoUI.Widgets.RichText

Description

Paragraphs of mixed-style text and links.

Synopsis

Documentation

data Inline Source #

A piece of a paragraph: text in one style, and the hyperlink it follows when it is one. A string literal is plain text.

Instances

Instances details
IsString Inline Source # 
Instance details

Defined in NanoUI.Widgets.RichText

Methods

fromString :: String -> Inline #

inlineText :: Text -> Inline Source #

Text in the paragraph's own style.

inlineWith :: (Layout -> Layout) -> Text -> Inline Source #

Text styled by font modifiers (fontBold, fontSize 20, fontColor red . fontUnderline), applied over the paragraph's layout.

restyle :: (Layout -> Layout) -> Inline -> Inline Source #

Add font modifiers to a piece, a hyperlink included.

strong :: Text -> Inline Source #

Bold text.

emphasis :: Text -> Inline Source #

Italic text.

inlineCode :: Text -> Inline Source #

Monospaced text.

hyperlink :: Text -> Text -> Inline Source #

hyperlink target label: text in the theme's link colour, underlined while hovered, whose click the paragraph reports as target.

richText :: forall (es :: [Effect]). Ui :> es => [Inline] -> Eff es (Maybe Text) Source #

A paragraph of pieces, wrapped at its width. Returns the target of the hyperlink clicked this frame.

richText' :: forall (es :: [Effect]). Ui :> es => [Inline] -> Eff es (Response, Maybe Text) Source #

richTextWith :: forall (es :: [Effect]). Ui :> es => (Layout -> Layout) -> [Inline] -> Eff es (Maybe Text) Source #

richText with a layout modifier, whose font choices are the default for every piece.

richTextWith' :: forall (es :: [Effect]). Ui :> es => (Layout -> Layout) -> [Inline] -> Eff es (Response, Maybe Text) Source #