Safe Haskell | None |
---|---|
Language | Haskell2010 |
- convertStyle :: Style -> Attr
- convertFlair :: Flair -> MaybeDefault Style
- convertColor :: Color -> MaybeDefault Color
- reset :: Image
- newtype AttrMonoid = AttrMonoid {}
- applyAttrs :: [Span CrdRange Attr] -> YiString -> Image
- textAndStylesToImage :: [(Coord, Attr)] -> [YiString] -> Image
- attrLine :: [(Coord, Attr)] -> YiString -> Image
- pairLines :: [(Coord, b)] -> [a] -> [([(Coord, b)], a)]
- decrRow :: [(Coord, a)] -> [(Coord, a)]
- decrCol :: Int -> [(Coord, a)] -> [(Coord, a)]
- plainText :: YiString -> Image
Documentation
convertStyle :: Style -> Attr Source #
Convert style from Rasa.Ext.Style into Attr
s
convertFlair :: Flair -> MaybeDefault Style Source #
Convert flair from Rasa.Ext.Style into Style
s
convertColor :: Color -> MaybeDefault Color Source #
Convert colors from Rasa.Ext.Style into Color
s
newtype AttrMonoid Source #
A newtype to define a (not necessarily law abiding) Monoid for Attr
which acts as we like.
Monoid AttrMonoid Source # | We want |
applyAttrs :: [Span CrdRange Attr] -> YiString -> Image Source #
Apply a list of styles to the given text, resulting in a Image
.
attrLine :: [(Coord, Attr)] -> YiString -> Image Source #
Applies the list of attrs to the line and returns a Image
. It assumes that the list
contains only Coord
s on the same line (i.e. row == 0)
Should be able to clean this up and provide better guarantees if I do a scan over attrs and get each successive mappend of them, then do T.splitAt for each offset, then apply the attr for each section at the begining of each of T.lines within each group. Ugly I know.