Citeproc.CaseTransform

citeproc-0.6.0.1: Generates citations and bibliography from CSL styles.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Citeproc.CaseTransform

Description

Provides functions that facilitate defining textcase transformations. To see how these can be used used, see the definitions of `addTextCase` in Citeproc.Pandoc and Citproc.CslJson.

Synopsis

- data CaseTransformState
  - = Start
  - | StartSentence
  - | AfterWordEnd
  - | AfterWordChar
  - | AfterSentenceEndingPunctuation
  - | BeforeLastWord
- newtype CaseTransformer = CaseTransformer {
  - unCaseTransformer :: Maybe Lang -> CaseTransformState -> Text -> Text
  }
- withUppercaseAll :: CaseTransformer
- withLowercaseAll :: CaseTransformer
- withCapitalizeWords :: CaseTransformer
- withCapitalizeFirst :: CaseTransformer
- withSentenceCase :: CaseTransformer
- withTitleCase :: CaseTransformer

# Documentation

data CaseTransformState #

Tracks context in textcase transformations.

Constructors

Start |
StartSentence |
AfterWordEnd |
AfterWordChar |
AfterSentenceEndingPunctuation |
BeforeLastWord |

#### Instances

Instances details

Show CaseTransformState # |
Instance details Defined in Citeproc.CaseTransform Methods showsPrec :: Int -> CaseTransformState -> ShowS # show :: CaseTransformState -> String # showList :: [CaseTransformState] -> ShowS #
Eq CaseTransformState # |
Instance details Defined in Citeproc.CaseTransform Methods (==) :: CaseTransformState -> CaseTransformState -> Bool # (/=) :: CaseTransformState -> CaseTransformState -> Bool #

newtype CaseTransformer #

Wraps a function used to define textcase transformations.

Constructors

CaseTransformer |
Fields unCaseTransformer :: Maybe Lang -> CaseTransformState -> Text -> Text

withUppercaseAll :: CaseTransformer #

Uppercase everything.

withLowercaseAll :: CaseTransformer #

Lowercase everything.

withCapitalizeWords :: CaseTransformer #

Capitalize all words.

withCapitalizeFirst :: CaseTransformer #

Capitalize first letter.

withSentenceCase :: CaseTransformer #

Capitalize first letter of each sentence.

withTitleCase :: CaseTransformer #

Use title case.