brick-0.37.1: A declarative terminal user interface library

Safe HaskellNone



This module provides an API for turning "markup" values into widgets. This module uses the Data.Text.Markup interface in this package to assign attributes to substrings in a text string; to manipulate markup using (for example) syntax highlighters, see that module.



data Markup a Source #

Markup with metadata type a assigned to each character.


Show a => Show (Markup a) Source # 


showsPrec :: Int -> Markup a -> ShowS #

show :: Markup a -> String #

showList :: [Markup a] -> ShowS #

Monoid a => IsString (Markup a) Source # 


fromString :: String -> Markup a #

Semigroup (Markup a) Source # 


(<>) :: Markup a -> Markup a -> Markup a #

sconcat :: NonEmpty (Markup a) -> Markup a #

stimes :: Integral b => b -> Markup a -> Markup a #

Monoid (Markup a) Source # 


mempty :: Markup a #

mappend :: Markup a -> Markup a -> Markup a #

mconcat :: [Markup a] -> Markup a #

markup :: (Eq a, GetAttr a) => Markup a -> Widget n Source #

Build a widget from markup.

(@?) :: Text -> AttrName -> Markup AttrName Source #

Build a piece of markup from text with an assigned attribute name. When the markup is rendered, the attribute name will be looked up in the rendering context's AttrMap to determine the attribute to use for this piece of text.

class GetAttr a where Source #

A type class for types that provide access to an attribute in the rendering monad. You probably won't need to instance this.

Minimal complete definition



getAttr :: a -> RenderM n Attr Source #

Where to get the attribute for this attribute metadata.