brick-0.29.1: A declarative terminal user interface library

Safe HaskellNone
LanguageHaskell2010

Brick.Markup

Description

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.

Synopsis

Documentation

data Markup a Source #

Markup with metadata type a assigned to each character.

Instances

Show a => Show (Markup a) Source # 

Methods

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

show :: Markup a -> String #

showList :: [Markup a] -> ShowS #

Monoid a => IsString (Markup a) Source # 

Methods

fromString :: String -> Markup a #

Monoid (Markup a) Source # 

Methods

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

Methods

getAttr :: a -> RenderM n Attr Source #

Where to get the attribute for this attribute metadata.