balkon-1.3.0.0: Text layout engine built on top of HarfBuzz.
Safe HaskellNone
LanguageHaskell2010

Data.Text.ParagraphLayout.ParagraphConstruction

Description

Deprecated: Use Data.Text.ParagraphLayout.Rich instead.

Infix operators for construction of legacy plain text paragraphs with readable code.

Example construction:

let en = (,) defaultSpanOptions { spanLanguage = "en" }
    ja = (,) defaultSpanOptions { spanLanguage = "ja" }
in "ignored prefix" |< en "one two " >|< ja "三四" >| "ignored suffix"

Special syntax for paragraphs with no contents:

"ignored prefix" |<>| "ignored suffix"
Synopsis

Documentation

(>|) :: (SpanOptions, String) -> String -> (Text, [Span ()]) infixr 5 #

Create first span with optional ignored suffix.

(>|<) :: (SpanOptions, String) -> (Text, [Span ()]) -> (Text, [Span ()]) infixr 5 #

Create next span.

(|<) :: String -> (Text, [Span ()]) -> ParagraphOptions -> Paragraph () infixr 5 #

Add optional ignored prefix and wrap in a Paragraph.

(|<>|) :: String -> String -> ParagraphOptions -> Paragraph () infixr 5 #

Create a Paragraph with no spans, just two ignored texts.