Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module provides an API for "marking up" text with arbitrary values. A piece of markup can then be converted to a list of pairs representing the sequences of characters assigned the same markup value.
This interface is experimental. Don't use this for your full-file syntax highlighter just yet!
Documentation
Markup with metadata type a
assigned to each character.
markupToList :: Eq a => Markup a -> [[(Text, a)]] Source #
Convert markup to a list of lines. Each line is represented by a list of pairs in which each pair contains the longest subsequence of characters having the same metadata.
markupSet :: Eq a => (Int, Int) -> a -> Markup a -> Markup a Source #
Set the metadata for a range of character positions in a piece of markup. This is useful for, e.g., syntax highlighting.