| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
NanoUI.Widgets.RichText
Description
Paragraphs of mixed-style text and links.
Synopsis
- data Inline
- inlineText :: Text -> Inline
- inlineWith :: (Layout -> Layout) -> Text -> Inline
- restyle :: (Layout -> Layout) -> Inline -> Inline
- strong :: Text -> Inline
- emphasis :: Text -> Inline
- inlineCode :: Text -> Inline
- hyperlink :: Text -> Text -> Inline
- richText :: forall (es :: [Effect]). Ui :> es => [Inline] -> Eff es (Maybe Text)
- richText' :: forall (es :: [Effect]). Ui :> es => [Inline] -> Eff es (Response, Maybe Text)
- richTextWith :: forall (es :: [Effect]). Ui :> es => (Layout -> Layout) -> [Inline] -> Eff es (Maybe Text)
- richTextWith' :: forall (es :: [Effect]). Ui :> es => (Layout -> Layout) -> [Inline] -> Eff es (Response, Maybe Text)
Documentation
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
| IsString Inline Source # | |
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.
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 #