drasil-printers-0.1.10.0: A framework for code and document generation for scientific software - Printers SubPackage
Safe HaskellNone
LanguageGHC2024

Language.Drasil.Printing.Helpers

Description

General helper functions for printing Drasil documents.

Synopsis

Separation

($^$) :: Doc -> Doc -> Doc infixl 5 Source #

Custom infix operator for concatenating two Docs vertically with an empty line in between.

vsep :: [Doc] -> Doc Source #

Concatenate a list of Docs vertically with an empty line in between.

Text Rendering

bslash :: Doc Source #

Basic text-rendering helper function.

Single backslash.

dbs :: Doc Source #

Basic text-rendering helper function.

Double backslash.

assign :: Doc Source #

Basic text-rendering helper function.

Variable assignment character ("=").

eq :: Doc Source #

Basic text-rendering helper function.

Equality character ("==").

lt :: Doc Source #

Basic text-rendering helper function.

Less than.

gt :: Doc Source #

Basic text-rendering helper function.

Greater than.

leq :: Doc Source #

Basic text-rendering helper function.

Less than or equal to.

geq :: Doc Source #

Basic text-rendering helper function.

Greater than or equal to.

dlr :: Doc Source #

Basic text-rendering helper function.

Dollar sign.

ast :: Doc Source #

Basic text-rendering helper function.

Asterisk.

pls :: Doc Source #

Basic text-rendering helper function.

Plus.

hat :: Doc Source #

Basic text-rendering helper function.

Hat symbol ("^").

slash :: Doc Source #

Basic text-rendering helper function.

Forward slash.

hyph :: Doc Source #

Basic text-rendering helper function.

Hyphen.

unders :: Doc Source #

Basic text-rendering helper function.

Underscore.

pipe :: Doc Source #

Basic text-rendering helper function.

Pipe.

emptyline :: Doc Source #

Basic text-rendering helper function.

Empty line.

Brackets and Braces

sq :: String -> Doc Source #

Text-rendering helper for wrapping strings with brackets/braces.

Square brackets.

br :: String -> Doc Source #

Text-rendering helper for wrapping strings with brackets/braces.

Curly braces.

Punctuation

dot :: Doc -> Doc Source #

Text-rendering helper for appending a period/decimal point (dot symbol) or a comma.

Dot symbol (".")

comm :: Doc -> Doc Source #

Text-rendering helper for appending a period/decimal point (dot symbol) or a comma.

Comma (",")

Word Wrapping

dollarDoc :: Doc -> Doc Source #

For wrapping $ on both sides of a Doc.

paren :: String -> String Source #

Basic plaintext (String) wrapping.

Wraps in parenthesis.

brace :: String -> String Source #

Basic plaintext (String) wrapping.

Wraps in curly braces.

dollar :: String -> String Source #

Basic plaintext (String) wrapping.

Wraps in dollar signs.

sqbrac :: String -> String Source #

Basic plaintext (String) wrapping.

Wraps in square brackets.

angbrac :: String -> String Source #

Basic plaintext (String) wrapping.

Wraps in angular brackets ("<>").

Numeric Suffixes

sufx :: Int -> String Source #

Appends a suffix for a number. Used only on single digit Ints.

sufxer :: Int -> String Source #

Similar to sufx but used on any sized Int.