lima-0.2.1.2: Convert between Haskell, Markdown, Literate Haskell, TeX
Safe HaskellSafe-Inferred
LanguageHaskell2010

Converter.Internal

Synopsis

Documentation

newtype Pretty a Source #

A wrapper for prettyprinting strings

Constructors

Pretty String 

Instances

Instances details
Show a => Show (Pretty a) Source # 
Instance details

Defined in Converter.Internal

Methods

showsPrec :: Int -> Pretty a -> ShowS #

show :: Pretty a -> String #

showList :: [Pretty a] -> ShowS #

class Show a => PrettyPrint a where Source #

A class for prettyprinting data on multiple lines in haddocks.

It's not meant to be used outside of this library.

Methods

pp :: a -> Pretty String Source #

A printing function

It's not meant to be used outside of this library.

Instances

Instances details
PrettyPrint Tokens Source # 
Instance details

Defined in Converter

Methods

pp :: Tokens -> Pretty String Source #

PrettyPrint Text Source # 
Instance details

Defined in Converter.Internal

Methods

pp :: Text -> Pretty String Source #

PrettyPrint String Source # 
Instance details

Defined in Converter.Internal

Methods

pp :: String -> Pretty String Source #

PrettyPrint (Config User) Source # 
Instance details

Defined in Converter

escapedHash :: Text Source #

Escaped hash character

hash :: Text Source #

Hash character

dropLen :: Text -> Text -> Text Source #

Drop a prefix of a line with length of a given line

startsWith :: Text -> Text -> Bool Source #

Check if a list starts with a given list

endsWith :: Text -> Text -> Bool Source #

Check if a list ends with a given list

stripEnds :: Text -> Text -> Text -> Text Source #

Drop leading spaces and drop at each end of a Text the number of characters as in the supplied prefix and suffix.

stripSpaces :: Text -> Text Source #

Drop spaces at the start and the end of a Text.

stripList :: Eq a => a -> [a] -> [a] Source #

Strip the given value from the beginning and the end of a list.

indentN :: Int -> Text -> Text Source #

Pad a Text with a given number of spaces

constructorName :: Data a => a -> String Source #

Show the name of a constructor.

stripEmpties :: [Text] -> [Text] Source #

Remove empty lines from the beginning and the end of a list.

dropEmpties :: [Text] -> [Text] Source #

Drop leading empty strings

isEnclosedWith :: Text -> Text -> Text -> Bool Source #

Check if a line without leading spaces is surrounded by the given Texts.

countSpaces :: Text -> Int Source #

Count leading spaces in a Text.

errorEmptyCommentAt :: Show a1 => a1 -> a2 Source #

Show error with line number for a token. errorEmptyCommentAt :: Int -> String

prependTexComment :: Text -> Text Source #

Prepend start of a TeX comment ('% ') to a Text.

dropTexComment :: Show a => Text -> a -> Text Source #

Drop start of a TeX comment from a Text.

texComment :: Text Source #

Start a TeX comment.

texCommentSpace :: Text Source #

Start a TeX comment plus a space.

lhsComment :: Text Source #

Start a Literate Haskell comment.

lhsCommentSpace :: Text Source #

Start a Literate Haskell comment plus a space.

lhsHsCode :: Text Source #

Start a Literate Haskell line of Haskell code.

lhsHsCodeSpace :: Text Source #

Start a Literate Haskell line of Haskell code plus a space.

prependLhsComment :: Text -> Text Source #

Prepend start of a TeX comment ('% ') to a Text.

dropLhsComment :: Show a => Text -> a -> Text Source #

Drop start of a TeX comment from a Text.

lhsUnescapeHash :: Text -> Text Source #

Replace "\#" with "#" in a Text prefix.

lhsEscapeHash :: Text -> Text Source #

Replace "#" with "\#" in a Text prefix.

mdCommentOpen :: Text Source #

Open a Markdown comment.

mdCommentClose :: Text Source #

Close a Markdown comment.

mdCommentOpenSpace :: Text Source #

Open a Markdown comment plus a space.

mdCommentCloseSpace :: Text Source #

A space plus close a Markdown comment.

stripMdComment :: Text -> Text Source #

Strip comment markers from a Text.

isMdComment :: Text -> Bool Source #

Check if a line is a Markdown comment.

hsCommentOpen :: Text Source #

Open a Haskell multi-line comment.

hsCommentOpenSpace :: Text Source #

Open a Haskell multi-line comment plus a space.

hsCommentClose :: Text Source #

Close a Haskell multi-line comment.

hsCommentCloseSpace :: Text Source #

A space plus close a Haskell multi-line comment.

stripHsComment :: Text -> Text Source #

Drop leading spaces and drop at each end of a Text the number of characters as in the supplied prefix and suffix.

isHsComment :: Text -> Bool Source #

Check if a line without leading zeros is a multi-line Haskell comment