brick-0.5: 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

markup :: (Eq a, GetAttr a) => Markup a -> Widget 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.

Methods

getAttr :: a -> RenderM Attr Source

Where to get the attribute for this attribute metadata.